[jboss-user] [EJB 3.0] - Re: Could not deploy EJB3.0 entities
saasira
do-not-reply at jboss.com
Sun Nov 11 03:57:59 EST 2007
Hi!
I'm able clear this hurdle, in sense that I am able to assign the JBosstransactionManager to the toplink TransactionController by specifying a Session Customizer class in the persistence.xml , and then in the customize method the the SessionCustomizer Class I added a listener class in which prelogin method I 've forced toplink to use ExternaltransactionController...
All this below:
|
| <property name="toplink.session.customizer" value="com.prapansol.demos.service.JBossTransactionConfigurator"/>
|
| And In the "customize" method of that class I added a SessionEventListener as below :
|
| public class JBossTransactionConfigurator implements SessionCustomizer{
| public void customize(Session session) {
|
|
| session.getActiveSession().getEventManager().addListener(new
| JBossSessionPreLoginListener());
|
| }
| }
|
|
|
And in the "prelogin" method of My SessionEvent Listener class , I added the Server platform, and JTATransactionController as shown below:
| public class JBossSessionPreLoginListener extends SessionEventAdapter{
| public void preLogin(SessionEvent event) {
|
| Session session = event.getSession();
| session.logMessage("Initializing JBossPlatform ......");
| session.getLogin().setPlatformClassName("oracle.toplink.essentials.platform.server.jboss.JBossPlatform");
| //session.getLogin().setUsesExternalTransactionController(true);
| session.getLogin().useExternalTransactionController();
| session.getActiveSession().logMessage("Initializing JBossTransaction Controller ......");
| session.setExternalTransactionController(new JBossTransactionController());
| session.getActiveSession().logMessage("Successfully Configured JBossTransactionController ....");
|
| }
| }
|
|
But , I'm getting the error when the bean is requested from a JSP or a backing bean of JSF page:
| UnitOfWork(8650745)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX binding to tx mgr, status=STATUS_ACTIVE
| 11:23:14,923 ERROR [STDERR] java.lang.IllegalArgumentException: Object: com.prapansol.demos.model.Emp at a3aaf5 is not a known entity type.
| 11:23:14,924 ERROR [STDERR] at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:3198)
| 11:23:14,924 ERROR [STDERR] at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.persist(EntityManagerImpl.java:190)
| 11:23:14,924 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:182)
| 11:23:14,924 ERROR [STDERR] at com.prapansol.demos.service.SRServiceBean.persistEntity(SRServiceBean.java:76)
| 11:23:14,924 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 11:23:14,924 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 11:23:14,924 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 11:23:14,924 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 11:23:14,924 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| 11:23:14,924 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| 11:23:14,924 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| 11:23:14,924 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,924 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| 11:23:14,925 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,925 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 11:23:14,925 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 11:23:14,926 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
| 11:23:14,926 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
| 11:23:14,926 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
| 11:23:14,926 ERROR [STDERR] at $Proxy96.persistEntity(Unknown Source)
| 11:23:14,926 ERROR [STDERR] at org.apache.jsp.oracleTest_jsp._jspService(oracleTest_jsp.java:142)
| 11:23:14,926 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
| 11:23:14,926 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| 11:23:14,926 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
| 11:23:14,926 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
| 11:23:14,926 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
| 11:23:14,926 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 11:23:14,927 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| 11:23:14,927 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| 11:23:14,927 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| 11:23:14,927 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| 11:23:14,927 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| 11:23:14,927 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| 11:23:14,927 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| 11:23:14,928 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| 11:23:14,928 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 11:23:14,930 INFO [STDOUT] [TopLink Finer]: 2007.11.11 11:23:14.929--UnitOfWork(8650745)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX afterCompletion callback, status=ROLLEDBACK
| 11:23:14,930 INFO [STDOUT] [TopLink Finer]: 2007.11.11 11:23:14.930--UnitOfWork(8650745)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--release unit of work
| 11:23:14,930 INFO [STDOUT] [TopLink Finer]: 2007.11.11 11:23:14.930--UnitOfWork(8650745)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--initialize identitymaps
| 11:23:14,931 INFO [STDOUT] [TopLink Finer]: 2007.11.11 11:23:14.931--ClientSession(21410136)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--client released
|
|
It seems the toplink entitiyManager is still not recognizing the entities created ... or may be they were not created as the Warning Messages displayed at the deployment time indicate :
| ServerSession(26489568)--Thread(Thread[main,5,jboss])--property=toplink.orm.throw.exceptions; default value=true
| 11:22:56,899 INFO [STDOUT] [TopLink Finer]: 2007.11.11 11:22:56.899--ServerSession(26489568)--Thread(Thread[main,5,jboss])--Searching for default mapping file in file:/u01/home/developer/jboss-4.2.1.GA/server/default/tmp/deploy/tmp51731TestModel.ear-contents/TestModel.jar
| 11:22:56,909 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.909--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.model.Emp. The class is ignored.
| 11:22:56,911 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.910--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.model.Dept. The class is ignored.
| 11:22:56,913 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.912--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.model.Dept. The class is ignored.
| 11:22:56,914 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.913--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.model.Emp. The class is ignored.
| 11:22:56,915 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.914--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.service.SRServiceBean. The class is ignored.
| 11:22:56,916 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.915--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.service.JBossTransactionConfigurator. The class is ignored.
| 11:22:56,917 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.916--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.service.SRService. The class is ignored.
| 11:22:56,918 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.918--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.service.SRServiceLocal. The class is ignored.
| 11:22:56,919 INFO [STDOUT] [TopLink Warning]: 2007.11.11 11:22:56.919--Thread(Thread[main,5,jboss])--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class com.prapansol.demos.service.JBossSessionPreLoginListener. The class is ignored.
| 11:22:56,925 INFO [STDOUT] [TopLink Finest]: 2007.11.11 11:22:56.925--ServerSession(26489568)--Thread(Thread[main,5,jboss])--end predeploying Persistence Unit Model; state Predeployed; factoryCount 1
| creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
| 11:22:56,950 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=TestModel.ear,jar=TestModel.jar,name=SRService,service=EJB3 with dependencies:
| 11:22:56,950 INFO [JmxKernelAbstraction] persistence.units:ear=TestModel.ear,jar=TestModel.jar,unitName=Model
| 11:22:56,984 INFO [EJBContainer] STARTED EJB: com.prapansol.demos.service.SRServiceBean ejbName: SRService
| 11:22:57,005 INFO [EJB3Deployer] Deployed: file:/u01/home/developer/jboss-4.2.1.GA/server/default/tmp/deploy/tmp51731TestModel.ear-contents/TestModel.jar
| 11:22:57,010 INFO [EARDeployer] Started J2EE application: file:/u01/home/developer/jboss-4.2.1.GA/server/default/deploy/TestModel.ear
| 11:22:58,179 INFO [EARDeployer] Init J2EE application: file:/u01/home/developer/jboss-4.2.1.GA/server/default/deploy/UserInterface.ear
| 11:22:59,054 INFO [TomcatDeployer] deploy, ctxPath=/UI, warUrl=.../tmp/deploy/tmp51732UserInterface.ear-contents/UserInterface-exp.war/
| 11:23:03,302 INFO [EARDeployer] Started J2EE application: file:/u01/home/developer/jboss-4.2.1.GA/server/default/deploy/UserInterface.ear
| 11:23:03,509 INFO [EARDeployer] Init J2EE application: file:/u01/home/developer/jboss-4.2.1.GA/server/default/deploy/bc4j.ear
| 11:23:04,266 WARN [DeployerInterceptorJSE] Cannot load servlet class: oracle.jbo.server.emd.EMDServlet
| deploy, ctxPath=/webapp, warUrl=.../tmp/deploy/tmp51733bc4j.ear-contents/webapp-exp.war/
| 11:23:04,459 WARN [TomcatDeployer] Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jgroups/blocks/MethodCall
| 11:23:04,478 INFO [EARDeployer] Started J2EE application: file:/u01/home/developer/jboss-4.2.1.GA/server/default/deploy/bc4j.ear
| 11:23:04,635 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 11:23:04,795 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
|
|
Why does the entitymanager not create the entities?
Any hint as to what is causing this, or How to proceed further?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103456#4103456
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103456
More information about the jboss-user
mailing list