Worklight console is not opening - eclipse

I use Java 7 and when I try to start worklight console from Eclipse I get server errors.
In browser I get the message "Server error. Contact the server administrator." in IBM MobileFirst Platform Operations Console.
Application's preview is not accessible also.
This is my logs from console:
[WARNING ] CWNEN0070W: The javax.ws.rs.CookieParam annotation class will not be recognized because it was loaded from the null location rather than from a product class loader.
[WARNING ] CWNEN0070W: The javax.ws.rs.PathParam annotation class will not be recognized because it was loaded from the null location rather than from a product class loader.
[WARNING ] CWNEN0070W: The javax.ws.rs.HeaderParam annotation class will not be recognized because it was loaded from the null location rather than from a product class loader.
[WARNING ] CWNEN0070W: The javax.ws.rs.QueryParam annotation class will not be recognized because it was loaded from the null location rather than from a product class loader.
[WARNING ] CWNEN0070W: The javax.ws.rs.MatrixParam annotation class will not be recognized because it was loaded from the null location rather than from a product class loader.
[WARNING ] CWNEN0070W: The javax.ws.rs.core.Context annotation class will not be recognized because it was loaded from the null location rather than from a product class loader.
[AUDIT ] CWWKZ0001I: Application WorklightConsole started in 9.391 seconds.
[AUDIT ] CWWKZ0001I: Application WorklightAnalytics started in 9.917 seconds.
[ERROR ] SRVE0283E: Exception caught while initializing context: java.lang.ExceptionInInitializerError
at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2227)
at [internal classes]
Caused by: java.lang.IllegalStateException: Could not load 'ContextLoader.properties': class path resource [ContextLoader.properties] cannot be opened because it does not exist
... 6 more
[ERROR ] SRVE0283E: Exception caught while initializing context: java.lang.NullPointerException
at com.ibm.worklight.admin.common.util.Messages.getResourceString(Messages.java:208)
at com.ibm.worklight.admin.common.util.Messages.get(Messages.java:230)
at com.ibm.worklight.admin.common.util.Messages.getString(Messages.java:254)
at com.ibm.worklight.admin.common.util.GeneralUtil.getProductBuildVersion(GeneralUtil.java:50)
at com.ibm.worklight.admin.listeners.WorklightManagementServletContextListener.contextInitialized(WorklightManagementServletContextListener.java:41)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2227)
at [internal classes]
[ERROR ] M:\IBM\From_Sergey\Mobilefirst%20eclipse\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_94.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
M:\IBM\From_Sergey\Mobilefirst%20eclipse\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_94.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
[ERROR ] M:\IBM\From_Sergey\Mobilefirst%20eclipse\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_94.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
M:\IBM\From_Sergey\Mobilefirst%20eclipse\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_94.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
[ERROR ] Uncaught.init.exception.thrown.by.servlet ManagementServlet WorklightServices java.lang.ExceptionInInitializerError
at org.apache.wink.server.internal.DeploymentConfiguration.initAlternateShortcutMap(DeploymentConfiguration.java:386)
at org.apache.wink.server.internal.DeploymentConfiguration.init(DeploymentConfiguration.java:167)
at org.apache.wink.server.internal.servlet.RestServlet.getDeploymentConfiguration(RestServlet.java:202)
at org.apache.wink.server.internal.servlet.RestServlet.createRequestProcessor(RestServlet.java:138)
at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:103)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)
at [internal classes]
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.apache.wink.common.internal.i18n.resource, locale en_US
... 14 more
[ERROR ] SRVE0266E: Error occured while initializing servlets: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:395)
at [internal classes]
Caused by: java.lang.ExceptionInInitializerError
at org.apache.wink.server.internal.DeploymentConfiguration.initAlternateShortcutMap(DeploymentConfiguration.java:386)
at org.apache.wink.server.internal.DeploymentConfiguration.init(DeploymentConfiguration.java:167)
at org.apache.wink.server.internal.servlet.RestServlet.getDeploymentConfiguration(RestServlet.java:202)
at org.apache.wink.server.internal.servlet.RestServlet.createRequestProcessor(RestServlet.java:138)
at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:103)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)
... 1 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.apache.wink.common.internal.i18n.resource, locale en_US
... 14 more

I think you're using Java 8.
Worklight/MobileFirst Platform does not support Java 8 at this time.
Please downgrade to Java 6 or 7 and try again.

Related

spring-boot configure hibernate-ogm for MongoDB

APPLICATION FAILED TO START
Description:
Cannot determine embedded database driver class for database type NONE
Action:
If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (the profiles "local" are currently active).
2016-11-10 18:36:52.335 ERROR 1288 --- [ main] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener#d83da2e] to prepare test instance [com.example.DemoApplicationTests#1f68e4e8]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124) ~[spring-test-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:83) ~[spring-test-4.3.4.RELEASE.jar:4.3.4.RELEASE]

Worklight Console initialization failed.Logged Exception: org.hsqldb.HsqlException: Out of Memory

I am getting below error when I try to deploy my application in IBM worklight environment. Suddenly I am facing this error but earlier it worked well.
Could you please any one help me, is there any settings I have modify in the project.
Error is :
[AUDIT ] CWWKG0016I: Starting server configuration update.
[AUDIT ] CWWKG0017I: The server configuration was successfully updated in 0.100 seconds.
[AUDIT ] CWWKT0017I: Web application removed (default_host): http://ADMINIB-9PGB9N2.in.ibm.com:10080/GDMSLoginApp/
[AUDIT ] CWWKZ0009I: The application GDMSLoginApp has stopped successfully.
[AUDIT ] CWWKG0016I: Starting server configuration update.
[AUDIT ] CWWKG0017I: The server configuration was successfully updated in 0.061 seconds.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://ADMINIB-9PGB9N2.in.ibm.com:10080/GDMSLoginApp/
[ERROR ] out of memory processing logC:\GDMS\GDMSmobileMenu2\WorklightServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\72\data\temp\default_node\SMF_WebContainer\GDMSLoginApp\GDMSLoginApp/hsqldb/WRKLGHT line: 4
Java heap space
[ERROR ] could not reopen database
Out of Memory
[ERROR ] FWLSE0188E: Failed to connect to HSQL database : Cannot create PoolableConnectionFactory (Out of Memory) [project GDMSLoginApp]
[ERROR ] FWLST0003E: ========= Failed starting project /GDMSLoginApp [project GDMSLoginApp]
Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/GDMS/GDMSmobileMenu2/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/GDMS/GDMSmobileMenu2/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/GDMS/GDMSmobileMenu2/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/GDMS/GDMSmobileMenu2/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Out of Memory)
[AUDIT ] CWWKZ0001I: Application GDMSLoginApp started in 1.834 seconds.
[ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: org.hsqldb.HsqlException: Out of Memory
at com.worklight.core.auth.impl.AuthenticationFilter.verifyServletInitialized(AuthenticationFilter.java:305)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
Caused by: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: org.hsqldb.HsqlException: Out of Memory
... 5 more
The issue here is the following from the log:
Logged Exception: org.hsqldb.HsqlException: Out of Memory
Try increasing Eclipse's available memory.
Close Eclipse
Open eclipse.ini, located in the Eclipse installation folder
Find in the file the following (the numbers may differ):
-vmargs
-Xms128m
-Xmx512m
Increase the numbers to 512 or 1024 and re-open Eclipse.
I ran into this same issue despite changing my memory settings within eclipse.ini. The problem was resolved by performing the following steps:
Stop your Liberty Worklight Development Server by right-clicking on it in the Servers tab
Right-click on it and select "Clean..."
Start your Liberty server again
Re-install your .adapters and .wlapps as needed
Try again

LogManager Exception in JBOSS AS 7.1 with java.util.Logger

I created a java application and initialize a java.util.Logger with that application and run that application as -javaagent with jboss AS 7 server and i got IllegalStateException (i am using eclipse IDE).Here follows my logger initialization code
static public void setup() throws IOException {
// Get the global logger to configure it
Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
logger.setLevel(Level.INFO);
fileTxt = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.txt");
fileHTML = new FileHandler("C:/Users/abc/Desktop/ATAGENT/Logging.html");
// create txt Formatter
formatterTxt = new SimpleFormatter();
fileTxt.setFormatter(formatterTxt);
logger.addHandler(fileTxt);
// create HTML Formatter
formatterHTML = new BMITHtmlFormatter();
fileHTML.setFormatter(formatterHTML);
logger.addHandler(fileHTML);
}
When i create -javaagent jar appended with above lines of code and run with jboss as7 server i got following exception
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
... 7 more
And i serched in fourms and i got a solution which is Open the launch configuration for the server definition.
and add -logmodule org.jboss.logmanager to the program arguments before org.jboss.as.standalone.
But it results the same exception with some additional warning. Here follows the exception
WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jboss.as.server.Main.main(Main.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:260)
at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
... 7 more
I had the same problem with JBOSS EAP 6, it took me 2 days for find a solution !.
The cause is that your agent need to create a Logger at statup, he need to be able to access the logmanager classes before JBOSS Modules has been initialized. You need to add JBoss LogManager to the boot classloader. Then, there will be a conflict between LogManager available via ModuleClassLoader and classes loaded via system classloader.
The solution is to make Java Agent and JBoss Modules use the same classloader to load the LogManager classes.
For EAP 6, In your standalone.conf (or domain) (It must be close for your version)
add
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/main/jboss-logmanager-1.3.1.jar"
and for make Java Agent and JBoss Modules use the same classloader
modify this piece of code in adding org.jboss.logmanager like this :
if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,org.jboss.logmanager"
fi
Hope this will help.
I found the solution after searching for couple of days in the below link.
https://github.com/jbossas/jboss-as-maven-plugin/issues/40#issuecomment-14943429
I have to tweak a little bit to get is work in Windows 7.
Open Eclipse.
Add Jboss 7.1 Runtime 1 server.
Select the Server and press F3.
Click on Open Launch Config.
Goto VM arguments.
Add the below two entries.
"-Djboss.modules.system.pkgs=org.jboss.byteman,org.jboss.logmanager"
"-Djava.util.logging.manager=org.jboss.logmanager.LogManager"
Now select the Classpath TAB
Select User Entries
Click Add External Jars
Select the three jar files
a) jboss-logmanager-1.2.0.GA.jar
b) jboss-logmanager-log4j-1.0.0.GA.jar
c) log4j-1.2.16.jar
Paths
C:/jboss-as-7.1.1.Final/modules/org/jboss/logmanager/main/jboss-logmanager-1.2.0.GA.jar"
C:/jboss-as-7.1.1.Final/modules/org/jboss/logmanager/log4j/main/jboss-logmanager-log4j-1.0.0.GA.jar"
C:/jboss-as-7.1.1.Final/modules/org/apache/log4j/main/log4j-1.2.16.jar"
This will start the standalone jboss without any issues.
In EAP 6.4, the correct logmanager's path should be
$JBOSS_HOME/modules/system/layers/base/org/jboss/logmanager/main/jboss-logmanager-1.5.4.Final-redhat-1.jar

Error : clicking on add input controls in jasper server

Environment Description:
- Application server is JBoss eap 5.1, database used is Postgresql9.2,
OS is Redhat Enterprise Server 6.2
- Jasper report server 5.1
- Integrated with Active Directory
Most of the functionality of the jasper server is working fine. I can run report, create new report .All this functionality is working.
I can add input control in iReport but not in jasper server.But when i am trying to add new input control in jasper server i am getting exceptions.
Exception list:
.java.lang.IllegalStateException: Exception occurred rendering view org.springframework.web.servlet.view.JstlView: name
.javax.servlet.ServletException: java.lang.ClassFormatError: Truncated class file
.java.lang.ClassFormatError: Truncated class file
Please let me know why i gettting this error. What is solution for this.
Error trace:
Unknown Object Server Error
The server has encountered an error. Please excuse the inconvenience.
Error Message
java.lang.IllegalStateException: Exception occurred rendering view
org.springframework.web.servlet.view.JstlView: name
'modules/addResource/jasperReport/locateControlResource'; URL
[/WEB-INF/jsp/modules/addResource/jasperReport/locateControlResource.jsp]
Error Trace
java.lang.IllegalStateException: Exception occurred rendering view
org.springframework.web.servlet.view.JstlView: name
'modules/addResource/jasperReport/locateControlResource'; URL
[/WEB-INF/jsp/modules/addResource/jasperReport/locateControlResource.jsp]
at
org.springframework.webflow.mvc.view.AbstractMvcView.render(AbstractMvcView.java:191)
at
org.springframework.webflow.engine.ViewState.render(ViewState.java:296)
at
org.springframework.webflow.engine.ViewState.doEnter(ViewState.java:186)
at org.springframework.webflow.engine.State.enter(State.java:194) at
org.springframework.webflow.engine.Transition.execute(Transition.java:227)
at
org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:393)
org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
at
org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
at
org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:388)
at
org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
at
org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:232)
at
org.springframework.webflow.engine.ViewState.resume(ViewState.java:196)
at org.springframework.webflow.engine.Flow.resume(Flow.java:545) at
org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:261)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:679) Caused by:
javax.servlet.ServletException: java.lang.ClassFormatError: Truncated
> Error Message
javax.servlet.ServletException: java.lang.ClassFormatError: Truncated
class file
> Error Trace
javax.servlet.ServletException: java.lang.ClassFormatError: Truncated
class file at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:127)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:56)
com.jaspersoft.jasperserver.api.security.WebAppSecurityFilter.doFilter(WebAppSecurityFilter.java:76)
at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
> Error Message
java.lang.ClassFormatError: Truncated class file
> Error Trace
java.lang.ClassFormatError: Truncated class file at
java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClass(ClassLoader.java:634) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at
java.net.URLClassLoader.access$000(URLClassLoader.java:73) at
java.net.URLClassLoader$1.run(URLClassLoader.java:212) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:205) at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:135)
at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:67)
at
org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:249)
at
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:145)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at
Found Answer for this:
I would suggest that you should try to:
- clear the work folder on JBoss application server (in this folder could be stored the compiled version of the page that caused this stack trace)
For JBoss 6.0 deployment, it might be in
jboss-eap-6.0\standalone\tmp\work\jboss.web\default-host\jasperserver-pro
For JBoss 7.1 deployment, it might be in
jboss-7.1\standalone\tmp\work\jboss.web\default-host\jasperserver-pro.
Please clarify the actual location of this folder in your system and delete the data .

Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' [duplicate]

This question already has answers here:
javax.persistence.PersistenceException : [PersistenceUnit: vodPersistenceUnit] class or package not found
(4 answers)
Closed 5 years ago.
Error creating bean with name
'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in URL [file:/E:/source-files-healthentic/securityadmin/build/test/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/E:/source-files-healthentic/securityadmin/build/test/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in URL [file:/E:/source-files-healthentic/securityadmin/build/test/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/E:/source-files-healthentic/securityadmin/build/test/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:411)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:382)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:268)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:597)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:366)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
at org.apache.struts2.StrutsSpringTestCase.setupBeforeInitDispatcher(StrutsSpringTestCase.java:39)
at org.apache.struts2.StrutsTestCase.setUp(StrutsTestCase.java:208)
at healthentic.admin.action.StrutsSpringBase2Setup.setUp(StrutsSpringBase2Setup.java:128)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [file:/E:/source-files-healthentic/securityadmin/build/test/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1330)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:411)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:382)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:271)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:268)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:174)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:309)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:266)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:122)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:78)
at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:97)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1318)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:475)
Caused by: java.lang.IllegalStateException: Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation.
at org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.addTransformer(InstrumentationLoadTimeWeaver.java:88)
at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.addTransformer(SpringPersistenceUnitInfo.java:80)
at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:225)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1361)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1327)
I'm getting this error when running my application(using Struts2 spring3 integrated and jpa eclipse link ) junit test.... how can i resolve this problem................ kindly check ans suggest me....
To help others with this issue,
I have he same problem after including some of the APIS thst uses later Spring (3.x.) versions to the existing project.
My application was started up successfully in one machine but failed on another machine. After investigating carefully we found this,
On the machine it was failing, the PersistenceExceptionTranslationPostProcessor was loaded from spring-dao-2.0.8.jar
[Loaded org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor from file:/lib/spring-dao-2.0.8.jar]
Where as on the other machine it was loaded from spring-tx-3.1.1.RELEASE.jar
[Loaded org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor from file:/lib/spring-tx-3.1.1.RELEASE.jar]
Then I tried removing the spring-dao-2.0.8.jar from the class-path and tried, it worked.
spring-dao-2.0.8.jar was an unnecessary dependency.
Regards
Lyju
The error states,
"Must start with Java agent to use InstrumentationLoadTimeWeaver. See Spring documentation."
so, you either need to use the Spring Java agent to start your JVM, or need to disable the InstrumentationLoadTimeWeaver.
See,
How to configure EclipseLink 2.0 and Spring 3.0.5 and Tomcat 6?
For JPA weaving with EclipseLink, you can also use the static weaver, then no agent or instrumentation is required.