Easybeans GWT persistence

View: New views
9 Messages — Rating Filter:   Alert me  

Easybeans GWT persistence

by jbevan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The sudoku example contains no persistence.

When the example is adapted and persistence added the persistence does not seem
to work on Tomcat when GWT is used.

Can anyone give help on this difficulty?

John Bevan

Re: Easybeans GWT persistence

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hi John,

Could you give some errors or stack trace when it doesn't work.

Regards,

Florent

jbevan@... wrote:

> The sudoku example contains no persistence.
>
> When the example is adapted and persistence added the persistence does not seem
> to work on Tomcat when GWT is used.
>
> Can anyone give help on this difficulty?
>
> John Bevan
>
>
>  


Re: Easybeans GWT persistence

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hi John,

With the stack trace thay you've provided, it means that there is NPE
exception in your HIFacadeBean.java class at the line "23"

Could you check what is done at this line ?

uk.co.rjbevan.facade.HIFacadeBean.original$EasyBeans$listOfSchedules(HIFacadeBean.java:23)

The method name is original$EasyBeans$listOfSchedules but this
correspond to the line of your method listOfSchedules

Regards,

Florent


jbevan@... wrote:

> The sudoku example contains no persistence.
> Thank you for your reply.
>
> The following is the error from the Server log:
>
> "30-Aug-2008 16:18:06
>
> org.ow2.easybeans.transaction.interceptors.AbsTransactionInterceptor
>
> handleContextContainerTransaction
>
> SEVERE: Exception (not application exception) in business method
>
> java.lang.NullPointerException
>
>         at
>
>
> uk.co.rjbevan.facade.HIFacadeBean.original$EasyBeans$listOfSchedules(HIFacadeBean.java:23)
>
>
>         at
>
> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
>
>
> Source)
>
>
>         at
>
> org.ow2.easybeans.transaction.interceptors.CMTRequiredTransactionInterceptor.intercept(CMTRequiredTransactionInterceptor.java:110)
>
>
>         at
>
> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
>
>
> Source)
>
>
>         at
>
>
> org.ow2.easybeans.naming.interceptors.TomcatENCInterceptor.intercept(TomcatENCInterceptor.java:174)
>
>
>         at
>
> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
>
>
> Source)
>
>
>         at uk.co.rjbevan.facade.HIFacadeBean.listOfSchedules(HIFacadeBean.java)
>
>
>         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.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(StatelessSessionFactory.java:151)
>
>
>         at
>
>
> org.ow2.easybeans.container.session.SessionFactory.rpcInvoke(SessionFactory.java:181)
>
>
>         at
>
>
> org.ow2.easybeans.rpc.rmi.server.RMIServerRPCImpl.getEJBResponse(RMIServerRPCImpl.java:106)
>
>
>         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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
>
>
>         at
>
>
> org.ow2.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:161)
>
>
>         at sun.rmi.transport.Transport$1.run(Transport.java:159)
>
>
>         at java.security.AccessController.doPrivileged(Native Method)
>
>
>         at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>
>
>         at
>
>
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>
>
>         at
>
>
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>
>
>         at
>
>
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>
>
>         at
>
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>
>
>         at
>
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>
>
>         at java.lang.Thread.run(Thread.java:619)
>
>
> "
>
>
> It does not mean much to me but I hope it is decipherable by yourself.
>
>
>
>
>
> With many thanks and looking forward to any help that you can give.
>
>
>
>
>
> For information I have managed to make a simple servlet work but NOT GWT.
>
>
>
>
>
> With best wishes,
>
>
>
>
>
> John
>
>  


Re: Re: Easybeans GWT persistence

by jbevan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Florent,

Line 23 is an empty line.
The code immediately before and after line 23 is as follows:
"    public String listGreet() {
        String gr = "Hoping this succeeeds!!";
        return gr;
    }
  //THIS IS LINE "3  
    public List listOfSchedules() {
        Query sch = entityManager.createNamedQuery("allSchedules");
        return sch.getResultList();
    }
"
Perhaps I did not give the full entry from the log.
The full entry is below:
"01-Sep-2008 07:47:33 org.ow2.easybeans.injection.EntityManagerHelper
getEntityManager
WARNING: Requested an EntityManager object but there is no
persistenceUnitManager associated to this bean/interceptor :
org.ow2.easybeans.container.session.stateless.StatelessSessionFactory@19d4f72
01-Sep-2008 07:47:33 org.ow2.easybeans.injection.EntityManagerHelper
getEntityManager
WARNING: Requested an EntityManager object but there is no
persistenceUnitManager associated to this bean/interceptor :
org.ow2.easybeans.container.session.stateless.StatelessSessionFactory@19d4f72
01-Sep-2008 07:47:33 org.ow2.easybeans.injection.JNDIBinderHelper
bindEnvJndiName
SEVERE: Cannot bind a null object with name
uk.co.rjbevan.facade.HIFacadeBean/entityManager
01-Sep-2008 07:47:33
org.ow2.easybeans.transaction.interceptors.AbsTransactionInterceptor
handleContextContainerTransaction
SEVERE: Exception (not application exception) in business method
java.lang.NullPointerException
        at
uk.co.rjbevan.facade.HIFacadeBean.original$EasyBeans$listOfSchedules(HIFacadeBean.java:23)
        at
org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
Source)
        at
org.ow2.easybeans.transaction.interceptors.CMTRequiredTransactionInterceptor.intercept(CMTRequiredTransactionInterceptor.java:110)
        at
org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
Source)
        at
org.ow2.easybeans.naming.interceptors.TomcatENCInterceptor.intercept(TomcatENCInterceptor.java:174)
        at
org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
Source)
        at uk.co.rjbevan.facade.HIFacadeBean.listOfSchedules(HIFacadeBean.java)
        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.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(StatelessSessionFactory.java:151)
        at
org.ow2.easybeans.container.session.SessionFactory.rpcInvoke(SessionFactory.java:181)
        at
org.ow2.easybeans.rpc.rmi.server.RMIServerRPCImpl.getEJBResponse(RMIServerRPCImpl.java:106)
        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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
        at
org.ow2.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:161)
        at sun.rmi.transport.Transport$1.run(Transport.java:159)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:619)
"
I had thouhgt that the initial lines refered to a previous operation.

My apologies if I sent the last message direct to you.

With best wishes,

John

Re: Re: Re: Easybeans GWT persistence

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hi John,

It means that the entityManager instance is null.
Do you have set @PersistenceContext annotation on this attribute ?

Regards,

Florent

jbevan@... wrote:

> Hi Florent,
>
> Line 23 is an empty line.
> The code immediately before and after line 23 is as follows:
> "    public String listGreet() {
> String gr = "Hoping this succeeeds!!";
> return gr;
>     }
>   //THIS IS LINE "3  
>     public List listOfSchedules() {
> Query sch = entityManager.createNamedQuery("allSchedules");
> return sch.getResultList();
>     }
> "
> Perhaps I did not give the full entry from the log.
> The full entry is below:
> "01-Sep-2008 07:47:33 org.ow2.easybeans.injection.EntityManagerHelper
> getEntityManager
> WARNING: Requested an EntityManager object but there is no
> persistenceUnitManager associated to this bean/interceptor :
> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory@19d4f72
> 01-Sep-2008 07:47:33 org.ow2.easybeans.injection.EntityManagerHelper
> getEntityManager
> WARNING: Requested an EntityManager object but there is no
> persistenceUnitManager associated to this bean/interceptor :
> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory@19d4f72
> 01-Sep-2008 07:47:33 org.ow2.easybeans.injection.JNDIBinderHelper
> bindEnvJndiName
> SEVERE: Cannot bind a null object with name
> uk.co.rjbevan.facade.HIFacadeBean/entityManager
> 01-Sep-2008 07:47:33
> org.ow2.easybeans.transaction.interceptors.AbsTransactionInterceptor
> handleContextContainerTransaction
> SEVERE: Exception (not application exception) in business method
> java.lang.NullPointerException
> at
> uk.co.rjbevan.facade.HIFacadeBean.original$EasyBeans$listOfSchedules(HIFacadeBean.java:23)
> at
> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
> Source)
> at
> org.ow2.easybeans.transaction.interceptors.CMTRequiredTransactionInterceptor.intercept(CMTRequiredTransactionInterceptor.java:110)
> at
> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
> Source)
> at
> org.ow2.easybeans.naming.interceptors.TomcatENCInterceptor.intercept(TomcatENCInterceptor.java:174)
> at
> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
> Source)
> at uk.co.rjbevan.facade.HIFacadeBean.listOfSchedules(HIFacadeBean.java)
> 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.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(StatelessSessionFactory.java:151)
> at
> org.ow2.easybeans.container.session.SessionFactory.rpcInvoke(SessionFactory.java:181)
> at
> org.ow2.easybeans.rpc.rmi.server.RMIServerRPCImpl.getEJBResponse(RMIServerRPCImpl.java:106)
> 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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
> at
> org.ow2.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:161)
> at sun.rmi.transport.Transport$1.run(Transport.java:159)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
> at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> "
> I had thouhgt that the initial lines refered to a previous operation.
>
> My apologies if I sent the last message direct to you.
>
> With best wishes,
>
> John
>
>
>  


Re: Re: Re: Re: Easybeans GWT persistence

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


  Hi John,

Also, do you have a persistence.xml file inside the META-INF/ folder of
your EJB-JAR file ?

Regards,

Florent

Florent BENOIT wrote:

>    Hi John,
>
> It means that the entityManager instance is null.
> Do you have set @PersistenceContext annotation on this attribute ?
>
> Regards,
>
> Florent
>
> jbevan@... wrote:
>> Hi Florent,
>>
>> Line 23 is an empty line.
>> The code immediately before and after line 23 is as follows:
>> "    public String listGreet() {
>>     String gr = "Hoping this succeeeds!!";
>>     return gr;
>>     }
>>   //THIS IS LINE "3      public List listOfSchedules() {
>>     Query sch = entityManager.createNamedQuery("allSchedules");
>>     return sch.getResultList();
>>     }
>> "
>> Perhaps I did not give the full entry from the log.
>> The full entry is below:
>> "01-Sep-2008 07:47:33 org.ow2.easybeans.injection.EntityManagerHelper
>> getEntityManager
>> WARNING: Requested an EntityManager object but there is no
>> persistenceUnitManager associated to this bean/interceptor :
>> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory@19d4f72
>>
>> 01-Sep-2008 07:47:33 org.ow2.easybeans.injection.EntityManagerHelper
>> getEntityManager
>> WARNING: Requested an EntityManager object but there is no
>> persistenceUnitManager associated to this bean/interceptor :
>> org.ow2.easybeans.container.session.stateless.StatelessSessionFactory@19d4f72
>>
>> 01-Sep-2008 07:47:33 org.ow2.easybeans.injection.JNDIBinderHelper
>> bindEnvJndiName
>> SEVERE: Cannot bind a null object with name
>> uk.co.rjbevan.facade.HIFacadeBean/entityManager
>> 01-Sep-2008 07:47:33
>> org.ow2.easybeans.transaction.interceptors.AbsTransactionInterceptor
>> handleContextContainerTransaction
>> SEVERE: Exception (not application exception) in business method
>> java.lang.NullPointerException
>>     at
>> uk.co.rjbevan.facade.HIFacadeBean.original$EasyBeans$listOfSchedules(HIFacadeBean.java:23)
>>
>>     at
>> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
>>
>> Source)
>>     at
>> org.ow2.easybeans.transaction.interceptors.CMTRequiredTransactionInterceptor.intercept(CMTRequiredTransactionInterceptor.java:110)
>>
>>     at
>> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
>>
>> Source)
>>     at
>> org.ow2.easybeans.naming.interceptors.TomcatENCInterceptor.intercept(TomcatENCInterceptor.java:174)
>>
>>     at
>> org.ow2.easybeans.gen.invocationcontext.uk.co.rjbevan.facade.HIFacadeBean.EasyBeansInvocationContextImpllistOfSchedulesAROUNDINVOKE-1450820046.proceed(Unknown
>>
>> Source)
>>     at
>> uk.co.rjbevan.facade.HIFacadeBean.listOfSchedules(HIFacadeBean.java)
>>     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.ow2.easybeans.container.session.stateless.StatelessSessionFactory.localCall(StatelessSessionFactory.java:151)
>>
>>     at
>> org.ow2.easybeans.container.session.SessionFactory.rpcInvoke(SessionFactory.java:181)
>>
>>     at
>> org.ow2.easybeans.rpc.rmi.server.RMIServerRPCImpl.getEJBResponse(RMIServerRPCImpl.java:106)
>>
>>     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
>> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
>>     at
>> org.ow2.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:161)
>>
>>     at sun.rmi.transport.Transport$1.run(Transport.java:159)
>>     at java.security.AccessController.doPrivileged(Native Method)
>>     at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
>>     at
>> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
>>     at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
>>
>>     at
>> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
>>
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>>
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>>
>>     at java.lang.Thread.run(Thread.java:619)
>> "
>> I had thouhgt that the initial lines refered to a previous operation.
>>
>> My apologies if I sent the last message direct to you.
>>
>> With best wishes,
>>
>> John
>>
>>
>>  
>
>
>


Re: Re: Re: Re: Easybeans GWT persistence

by jbevan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Florent,

There is a persistence.xml in the ejb.jar file in the META-INF.

There is a @PersistenceContext annotation in the HIFacadeBean.class

Should the annotation be anywhere else?

With Best wishes,

John

Re: Re: Re: Re: Re: Easybeans GWT persistence

by Florent BENOIT-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

    Hi John,

Do you have solved your problem ?

Regards,

Florent

jbevan@... wrote:

> Hi Florent,
>
> There is a persistence.xml in the ejb.jar file in the META-INF.
>
> There is a @PersistenceContext annotation in the HIFacadeBean.class
>
> Should the annotation be anywhere else?
>
> With Best wishes,
>
> John
>
>
>  


Re: Re: Re: Re: Re: Re: Easybeans GWT persistence

by jbevan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Florent,

Unfortunately not!

Am still working on it.

I will return if I have further thoughts.

With best wishes,

John
LightInTheBox - Buy quality products at wholesale price!