users@glassfish.java.net

Re: Problem with the key type with findById

From: Youness <youness126_at_gmail.com>
Date: Sat, 13 Mar 2010 10:10:12 +0330

What is that "ejb.Customer.class" in your find method? First, try using
"Customer.class" and importing the class "Customer".

On Fri, Mar 12, 2010 at 10:20 PM, <glassfish_at_javadesktop.org> wrote:

> javax.ejb.EJBException
> at
> com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3903)
> at
> com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3803)
> at
> com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3605)
> at
> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1388)
> at
> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1325)
> at
> com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:205)
> at
> com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
> at $Proxy141.find(Unknown Source)
> at web.UpdateCustomer.processRequest(UpdateCustomer.java:46)
> at web.UpdateCustomer.doGet(UpdateCustomer.java:92)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> at
> org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> at
> com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at
> com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at
> com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
> at
> com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
> Caused by: java.lang.IllegalArgumentException: You have provided an
> instance of an incorrect PK class for this find operation. Class expected :
> class java.lang.Integer, Class received : class java.lang.Long.
> at
> oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.findInternal(EntityManagerImpl.java:328)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.find(EntityManagerImpl.java:148)
> at
> com.sun.enterprise.util.EntityManagerWrapper.find(EntityManagerWrapper.java:546)
> at ejb.CustomerFacade.find(CustomerFacade.java:38)
> 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
> com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011)
> at
> com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175)
> at
> com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2929)
> at
> com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4020)
> at
> com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
> [Message sent by forum member 'j2eestruts' (je.berglund_at_comhem.se)]
>
> http://forums.java.net/jive/thread.jspa?messageID=391545
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>