[EJB 3.0] New message: "Re: Persistence unit issues when migrating to JBOSS 5.1.0"
by jaikiran pai
User development,
A new message was posted in the thread "Persistence unit issues when migrating to JBOSS 5.1.0":
http://community.jboss.org/message/520280#520280
Author : jaikiran pai
Profile : http://community.jboss.org/people/jaikiran
Message:
--------------------------------------------------------------
> jaikiran wrote:
>
> Place the persistence.xml in the META-INF of the .ear.
>
> So:
>
> myapp.ear
> |
> |--- META-INF
> | |
> | |--- persistence.xml
>
>
>
>
>
>
> And let the persistence.xml use the "jar-file" element to point to the jars containing the entities. This is how the EJB3 persistence spec lets EAR level persistence.xml to be deployed. For more details, see section 6.2 of EJB3 Persistence spec.
For the record - my statement is incorrect. The EJB3 spec doesn't _not_ specify that the persistence.xml can be placed in the META-INF of the .ear. According to the spec, for scoping a persistence unit at ear level, the persistence.xml should be packaged in:
* META-INF of a jar file in the root of the EAR
or* META-INF of a jar file in the EAR library directory
Note that although JBoss scans the .ear/META-INF/persistence.xml file, it's _not_ recommend that applications package their persistence.xml in this manner, since it can lead to issues like the one being discussed here http://community.jboss.org/message/520279
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520280#520280
16 years, 3 months
[EJB 3.0] New message: "Re: Issue specifying the <jar-file> in persistence.xml in JBOSS 5 on linux system"
by jaikiran pai
User development,
A new message was posted in the thread "Issue specifying the <jar-file> in persistence.xml in JBOSS 5 on linux system":
http://community.jboss.org/message/520279#520279
Author : jaikiran pai
Profile : http://community.jboss.org/people/jaikiran
Message:
--------------------------------------------------------------
> jaikiran wrote:
>
> I'll look into this to see what is causing the problem.
Well, the spec does not allow the persistence.xml to be in the .ear/META-INF although the JBoss implementation does pickup that file from this location. Allowing the persistence.xml to reside in the META-INF of the .ear, causes the jar-file resolution issue that you are running into.
According to the spec, to scope the persistence unit to all components in the .ear, you will have to package the persistence.xml in:
* META-INF of a jar file in the root of the EAR
or* META-INF of a jar file in the EAR library directory
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520279#520279
16 years, 3 months
[Beginner's Corner] New message: "Re: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence"
by a a
User development,
A new message was posted in the thread "java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence":
http://community.jboss.org/message/520274#520274
Author : a a
Profile : http://community.jboss.org/people/Guestuser31
Message:
--------------------------------------------------------------
2010-01-15 10:40:15,898 ERROR [javax.enterprise.resource.webcontainer.jsf.application] (http-127.0.0.1-8080-1) /login.xhtml @70,88 action
="#{loginBean.login}": java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
javax.faces.el.EvaluationException: /login.xhtml @70,88 action="#{loginBean.login}": java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at com.icesoft.faces.component.ext.HtmlInputText.broadcast(HtmlInputText.java:713)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:184)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:162)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:350)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:94)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:54)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:26)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:38)
at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:19)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence
at javax.persistence.Persistence.findAllProviders(Persistence.java:186)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:103)
at com.talgentra.tallyman.admin.util.EntityManagerFactoryAccessor.<init>(EntityManagerFactoryAccessor.java:33)
at com.talgentra.tallyman.admin.util.EntityManagerFactoryAccessor.getInstance(EntityManagerFactoryAccessor.java:52)
at com.talgentra.tallyman.admin.util.EntityManagerFactoryAccessor.getEntityManagerFactory(EntityManagerFactoryAccessor.java:45)
at com.talgentra.tallyman.domain.dao.implementation.BaseJpaImpl.getEntityManagerFactory(BaseJpaImpl.java:19)
at com.talgentra.tallyman.domain.dao.implementation.ServerConfigJpaImpl.findAll(ServerConfigJpaImpl.java:78)
at com.talgentra.tallyman.domain.dao.implementation.ServerConfigJpaImpl.findAll(ServerConfigJpaImpl.java:27)
at com.talgentra.tallyman.domain.facade.DefaultServerConfigFacade.getAll(DefaultServerConfigFacade.java:78)
at com.talgentra.tallyman.admin.delegates.DefaultServerConfigBD.refresh(DefaultServerConfigBD.java:92)
at com.talgentra.tallyman.admin.delegates.DefaultServerConfigBD.getAll(DefaultServerConfigBD.java:59)
at com.talgentra.tallyman.admin.delegates.DefaultOperationConfigBD.refreshServerOperationVOList(DefaultOperationConfigBD.java:155)
at com.talgentra.tallyman.admin.beans.security.LoginBean.login(LoginBean.java:44)
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:585)
at org.apache.el.parser.AstValue.invoke(AstValue.java:170)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
... 43 more
This is the error stack that I get. I am logging into an application which I deployed from a war file. When I run the application I can see the login page but when I log in it shows the error message above. Running on a seperate tomcat I can log into the app so I know it works fine.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520274#520274
16 years, 3 months
[jBPM] New message: "Re: TaskService issue"
by Santanu Saraswati
User development,
A new message was posted in the thread "TaskService issue":
http://community.jboss.org/message/520272#520272
Author : Santanu Saraswati
Profile : http://community.jboss.org/people/saraswati.santanu
Message:
--------------------------------------------------------------
I believe, if you need to use jta transaction manager and data source in a server managed environment then this configuration is not good. You should not give db driver, db url etc to hibernate. They should be configured in the server. And the data source and tx manager configured in server should be provided to hibernate.
So instead of the following:
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/mydb</property>
<property name="hibernate.connection.username">username</property>
<property name="hibernate.connection.password">password</property>
you should be using something like:
*+<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>+*
*+<!--Provide the actual data source name you have configured here-->
+*
*+<property name="connection.datasource">java:comp/jdbc/MySQLDataSource</property>+*
*+<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>+*
*+<!--Provide the actual tx manager name you have configured here-->
<property name="jta.UserTransaction">java:comp/UserTransaction</property>+*
Give the actual datasource and tx manager JNDI name that you configured.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520272#520272
16 years, 3 months