Tomee - Hibernate Invalid and non-convertable constructor parameter - java

im trying to deploy my application in TOMEE with Hibernate 4, I already copz all the hibernate libraries in /lib but im getting the next error.
Is there any special configuration to make hibernate work with TomEEE?,
Thanks in advance
Caused by: java.lang.ClassCastException: org.apache.openejb.hibernate.OpenEJBJtaPlatform cannot be cast to org.hibernate.service.jta.platform.spi.JtaPlatform

Related

Migration from WebSphere to WebLogic

I have an webapplication running on WebSphere using JDK 1.6, Spring 2.5.6 and iceFaces 1.8.2. I need to migrate that webapp to WebLogic. So I updated JDK to 1.8 and Spring to 4.2. The iceFaces framework I dont change because of the number of change on my source code.
When I deploy the application I got the following:
com.sun.faces.config.ConfigurationException: Factory 'javax.faces.lifecycle.ClientWindowFactory' was not configured properly.
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:330)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:236)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:705)
Truncated. see log file for complete stacktrace
Caused By: javax.faces.FacesException: com.sun.faces.lifecycle.ClientWindowFactoryImpl
at javax.faces.FactoryFinderInstance.getImplGivenPreviousImpl(FactoryFinderInstance.java:409)
at javax.faces.FactoryFinderInstance.getImplementationInstance(FactoryFinderInstance.java:253)
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:549)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:328)
Truncated. see log file for complete stacktrace
Caused By: java.lang.UnsupportedOperationException
at javax.faces.application.Application.subscribeToEvent(Application.java:1797)
at com.sun.faces.lifecycle.ClientWindowFactoryImpl.<init>(ClientWindowFactoryImpl.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
Truncated. see log file for complete stacktrace
Are there some way to resolve that or I need to change my iceFaces version?
I think i resolved that including jsf 1.2 libs on my war file.
Still getting another errors, soon I update the answer if it worked or not.
UPDATE:
Yes, this solved my problem... Now webapplication is deployed sucessful. (Still getting httpError 500 when open my login page...)

ConnectorRuntimeException: Invalid resource

I am creating an enterprise java application using netbeans 8.0.1 java EE6 and glassfish server 4.1.1 attached with netbeans.
When I have created the db in mysql and connected successfully and created entity class from database and session bean for that entity class and I am going to deploy the application it gives this error:
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : java:module/custordermgt__pm
at org.glassfish.jdbcruntime.service.JdbcDataSource.validateResource(JdbcDataSource.java:81)
at org.glassfish.jdbcruntime.service.JdbcDataSource.setResourceInfo(JdbcDataSource.java:62)
at org.glassfish.jdbcruntime.JdbcRuntimeExtension.lookupDataSourceInDAS(JdbcRuntimeExtension.java:136)
at com.sun.enterprise.connectors.ConnectorRuntime.lookupDataSourceInDAS(ConnectorRuntime.java:589)
What caused this exception?
This is probably due to a NetBeans bug. Take a look at the solution here: https://stackoverflow.com/a/56921913/1429984

Eclipse doesn't initialize JPA persistence

when I try to run a JPA project, I get the following error message :
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.<clinit>(EntityManagerFactoryProvider.java:55)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:92)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:188)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at dao.LayerDAO.<init>(LayerDAO.java:10)
at exec.Run.main(Run.java:9)
Caused by: java.lang.NullPointerException
at org.eclipse.persistence.platform.server.NoServerPlatformDetector.checkPlatform(NoServerPlatformDetector.java:28)
at org.eclipse.persistence.platform.server.ServerPlatformUtils.detectServerPlatform(ServerPlatformUtils.java:58)
at org.eclipse.persistence.internal.jpa.IsolatedHashMap.<clinit>(IsolatedHashMap.java:48)
... 7 more
This project was running before, but I needed to reinstall Glassfish because of problems and now it's broken.
I tried to create a new project but I got the same error messages.
Do you have an idea of what could explain such a behavior ?
Thanx
Thanx to #Gimby who made me verified my EclipseLink version, I had to go into the project properties.
After a look in the BuildPath parameters, I tried to look at the "targeted runtime" I've chosen and found that none was selected.
Since I've checked it, everything goes better.
++

ClasscastException on update application

I have an openjpa application running in a weblogic 12.1.2 container.
When i first install the application everything works fine. If i update the ear file (or redeploy) i get the following error:
- Could not log the error: EJB Exception: found this error: EJB Exception: : <openjpa-1.1.1-SNAPSHOT-r422266:1445923 nonfatal general error> org.apache.openj
pa.persistence.PersistenceException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:196)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:199)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:152)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at weblogic.persistence.TransactionalEntityManagerProxyImpl.newPersistenceContext(TransactionalEntityManagerProxyImpl.java:71)
at weblogic.persistence.BasePersistenceContextProxyImpl.getPersistenceContext(BasePersistenceContextProxyImpl.java:175)
at weblogic.persistence.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:106)
at weblogic.persistence.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:82)
at weblogic.persistence.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:92)
at com.sun.proxy.$Proxy235.createNativeQuery(Unknown Source)
(...)
Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.apache.openjpa.lib.xml.XMLFactory.getDOMParser(XMLFactory.java:107)
at org.apache.openjpa.jdbc.sql.SQLErrorCodeReader.parse(SQLErrorCodeReader.java:108)
at org.apache.openjpa.jdbc.sql.DBDictionary.endConfiguration(DBDictionary.java:4096)
at org.apache.openjpa.jdbc.sql.OracleDictionary.endConfiguration(OracleDictionary.java:170)
at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:505)
This is only fixed by restarting the cluster nodes. This doesn't happen in Weblogic 10.3.
I've been looking around and i stumbled across several possible solutions to no avail. One of the possible issues can be seen here: Stackoverflow Question
From here I started fiddling with the ear and i now have the xercesImpl lib ( the same that exists on the server) inside my APP-INF/lib this. Without this the application won't even install.
I've tried adding the following line to my weblogic-application.xml:
<wls:package-name>org.apache.xerces.*</wls:package-name>
And this had no effect.
Also looked into the possibility that my EntityManager was being left open upon undeploy, but i have no reason to believe this is the case. All my EntityManager are container managed and injected using the #EJB annotation.
Anyone have any ideas on this?

Using EJB3 And Struts 2 Together

As I know, we can use ejb3 and struts 1 in Netbeans under JBoss.
But when i use ejb3 and struts 2, they got error when i deploy in JBoss 6.1.0.
I'm using Netbeans 7.2.1
I try to deploy separate components and they OK, no error.
But if I add module ejb and war to, they have problems.
Error:
15:48:38,023 ERROR [org.apache.struts2.dispatcher.Dispatcher] Dispatcher initialization failed: Unable to load configuration. - bean - vfs:/D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/deploy/EJB3EntityStruts2Combine.ear/lib/struts2-convention-plugin-2.3.15.3.jar/struts-plugin.xml:32:155
Caused by: Unable to load bean: type:org.apache.struts2.convention.ActionConfigBuilder class:org.apache.struts2.convention.PackageBasedActionConfigBuilder - bean - vfs:/D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/deploy/EJB3EntityStruts2Combine.ear/lib/struts2-convention-plugin-2.3.15.3.jar/struts-plugin.xml:32:155
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.StrutsException from BaseClassLoader#162f61f{vfs:///D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/deploy/EJB3EntityStruts2Combine.ear}
Caused by: java.lang.NoClassDefFoundError: org/apache/struts2/StrutsException
at java.lang.Class.getDeclaredConstructors0(Native Method) [:1.7.0_25]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483) [:1.7.0_25]
at java.lang.Class.getDeclaredConstructors(Class.java:1891) [:1.7.0_25]
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:235) [:2.3.15.3]
15:48:38,115 ERROR [org.apache.catalina.core.StandardContext] Error filterStart
15:48:38,116 ERROR [org.apache.catalina.core.StandardContext] Context [/Struts2War] startup failed due to previous errors
15:48:38,122 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=jboss.web.deployment:war=/Struts2War state=Create mode=Manual requiredState=Installed: org.jboss.deployers.spi.DeploymentException: URL file:/D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/tmp/vfs/automount3affa1740d934a8/Struts2War.war-667258e36d105fd7/ deployment failed
DEPLOYMENTS IN ERROR: Name -> Error
vfs:///D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/deploy/EJB3EntityStruts2Combine.ear -> org.jboss.deployers.spi.DeploymentException: URL file:/D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/tmp/vfs/automount3affa1740d934a8/Struts2War.war-667258e36d105fd7/ deployment failed
DEPLOYMENTS IN ERROR:
Deployment "vfs:///D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/deploy/EJB3EntityStruts2Combine.ear" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/D:/javaKHANH/JavaKit_t.Khanh/jboss-6.1.0.Final/server/default/tmp/vfs/automount3affa1740d934a8/Struts2War.war-667258e36d105fd7/ deployment failed
I'm currently using EJB 3.1 in an EAR with multiple Struts2 WARs deployed on JBoss EAP 6 (JBss AS 7). They works great.
If you are using Maven (if you are not, I suggest you to give it a try, instead of building complex ANT scripts that you will need to rewrite for your next project), be sure to create and deploy the project in the right way. If you are starting it now, use an archetype.
Since you are using Java EE and JBoss, I suggest the jboss-javaee6-webapp Maven Archetype.
I've used it too. Then use an Struts Archetype for the war, and substitute it to the one generated by the JBoss archetype, or modify it manually.

Categories