When i am trying to deploy the product in jboss 5.
I am using toplink-essentials for the JPA 1.0.
This product is running successfully on tomcat 6.
But in jboss it is showing errors.
I am trying to deploy the product through Eclipse IDE.
Error output :
19:38:27,983 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#Entity state=Create
javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [Entity] failed.
Internal Exception: java.lang.NullPointerException
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:615)
at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:178)
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
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.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
Caused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b40-rc (03/21/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [Entity] failed.
Internal Exception: java.lang.NullPointerException
at oracle.toplink.essentials.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:212)
... 62 more
Caused by: java.lang.NullPointerException
at oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelper.parseDocument(XMLHelper.java:623)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.readStandardMappingFiles(MetadataProcessor.java:369)
at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.readMappingFiles(MetadataProcessor.java:339)
at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:344)
at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:584)
... 61 more
........
........
........
15:37:39,014 WARN [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
DEPLOYMENTS IN ERROR:
Deployment "persistence.unit:unitName=#Entity" is in error due to the following reason(s): java.lang.NullPointerException
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Here is my persistence.xml file...
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="Entity" transaction-type="RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<non-jta-data-source>java:/iport</non-jta-data-source>
<class>env.model.masters.IptNotifications</class>
<class>env.model.masters.IptNotificationslines</class>
<properties>
<property name="toplink.jdbc.driver"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="toplink.jdbc.url"
value="jdbc:sqlserver://x.x.x.x:1433;databaseName=MyDatabase" />
<property name="toplink.jdbc.user" value="xx" />
<property name="toplink.jdbc.password" value="xx" />
</properties>
</persistence-unit>
I am using Struts 2.1.x, spring 1.2.x, jpa 1.0, toplink-essentials 2.0
Please help me to solve the problem...
Edited on 29/04/2013:
Hello Please any body can help me...
I can understand one thing, that there is some thing wrong in persistence.xml and it's data.
After so much googled, i had found some solutions.... like....
1) Remove the "private static final long serialVersionUID = 1L;" from all pojos.
2) There should not be white space in persistence.xml inside tag.
3) Change the JTA datasource from NON-JTA datasoucre.
I had changed all things as per the above mentioned points.
But still i am getting the same error.
My updated peresistence.xml is..
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name="Entity" transaction-type="JTA">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<jta-data-source>java:/iport</jta-data-source>
<class>env.model.masters.IptNotifications</class>
<class>env.model.masters.IptNotificationslines</class>
<properties>
<property name="toplink.jdbc.driver"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="toplink.jdbc.url"
value="jdbc:sqlserver://x.x.x.x:1433;databaseName=MyDatabase" />
<property name="toplink.jdbc.user" value="xx" />
<property name="toplink.jdbc.password" value="xx" />
</properties>
</persistence-unit>
</persistence>
Please verify the problem. and suggest me a possible solution.
I also have the orm.xml file.
The code is like below..
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_2_0.xsd"
version="1.0">
<persistence-unit-metadata>
<persistence-unit-defaults>
<schema>MySchema</schema>
<catalog>MyDatabase</catalog>
</persistence-unit-defaults>
</persistence-unit-metadata>
</entity-mappings>
Please verify it
The error is occurring when TopLink Essentials is trying to load the default orm.xml file. Do you have one? Check that your file is valid and its namespace etc. are correct. If you don't have one, you could trying adding one.
Also try to upgrade to the latest TopLink Essentials patch release, or upgrade to EclipseLink, which replaced TopLink Essentials since 2008.
The exception doesn't explain much, but at least in Glassfish, transaction-type must be set to JTA instead of RESOURCE_LOCAL in the persistence.xml file, because as a full blown Java EE Application Server, it wants to have JTA transactions ready to use for EJB's and to inject container managed EntityManagers.
If that's also the problem with JBoss and you are using Spring, there are workarounds like changing the name of persistence.xml file to something else, so JBoss doesn't try to load the persistence unit that is already being handled by Spring.
Related
I am getting the following error when I run my application through SBT Console in Intellij IDEA.
[info] play - Application started (Dev)
[error] c.i.c.c.t.ThriftClientFactory - Error during pool creation: caused by
org.apache.thrift.TException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at net.dataforte.cassandra.pool.ConnectionPool.init(ConnectionPool.java:345) ~[cassandra-connection-pool-0.7.1.jar:na]
at net.dataforte.cassandra.pool.ConnectionPool.<init>(ConnectionPool.java:127) ~[cassandra-connection-pool-0.7.1.jar:na]
at com.impetus.client.cassandra.thrift.ThriftClientFactory.createPoolOrConnection(ThriftClientFactory.java:146) ~[kundera-cassandra-2.5.jar:na]
at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFactory.java:95) [kundera-core-2.5.jar:na]
at com.impetus.kundera.configure.ClientFactoryConfiguraton.configure(ClientFactoryConfiguraton.java:67) [kundera-core-2.5.jar:na]
Caused by: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at org.apache.thrift.transport.TFastFramedTransport.readFrame(TFastFramedTransport.java:144) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.transport.TFastFramedTransport.read(TFastFramedTransport.java:134) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297) ~[libthrift-0.7.0.jar:0.7.0]
[error] application -
! Internal server error, for (GET) [/] ->
java.lang.ExceptionInInitializerError: null
at models.process.EmployeeProcessImpl$.<init>(EmployeeProcess.scala:82) ~[myEntities.jar:na]
at models.process.EmployeeProcessImpl$.<clinit>(EmployeeProcess.scala) ~[myEntities.jar:na]
at controllers.Application$.<init>(Application.scala:168) ~[na:na]
at controllers.Application$.<clinit>(Application.scala) ~[na:na]
at Routes$$anonfun$routes$1$$anonfun$applyOrElse$1$$anonfun$apply$1.apply(routes_routing.scala:107) ~[na:na]
Caused by: com.impetus.kundera.loader.ClientLoaderException: org.apache.thrift.TException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at com.impetus.client.cassandra.thrift.ThriftClientFactory.createPoolOrConnection(ThriftClientFactory.java:151) ~[kundera-cassandra-2.5.jar:na]
at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFactory.java:95) ~[kundera-core-2.5.jar:na]
at com.impetus.kundera.configure.ClientFactoryConfiguraton.configure(ClientFactoryConfiguraton.java:67) ~[kundera-core-2.5.jar:na]
at com.impetus.kundera.configure.Configurator.configure(Configurator.java:65) ~[kundera-core-2.5.jar:na]
at com.impetus.kundera.KunderaPersistence.initializeKundera(KunderaPersistence.java:109) ~[kundera-core-2.5.jar:na]
Caused by: org.apache.thrift.TException: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at net.dataforte.cassandra.pool.ConnectionPool.init(ConnectionPool.java:345) ~[cassandra-connection-pool-0.7.1.jar:na]
at net.dataforte.cassandra.pool.ConnectionPool.<init>(ConnectionPool.java:127) ~[cassandra-connection-pool-0.7.1.jar:na]
at com.impetus.client.cassandra.thrift.ThriftClientFactory.createPoolOrConnection(ThriftClientFactory.java:146) ~[kundera-cassandra-2.5.jar:na]
at com.impetus.kundera.loader.GenericClientFactory.load(GenericClientFactory.java:95) ~[kundera-core-2.5.jar:na]
at com.impetus.kundera.configure.ClientFactoryConfiguraton.configure(ClientFactoryConfiguraton.java:67) ~[kundera-core-2.5.jar:na]
Caused by: org.apache.thrift.transport.TTransportException: Read a negative frame size (-2080374784)!
at org.apache.thrift.transport.TFastFramedTransport.readFrame(TFastFramedTransport.java:144) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.transport.TFastFramedTransport.read(TFastFramedTransport.java:134) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297) ~[libthrift-0.7.0.jar:0.7.0]
[error] application - Error while rendering default error page
scala.MatchError: java.lang.ExceptionInInitializerError (of class java.lang.ExceptionInInitializerError)
at play.api.GlobalSettings$class.onError(GlobalSettings.scala:148) ~[play_2.11-2.3.0.jar:2.3.0]
at play.api.DefaultGlobal$.onError(GlobalSettings.scala:206) [play_2.11-2.3.0.jar:2.3.0]
at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:76) [play_2.11-2.3.0.jar:2.3.0]
at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:86) [play_2.11-2.3.0.jar:2.3.0]
at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:84) [play_2.11-2.3.0.jar:2.3.0]
The example I am working with is taken from :
http://blog.knoldus.com/2014/06/22/playing-kundera-cassandra/
I am having Play! 2.4.6 framework with Cassandra 2.2. What could be wrong with the project which is not allowing to connect to the database ? Do I need to make some change regarding CQL or Kundera version so that my database can get connected ? My persistence.xml file is as under:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
https://raw.github.com/impetus-opensource/Kundera/Kundera-2.0.4/kundera-core/src/test/resources/META-INF/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="cassandra_employees">
<provider>com.impetus.kundera.KunderaPersistence</provider>
<class>models.domains.Employee</class>
<properties>
<property name="kundera.nodes" value="localhost" />
<property name="kundera.port" value="9042" />
<property name="kundera.keyspace" value="EmployeeExample" />
<property name="kundera.dialect" value="cassandra" />
<property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />
<property name="kundera.cache.provider.class" value="com.impetus.kundera.cache.ehcache.EhCacheProvider" />
<property name="kundera.cache.config.resource" value="/ehcache-test.xml" />
</properties>
</persistence-unit>
</persistence>
Please tell me if I have to make some version related change for Cassandra or CQL and that too in which file ?
used below config and it works fine on my system..
updated cassandra.yaml:
FROM:
start_rpc: false
TO:
start_rpc: true
Persistence.xml:
unit name mentioned below is random which will be used to access this particular persistence.
keyspace name is the name of the table created in cassandra.
<persistence-unit name="persistence">
<provider>com.impetus.kundera.KunderaPersistence</provider>
<properties>
<property name="kundera.nodes" value="localhost" />
<property name="kundera.port" value="9160" />
<property name="kundera.keyspace" value="trial1" />
<property name="kundera.dialect" value="cassandra" />
<property name="kundera.client.lookup.class" value="com.impetus.client.cassandra.thrift.ThriftClientFactory" />
<property name="kundera.pool.size.max.active" value="500" />
<property name="kundera.pool.size.max.total" value="500" />
</properties>
In my jpa/eclipselink application, running under Glassfish 4.1, I'm trying to debug the following exception, but without success:
Informações: [EL Finest]: jpa: 2015-04-30 15:36:29.386--ServerSession(148703580)--Thread(Thread[http-listener-1(2),5,main])--Begin deploying Persistence Unit syscond_PU; session file:/D:/Leo/Java/SysCondProj/Syscond/target/Syscond-1.0.2/WEB-INF/classes/_syscond_PU; state Predeployed; factoryCount 2
Grave: Error Rendering View[/financeiro/viewSaldo.xhtml]
javax.el.ELException: /financeiro/viewSaldo.xhtml #22,69 value="#{contabilMB.listaSaldo}": javax.persistence.PersistenceException: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [syscond_PU] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.IllegalStateException: This web container has not yet been started
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIData.getValue(UIData.java:732)
at org.primefaces.component.api.UIData.getDataModel(UIData.java:629)
at javax.faces.component.UIData.getRowCount(UIData.java:356)
at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:758)
at org.primefaces.component.datatable.DataTableRenderer.encodeTbody(DataTableRenderer.java:740)
at org.primefaces.component.datatable.DataTableRenderer.encodeRegularTable(DataTableRenderer.java:264)
at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:226)
at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:85)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.el.ELException: javax.persistence.PersistenceException: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [syscond_PU] failed. Close all factories for this PersistenceUnit.
Internal Exception: java.lang.IllegalStateException: This web container has not yet been started
I could see that's something related to the deployment of my persistence unit, as follows:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="syscond_PU" transaction-type="JTA">
<jta-data-source>jdbc/syscond</jta-data-source>
<class>br.com.syscond.core.jpa.model.GeneroLancamento</class>
<class>br.com.syscond.core.jpa.model.Apto</class>
<class>br.com.syscond.core.jpa.model.Lancamento</class>
<class>br.com.syscond.core.jpa.model.TaxaCondominio</class>
<class>br.com.syscond.core.jpa.model.Contabil</class>
<class>br.com.syscond.core.jpa.model.CategoriaFuncionario</class>
<class>br.com.syscond.core.jpa.model.Funcionario</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="TRUE"/>
</properties>
</persistence-unit>
</persistence>
Someone can help?
In fact, when revisiting my code, I found a "#Stateless" annotation alone, which was incrementing the "factoryCount" atribute, throwing that exception.
I would like to use mongodb component in my camelContext. I have already installed feature camel-mongodb in karaf and when I do bundle:list I get
156 | Active | 50 | 2.11.3.RELEASE | MongoDB Java Driver
To show Mongo Java Drivers are installed and running.Here's my camelContext
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<!-- <camelContext xmlns="http://camel.apache.org/schema/blueprint"> -->
<route>
<from uri="rabbitmq://localhost:5672/A?username=guest&password=guest&autoDelete=false&routingKey=source_q&queue=source_q&exchangeType=topic"/>
<bean ref="myTransform" method="transform"/>
<to uri="mongodb:mongo?database=mongo_poc&collection=camel&operation=save"/>
</route>
</camelContext>
<!-- Mongo DB -->
<bean id="mongo" class="com.mongodb.Mongo">
<constructor-arg index="0" value="localhost" />
</bean>
</beans>
When I deploy this exception, I get following exception
karaf#root()> Exception in thread "SpringOsgiExtenderThread-8" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'camel-3': Invocation of init method failed; ne
sted exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.mongodb.Mongo] for bean with name 'mongo' defined in URL [bundle://149.23:0/META-INF/spring/
camelContext.xml]; nested exception is java.lang.ClassNotFoundException: com.mongodb.Mongo not found from bundle [demo.camel-bundle]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.mongodb.Mongo] for bean with name 'mongo' defined in URL [bundle://149.23:0/META-INF/spring/camelCo
ntext.xml]; nested exception is java.lang.ClassNotFoundException: com.mongodb.Mongo not found from bundle [demo.camel-bundle]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1275)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1344)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:355)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:334)
at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1178)
at org.apache.camel.spring.CamelContextFactoryBean.getBeanForType(CamelContextFactoryBean.java:188)
at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:145)
at org.apache.camel.osgi.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:64)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 14 more
Caused by: java.lang.ClassNotFoundException: com.mongodb.Mongo not found from bundle [demo.camel-bundle]
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)
at org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:260)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:416)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1296)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1267)
... 24 more
Caused by: java.lang.ClassNotFoundException: com.mongodb.Mongo not found by demo.camel-bundle [149]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
at org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)
... 30 more
I have also included
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>2.11.3</version>
</dependency>
in the pom.xml of my camel-bundle project
Please help me. I am not sure what is missing here.
I fixed this by adding the required package in the pom.xml of by camel bundle project under the <Import-Package> tag
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>1.4.3</version>
<!--
| the following instructions build a simple set of public/private classes into an OSGi bundle
-->
<configuration>
<instructions>
<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
<Bundle-Version>${pom.version}</Bundle-Version>
<Import-Package>com.mongodb, demo.service;version="${pom.version}"
^^^^^^^^^^^ </Import-Package>
<Include-Resource>src/main/resources</Include-Resource>
</instructions>
</configuration>
</plugin>
I keep getting this error when trying to deploy a web application in Eclipse Juno. I am very new to Spring MVC. I am just following a tutorial on this site - ViralPatel Spring MVC-Hibernate
HTTP Status 500 - Servlet.init() for servlet spring threw exception
--------------------------------------------------------------------------------
type Exception report
message Servlet.init() for servlet spring threw exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet spring threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
root cause
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.config.internalAutoProxyCreator': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata: method <init>()V not found
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:734)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:457)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
root cause
java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata: method <init>()V not found
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:342)
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessAfterInstantiation(PersistenceAnnotationBeanPostProcessor.java:296)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1068)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:734)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:457)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
javax.servlet.GenericServlet.init(GenericServlet.java:160)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:722)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<context:annotation-config />
<context:component-scan base-package="nigeria.devex.found.controller" />
<bean id="jspViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.databaseurl}" p:username="${jdbc.username}"
p:password="${jdbc.password}" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<tx:annotation-driven />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
</beans>![This is my screenshot of jars][1]
I have the same problem when spring-beans and spring-orm have deffirent versions(even minor version number).
To keep String packages always use the same compatable version, do as follows in your maven's pom.xml:
<properties>
.....
<spring.version>3.1.2.RELEASE</spring.version>
.....
</properties>
......
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
Using commands: mvn dependency:tree
Find conflicting classes by dependency.
Do as follows in your maven's pom.xml(for instance):
<exclusion>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
Here you need to change it to an unneeded class that you conflict with.
I have upgraded my Eclipse IDE to Juno from Helios. I have updated my projects to use the latest version of EclipseLink that came with Juno which is 2.4 Nightly (as displayed in the Persistance properties). I have one project that is itself a JPA project (ProjectA) that has a dependancy on another JPA project (ProjectB). So in effect, I have a project that is talking to 2 seperate databases. When I try to start ProjectA running under Tomcat I get the exception listed below. The entities referred to in the exception are all located in the dependant project - ProjectB. I've rebuilt both projects and re-deployed.
I'm wondering if 2.4 is not a straight upgrade from 2.1.3 and I've missed some upgrade documentation somewhere detailing changes I need to make to the config of my JPA projects.
Reverting both ProjectA and ProjectB back to EclipseLink 2.1.3, everything works correctly
I've listed part of the exception for only one of the entities to save space, but it repeats for every entity defined in Project B.
Local Exception Stack:
Exception [EclipseLink-60] (Eclipse Persistence Services - 2.4.0.v20110816-r9894): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_set_platform_vh] or [_persistence_get_platform_vh] is not defined in the object [com.blackbox.entities.db.PEcuAcronym].
Internal Exception: java.lang.NoSuchMethodException: com.blackbox.entities.db.PEcuAcronym._persistence_get_platform_vh()
Mapping: org.eclipse.persistence.mappings.ManyToOneMapping[platform]
Descriptor: RelationalDescriptor(com.blackbox.entities.db.PEcuAcronym --> [DatabaseTable(pecuacronym)])
at org.eclipse.persistence.exceptions.DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(DescriptorException.java:1170)
at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:200)
at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:181)
at org.eclipse.persistence.mappings.DatabaseMapping.preInitialize(DatabaseMapping.java:1276)
at org.eclipse.persistence.mappings.ForeignReferenceMapping.preInitialize(ForeignReferenceMapping.java:1127)
at org.eclipse.persistence.mappings.ObjectReferenceMapping.preInitialize(ObjectReferenceMapping.java:1054)
at org.eclipse.persistence.descriptors.ClassDescriptor.preInitialize(ClassDescriptor.java:3571)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:493)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:476)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:435)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:673)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:618)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:474)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:188)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:277)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:290)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:268)
at com.blackbox.dao.JpaBaseDao.findAll(JpaBaseDao.java:50)
at com.blackbox.services.Services.listAllPlatforms(Services.java:70)
at com.blackbox.services.Services.listAllPublishedPlatforms(Services.java:355)
at com.blackbox.x.actions.diagnostics.IdentifyVehicle.prepare(IdentifyVehicle.java:42)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:162)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.blackbox.x.interceptors.Log4jMDCInterceptor.intercept(Log4jMDCInterceptor.java:51)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at com.blackbox.x.interceptors.RedirectMessageInterceptor.doIntercept(RedirectMessageInterceptor.java:78)
at com.blackbox.x.interceptors.RedirectMessageInterceptor.intercept(RedirectMessageInterceptor.java:63)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:82)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:323)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1719)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodException: com.blackbox.entities.db.PEcuAcronym._persistence_get_platform_vh()
at java.lang.Class.getDeclaredMethod(Unknown Source)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.findMethod(PrivilegedAccessHelper.java:82)
at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getMethod(PrivilegedAccessHelper.java:283)
at org.eclipse.persistence.internal.helper.Helper.getDeclaredMethod(Helper.java:974)
at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:193)
... 94 more
To be clear - if I deploy ProjectB on it's own then it works as expected. The problem only happens when I deploy JPA Project A which has a dependancy on ProjectB that the problem occurs. ProjectA opens it's own persistance context correctly, but not ProjectB's.
I have attached the persistance.xml as requested.
ProjectA;
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="Genesis" transaction-type="RESOURCE_LOCAL">
<class>com.blackbox.x.entities.SecurityKey</class>
<class>com.blackbox.x.entities.QualifiedSecurityKey</class>
<class>com.blackbox.x.entities.User</class>
<class>com.blackbox.x.entities.Password</class>
<class>com.blackbox.x.entities.ServiceDefinition</class>
<class>com.blackbox.x.entities.IdsFunction</class>
<class>com.blackbox.x.entities.FaultCodeType</class>
<class>com.blackbox.x.entities.FaultCodeDescription</class>
<class>com.blackbox.x.entities.VehicleActivityLogEntry</class>
<class>com.blackbox.x.entities.Recovery</class>
<class>com.blackbox.x.entities.SingleVehicleLicense</class>
<class>com.blackbox.x.entities.MultiVehicleLicense</class>
<class>com.blackbox.x.entities.License</class>
<class>com.blackbox.x.entities.LicenseGroupMaster</class>
<class>com.blackbox.x.entities.LicenseGroup</class>
<class>com.blackbox.x.entities.FunctionGroup</class>
<class>com.blackbox.x.entities.McodeText</class>
<class>com.blackbox.x.entities.CCFParameterMaster</class>
<class>com.blackbox.x.entities.CCFFunctionGroup</class>
<class>com.blackbox.x.entities.CCFParameterOptionUsage</class>
<class>com.blackbox.x.entities.CCFAsBuiltIndex</class>
<class>com.blackbox.x.entities.CCFEditLog</class>
<class>com.blackbox.x.entities.AsBuiltAnalyzerFileTracker</class>
<class>com.blackbox.x.entities.CCFParameterOption</class>
<class>com.blackbox.x.entities.JlrVersionControl</class>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="eclipselink.jdbc.batch-writing" value="JDBC"/>
<property name="eclipselink.jdbc.user" value="userId"/>
<property name="eclipselink.jdbc.password" value="<elided>"/>
<property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/> -->
</properties>
</persistence-unit>
and ProjectB;
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="ids2_develop" transaction-type="RESOURCE_LOCAL">
<description>Eclipse</description>
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.blackbox.entities.db.Vw_Ecu</class>
<class>com.blackbox.entities.db.SwimPart</class>
<class>com.blackbox.entities.db.SoftwarePK</class>
<class>com.blackbox.entities.db.Software</class>
<class>com.blackbox.entities.db.ServiceData</class>
<class>com.blackbox.entities.db.PlatformData</class>
<class>com.blackbox.entities.db.Platform</class>
<class>com.blackbox.entities.db.PEcuTextPK</class>
<class>com.blackbox.entities.db.PEcuText</class>
<class>com.blackbox.entities.db.PEcuAcronymPK</class>
<class>com.blackbox.entities.db.PEcuAcronym</class>
<class>com.blackbox.entities.db.PEcu</class>
<class>com.blackbox.entities.db.PBusPK</class>
<class>com.blackbox.entities.db.PBus</class>
<class>com.blackbox.entities.db.Manufacturer</class>
<class>com.blackbox.entities.db.HardwarePK</class>
<class>com.blackbox.entities.db.Hardware</class>
<class>com.blackbox.entities.db.CusCom</class>
<class>com.blackbox.entities.db.CCFParameter</class>
<class>com.blackbox.entities.db.CCFGroup</class>
<class>com.blackbox.entities.db.Bus</class>
<class>com.blackbox.entities.db.BBoxCom</class>
<class>com.blackbox.entities.db.AssemblyPK</class>
<class>com.blackbox.entities.db.Assembly</class>
<class>com.blackbox.entities.db.McodeLookupKey</class>
<properties>
<property name="eclipselink.jdbc.password" value="<elided>"/>
<property name="eclipselink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="eclipselink.jdbc.user" value="ids2dbuser"/>
<property name="eclipselink.jdbc.url" value="jdbc:mysql://localhost:3306/ids2"/>
<property name="eclipselink.logging.level" value="WARNING"/>
<property name="eclipselink.jdbc.cache-statements" value="true"/>
<property name="eclipselink.jdbc.native-sql" value="false"/>
<property name="eclipselink.cache.type.Vw_Ecu" value="NONE"/>
</properties>
</persistence-unit>
Seems to be a weaving issue. It looks like weaving did not occur for the object. Ensure you have weaving enabled correctly. If you are using static weaving, make sure you use 2.4 the statically weave your classes.
Try disabling weaving to confirm the issue. Also include your persistence.xml.