Javax.ejb.CreateException, java.rmi.RemoteException

When I deployed my war file and jar file on jboss server I am getting the following exception:
what will be cause:
10:32:03,051 ERROR [LogInterceptor] EJBException in method: public abstract com.cisco.avm.jbossmysqlejb.CustomerSessionRemote com.cisco.avm.jbossmysqlejb.CustomerSessionRemoteHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException:
javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract com.cisco.avm.jbossmysqlejb.CustomerSessionRemote com.cisco.avm.jbossmysqlejb.CustomerSessionRemoteHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException

SLSB have only one constructor. If you have another overloaded. It will never be called.
Regds
Ashwani

Similar Messages

  • Java.rmi.RemoteException: EJB Exception: while calling an EJB method,

    Hi
    I am getting below error while calling a stateless EJB method. There is some validation checks while performing ejb's modify() method and a RuntimeException is thrown in case of validation failure.The modify() method internally calls other stateless ejb as well.
    The problem I'm facing is, instead of getting the expected RuntimeException in the Servlet, i am getting RemoteException. I am using WLS 9 MP1, all participating ejbs are stateless and i am using default transaction attributes(Supports) for these ejbs.
    The interesting part is, at the ejb layer RuntimeException is thrown as expected, but this exception changed to RemoteException at the servlet's end where i am catching the ejb call exceptions.
    I am new to WLS, please suggest/help me out of this exception.
    Any help is truly appreciated.
    java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.RuntimeException:
         at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
         at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
         at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
         at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
         at com.mycomp.base.BaseController_8x2e52_EOImpl.modify(BaseController_8x2e52_EOImpl.java:149)
         at com.mycomp.webgui.servlet.FrontComponent.service(FrontComponent.java:207)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Thanks!
    Edited by: user10721298 on Feb 23, 2009 4:16 AM

    Hi,
    If i don't misunderstand, you are using the RuntimeException as an application exception, right?
    Have you annotated it or denoted it in deployment descriptor?
    Thanks,
    Amy

  • Java.rmi.RemoteException: CORBA TRANSIENT 0x49421071 - WPS portlet - EJB Jonas

    Hello,
    I'd like to use EJB session working in Jonas 4.3.4 (jdk 1.4) with a portlet in WPS 5.0 (jdk 1.3) throught iiop protol.
    I succeed to initialized the context, then to lookup the jndiName of the EJB but when I try to instanciate (eJBhome.create()) the EJB the following exception occur :
    java.rmi.RemoteException: CORBA TRANSIENT 0x49421071 No; nested exception is:
    org.omg.CORBA.TRANSIENT: GETCONNECTIONKEY_RETURNED_FALSE minor code: 1229066353 completed: No
    Does someone know the meaning of that corba exception ?
    Does someone already succeed to do such communication ?
    Do you know an other protocol that can help me ?
    Here is my code in the WPS portlet:
         Properties env = new Properties();
         env.put("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
         env.put("java.naming.provider.url","iiop://XX.XXX.X.XX:YYYY");
         javax.naming.InitialContext initContext = new javax.naming.InitialContext(env);
         String JNDIName = "BestPracticeServiceHome";
              Object obj = initContext.lookup(JNDIName);
              BestPracticeServiceHome myHome = (BestPracticeServiceHome)PortableRemoteObject.narrow(obj,BestPracticeServiceHome.class);
         //Here occur the exception :
              BestPracticeService myService = myHome.create();
    Note: if I use the WPS 5.0 test environment in RAD 6 everything works.
    Thanks in advance,
    Best Regards,
    J�r�me

    Sorry, I forgot to say, the original SunONE 7 works fine
    without this error.

  • Java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException

    Hi, I created a webservice using weblogic8.1 sp3 workshop. On my desktop, I tested the webservice with a java client and it worked fine. When I deployed webservice application on UNIX production server, it deployed successfully and it displayed WSDL file too. But, when I run java client from desktop to access this webservice on UNIX server, it is throwing the following exception.
    java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
    Detail:
    <detail>
    null </detail>; nested exception is:
    javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
    at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:31)
    at SoapClient.main(SoapClient.java:17)
    Caused by: javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
    at weblogic.webservice.core.ClientDispather.receive(ClientDispatcher.java:313)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:290)
    at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:26)
    can somebody please help me. This is very critical for me.
    Thanks in advance.

    Hi, I created a webservice using weblogic8.1 sp3 workshop. On my desktop, I tested the webservice with a java client and it worked fine. When I deployed webservice application on UNIX production server, it deployed successfully and it displayed WSDL file too. But, when I run java client from desktop to access this webservice on UNIX server, it is throwing the following exception.
    java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
    Detail:
    <detail>
    null </detail>; nested exception is:
    javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
    at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:31)
    at SoapClient.main(SoapClient.java:17)
    Caused by: javax.xml.rpc.soap.SOAPFaultException: EXCEPTION: java.lang.NoClassDefFoundError [ServiceException]
    at weblogic.webservice.core.ClientDispather.receive(ClientDispatcher.java:313)
    at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
    at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
    at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:290)
    at weblogic.jws.proxies.MyServiceSoap_Stub.getInfo(MyServiceSoap_Stub.java:26)
    can somebody please help me. This is very critical for me.
    Thanks in advance.

  • Java.rmi.RemoteException: Error initializing ejb-module java.lang.NoClassDe

    Hi,
    I have an ear file which has ejb jar and war file. Application is running fine through Jdeveloper but when am trying to deploy it in Oracle Application Server 10g getting following error. Any help in this would be appreciated.
    Deployment failed: Nested exception
    Resolution:
    Base Exception:
    java.rmi.RemoteException
    deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Error loading class 'ge.model.common.ejb.ReserveAccountBean': java.lang.NoClassDefFoundError: ge/common/exception/dao/GEDAOException. deploy failed!: ; nested exception is:
    oracle.oc4j.admin.internal.DeployerException: Error initializing ejb-module; Exception Error loading class 'ge.model.common.ejb.ReserveAccountBean': java.lang.NoClassDefFoundError: ge/common/exception/dao/GEDAOException
    Thanks and Regards,
    Ujwala

    Ujwala,
    I don't think classes in the "ejb.jar" file can access classes in the WAR file (and vice-versa). Perhaps you can put this class in a separate JAR file and put that JAR file in the "applib" subdirectory (of your OC4J installation). Then it will be accessible to all your J2EE applications deployed to OC4J.
    Good Luck,
    Avi.

  • Java.rmi.RemoteException: EJB Exception: ; nested exception is:

    Hi All,
    Please some out help me out,
    i have a written a stateless session bean, which is compiled with out errors, and i deployed it in wblogic server.
    when i run my client program, i get this exceptions. please some one help me how to tackle this,
    Thanks in advance,
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NoClassDefFoundError: secure/SDK/SAPIAgent
    Start server side stack trace:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NoClassDefFoundError: SDK/SAPIAgent
    java.lang.NoClassDefFoundError: SDK/SAPIAgent
    at SAPI.SAPIBean.<init>(SAPIBean.java:18)
    at SAPI.SAPIBean_163r2w_Impl.<init>(SAPIBean_163r2w_Impl.java:31)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:232)
    at weblogic.ejb20.manager.BaseEJBManager.allocateBean(BaseEJBManager.java:129)
    at weblogic.ejb20.manager.StatelessManager.createBean(StatelessManager.java:266)
    at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:148)
    at weblogic.ejb20.pool.StatelessSessionPool.getBean(StatelessSessionPool.java:101)
    at weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:142)
    at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:138)
    at weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java:70)
    at valyd.SAPI.SAPIBean_163r2w_EOImpl.getSession(SAPIBean_163r2w_EOImpl.java:234)
    at valyd.SAPI.SAPIBean_163r2w_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:455)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:396)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:731)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:391)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:261)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:223)
    End server side stack trace
    ; nested exception is: java.lang.NoClassDefFoundError: SDK/SAPIAgent
    Murali

    Hi All,
    Please some out help me out,
    i have a written a stateless session bean, which is compiled with out errors, and i deployed it in wblogic server.
    when i run my client program, i get this exceptions. please some one help me how to tackle this,
    Thanks in advance,
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NoClassDefFoundError: secure/SDK/SAPIAgent
    Start server side stack trace:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NoClassDefFoundError: SDK/SAPIAgent
    java.lang.NoClassDefFoundError: SDK/SAPIAgent
    at SAPI.SAPIBean.<init>(SAPIBean.java:18)
    at SAPI.SAPIBean_163r2w_Impl.<init>(SAPIBean_163r2w_Impl.java:31)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:232)
    at weblogic.ejb20.manager.BaseEJBManager.allocateBean(BaseEJBManager.java:129)
    at weblogic.ejb20.manager.StatelessManager.createBean(StatelessManager.java:266)
    at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:148)
    at weblogic.ejb20.pool.StatelessSessionPool.getBean(StatelessSessionPool.java:101)
    at weblogic.ejb20.manager.StatelessManager.preInvoke(StatelessManager.java:142)
    at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:138)
    at weblogic.ejb20.internal.StatelessEJBObject.preInvoke(StatelessEJBObject.java:70)
    at valyd.SAPI.SAPIBean_163r2w_EOImpl.getSession(SAPIBean_163r2w_EOImpl.java:234)
    at valyd.SAPI.SAPIBean_163r2w_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:455)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:396)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:731)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:391)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:261)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:223)
    End server side stack trace
    ; nested exception is: java.lang.NoClassDefFoundError: SDK/SAPIAgent
    Murali

  • Java.rmi.RemoteException:  newServlets not found

    I am developing a java servlet using J2EE 1.4 RI.
    I have developed a new application called newServlets.ear. This application has a web component named Servlet1. When I click on Tools, Deploy I get the following error:
    stop newServlets
    running...
    java.rmi.ServerException: RemoteException occured in server thread; nested exception is:
    java.rmi.RemoteException: newServlets not found; nested exception is
    javax.management.InstanceNotFoundException: newServlets not found at
    com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:61)
    at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
    at
    org.omg.stub.com.sun.enterprise.tools.deployment.backend.JarInstaller_Stub.stop(Unknown Source)
    The J2EE RI Verifier produces no failed tests or warnings.
    I have no idea what is causing this. Each time this happens, the Command Prompt window that is running J2ee server displays the message:
    Stop recieved
    I have tried stopping and restarting both the j2ee server and deploytool, but this has not fixed the problem.
    In my servlet, I would like to take information that has been entered into an HTML text field and add it to a MS Access database. I have the following code in my servlet to load the driver:
    final String pathConnection="jdbc:odbc:"+dataBase;
    con = null;
    String driverName="sun.jdbc.odbc.JdbcOdbcDriver";
    try{
    try{
    Class.forName(driverName);
    System.out.println("OK");
    catch (ClassNotFoundException e)
    System.out.println(" ERROR : driver not found");
    e.printStackTrace();
    }//end inner try/catch
    System.out.println("Drivers (DriverManager.getDrivers()) :");
    con = DriverManager.getConnection(pathConnection, "", "");
    }//end outer try block
    catch (Exception e)
    e.printStackTrace();
    }//end outer catch
    The following code is being used to enter the data into the database:
    try {
    stmt = con.prepareStatement(
    "INSERT INTO User (emailAddress, passWord) VALUES (?, ?)");
    stmt.setString(1, emAddress);
    stmt.setString(2, passWord);
    stmt.executeUpdate();
    catch (SQLException e) {
    System.err.println(e);
    e.printStackTrace();
    finally {
    con.close();
    Is it possible that something in the code above is causing the problem??
    Please help!!
    I am running J2EE 1.4 RI and J2SDK1.4.1_01 on Windows XP Professional.

    java.rmi.ServerException: RemoteException occured in
    server thread; nested exception is:
    java.rmi.RemoteException: newServlets not found;
    nested exception is
    javax.management.InstanceNotFoundException:
    newServlets not found at
    I'm having a similar problem trying to deploy an EJB on the j2ee 1.4 ri. It appears to be some sort of JMX problem. I suspect it has something to do with having a wrong value somewhere in the sun-j2ee-ri.xml descriptor, but I haven't figured it out yet. If you have, can you let me know what you did to fix it?
    Thanks,
    Steve

  • Javax.ejb.CreateException:

    Hello friends
    I have created an ejb module that contains all my business logic and deployed it,that module contains some entities.Each time I call any ejb method that handles any enity,I get this exception:
    Exception in thread "main" javax.ejb.EJBException: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
    at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:448)
    at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2418)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1811)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:200)
    at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:75)
    at $Proxy178.SayHello(Unknown Source)
    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.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:146)
    at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:176)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:682)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:216)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1841)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1695)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1078)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:221)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:797)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:561)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2558)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:492)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:528)
    Caused by: javax.ejb.EJBException: javax.ejb.CreateException: Could not create stateless EJB
    at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:718)
    at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:200)
    at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:443)
    ... 22 more
    Caused by: javax.ejb.CreateException: Could not create stateless EJB
    at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:526)
    at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:90)
    at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:716)
    ... 24 more
    Caused by: com.sun.enterprise.container.common.spi.util.InjectionException: Exception attempting to inject Env-Prop: PU@Field-Injectable Resource. Class name = Agents.DepartementAgent Field [email protected]@@@ into class Agents.DepartementAgent
    at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:614)
    at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.inject(InjectionManagerImpl.java:384)
    at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.injectInstance(InjectionManagerImpl.java:168)
    at com.sun.ejb.containers.BaseContainer.injectEjbInstance(BaseContainer.java:1622)
    at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:486)
    ... 26 more
    Caused by: java.lang.IllegalArgumentException: Can not set javax.persistence.EntityManagerFactory field Agents.DepartementAgent.emf to com.sun.enterprise.container.common.impl.EntityManagerWrapper
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
    at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
    at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
    at java.lang.reflect.Field.set(Field.java:657)
    at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl._inject(InjectionManagerImpl.java:565)
    ... 30 more

    @Stateless
    public class DepartementAgentEJB implements DepartementAgentEJBRemote {
    /*EJB state*/
    private EntityManagerFactory emf;
    private EntityManager em;
    public DepartementAgentEJB() {
    public void init(){
    emf = Persistence.createEntityManagerFactory("PU");
    em = emf.createEntityManager();
    System.out.println("Persistence created");
    public Response Authentificate(Request request){
    init();
    DepartementResponse response = new DepartementResponse();
    int id = Integer.valueOf(request.getBarcode().getStudentID());
    Student student = em.find(Student.class, id);
    System.out.println("Student got");
    Access_Code code = em.find(Access_Code.class, id);
    System.out.println("code got");
    ScolaryInformation info = em.find(ScolaryInformation.class, id);
    System.out.println("scolary info got");
    String password = Helpper.DecryptAccessCode(request.getPassword().getCrypted(), request.getPassword().getKey(),
    request.getPassword().getOutputLength());
    if(info.Stills_student())
    //we make this test to see if the student stills student or not
    if (code.getCode().equals(password))
    //if he stills student then we confirm about his acces code
    response.setAuthorization(true);
    else
    response.setAuthorization(false);
    else
    response.setAuthorization(false);
    response.setFirstName(student.getFirstName());
    response.setPhoto(student.getPhoto());
    return response;
    }//END CLASS IMPLEMENTATIONS

  • Javax.ejb.CreateException: CORBA TRANSACTION_ROLLEDBACK 9998

    while interacting with the server side bean , i am getting teh following exception.
    exception
    Aug 30, 2007 5:53:12 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    javax.ejb.CreateException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
    org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
    at ossj.sa.ri.order.JVTActivationBean.createOrderByValue(JVTActivationBean.java:357)
    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 com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
    at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:107)
    at $Proxy23.createOrderByValue(Unknown Source)
    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 com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:340)
    at com.sun.enterprise.appclient.Main.main(Main.java:180)
    Caused by: java.lang.reflect.InvocationTargetException
    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 com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:232)
    at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:329)
    ... 1 more
    Caused by: javax.ejb.CreateException: CORBA TRANSACTION_ROLLEDBACK 9998 Maybe; nested exception is:
    org.omg.CORBA.TRANSACTION_ROLLEDBACK: vmcid: 0x2000 minor code: 1806 completed: Maybe
    at ossj.sa.ri.order.JVTActivationBean.createOrderByValue(JVTActivationBean.java:357)
    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 com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
    at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
    at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
    at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
    at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:107)
    at $Proxy23.createOrderByValue(Unknown Source)
    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 com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
    at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
    at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
    at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
    at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
    I could not undersatnd waht can be the roblem.
    Please do help me

    check your server log, it may contain some information

  • Method foo() must include java.rmi.RemoteException

    Here's the full exception:
    In EJB VWBaseUser, method setUsername(java.lang.String) defined in the remote
    interface must include java.rmi.RemoteException in its throws clause.
    The problem is, I am throwing RemoteExceptions in my remote interface! Here's
    the code:
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface VWBaseUser extends EJBObject
    public String getFirstName() throws java.rmi.RemoteException;
    public void setFirstName() throws java.rmi.RemoteException;
    public String getLastName() throws java.rmi.RemoteException;
    public void setLastName() throws java.rmi.RemoteException;
    public String getUserName() throws java.rmi.RemoteException;
    public void setUserName() throws java.rmi.RemoteException;
    public String getPassword() throws java.rmi.RemoteException;
    public void setPassword() throws java.rmi.RemoteException;
    What gives?!? The only thing I could think of was that I'm somehow using an old
    JDK to compile with, but I thought I checked that and it was pointing to JDK 1.3.1
    (unfortunately, we're still using VisualCafe, and an old version at that, since
    Webgain is imploding)

    Yup, that must've been it. I did have the classes elsewhere in 'exploded' format,
    in addition to my EJB jar. Got rid of them, and the problem went away.
    Thanks!
    Brian
    Rob Woollen <[email protected]> wrote:
    The usual cause is you have another version of this class in your
    classpath which doesn't contain the RemoteException, and ejbc is finding
    this version.
    -- Rob
    Brian Preston wrote:
    Here's the full exception:
    In EJB VWBaseUser, method setUsername(java.lang.String) defined inthe remote
    interface must include java.rmi.RemoteException in its throws clause.
    The problem is, I am throwing RemoteExceptions in my remote interface!Here's
    the code:
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface VWBaseUser extends EJBObject
    public String getFirstName() throws java.rmi.RemoteException;
    public void setFirstName() throws java.rmi.RemoteException;
    public String getLastName() throws java.rmi.RemoteException;
    public void setLastName() throws java.rmi.RemoteException;
    public String getUserName() throws java.rmi.RemoteException;
    public void setUserName() throws java.rmi.RemoteException;
    public String getPassword() throws java.rmi.RemoteException;
    public void setPassword() throws java.rmi.RemoteException;
    What gives?!? The only thing I could think of was that I'm somehowusing an old
    JDK to compile with, but I thought I checked that and it was pointingto JDK 1.3.1
    (unfortunately, we're still using VisualCafe, and an old version atthat, since
    Webgain is imploding)

  • Warning: Unable to create new entry, caught: "javax.ejb.CreateException", message is:

    Warning: Unable to create new entry, caught: "javax.ejb.CreateException", message is: "Error creating EntityBean: Io exception: The Network Adapter could not establish the connection".
    while executing JSP:<%
    * add.jsp
    * Adds a new entry through EmployeeBean. This is a JSP that serves 2
    * functions. First of all, when called with no arguments, it will display a
    * table with a few input fields. The user should enter empNo, empName and
    * salary of the new record to be added. When she submits this
    * information, it is sent to this page again. If it is successful, then the
    * user can continue adding new entries. If it is not, then the old data will
    * be displayed, and a warning message will be shown to her.
    %>
    <%@ page import="com.webstore.*,java.io.*,java.util.*,javax.naming.*" %>
    <%
    // Make sure this page will not be cached by the browser
    response.addHeader("Pragma", "no-cache");
    response.addHeader("Cache-Control", "no-store");
    // We will send error messages to System.err, for verbosity. In a real
    // application you will probably not want this.
    PrintStream errorStream = System.err;
    // If we find any fatal error, we will store it in this variable.
    String error = null;
    // In a moment we will check if all columns were passed to this page
    String param_1 = "";
    String param_2 = "";
    String param_3 = "";
    long dptNo = 0;
    String dptName = null;
    // This variable indicates what function of this page is currently used. If
    // this page is called with parameters, then a new entry should be
    // added. In that case this variable is true.
    boolean submitting = false;
    // We will first attempt to get the reference to EmployeeHome from the
    // session. The "list.jsp" page sets this attribute in the session.
    DepartmentHome home = (DepartmentHome) session.getAttribute("DepartmentHome");
    if (home == null) {
    error = "No previous connection to DepartmentBean.";
    } else {
    // Attempt to get all 3 parameters from the session
    param_1 = request.getParameter("DPTNO");
    param_2 = request.getParameter("DPTNAME");
    // If all 3 parameters are specified, then this is probably a submission by
    // this very page. Note that if the user left one of the fields blank, then
    // the corresponding parameter will be "", not null.
    if (param_1 != null && param_2 != null) {
    param_1 = param_1.trim();
    param_2 = param_2.trim();
    submitting = true;
    // In the following variable we will store a (non-fatal) warning message. This
    // message will be displayed in the page, but so will the submission form.
    String warning = null;
    if (submitting) {
    warning = "";
    // If there is an empty param_1, param_2 and/or param_3, then this will be noted
    // in the warning message.
    if ("".equals(param_1)) {
    warning = "Null param_1 specified. ";
    if ("".equals(param_2)) {
    warning += "Null param_2 specified. ";
    // If we don't have a warning message yet, then we will attempt to create
    // a new record.
    if ("".equals(warning)) {
    try {
    dptNo = (long)Long.parseLong(param_1);
    dptName = new String(param_2);
    Department rec = (Department) home.create(dptNo);
    rec.setDptname(dptName);
    // empty columns after insert for effect
    param_1 = "";
    param_2 = "";
    // If we got this far, then there was no problem detected.
    warning = null;
    } catch (Exception e) {
    // Set the warning variable to indicate a problem.
    warning = "Unable to create new entry, caught: \"" +
    e.getClass().getName() + "\", message is: \"" +
    e.getMessage() + "\".";
    // Decide what the title will be.
    String title;
    if (error != null) {
    title = "Error";
    } else {
    title = "com.webstore | Add entry";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <HTML>
    <HEAD>
    <TITLE><%= title %></TITLE>
    </HEAD>
    <BODY bgcolor="#FFFFFF">
    <H1><%= title %></H1>
    <%
    // If there was a fatal error, then display the error message
    if (error != null) {
    %>
    <P><BLOCKQUOTE><%= error %></BLOCKQUOTE>
    <%
    // Otherwise display a table with fields to be filled in.
    } else {
    // If there was a warning, then display it.
    if (warning != null) {
    %>
    <TABLE border="1" bgcolor="#FF2222">
    <TR><TD><FONT color="#FFFFFF"><STRONG>Warning: <%= warning %></STRONG></FONT></TD></TR>
    </TABLE>
    <%
    } /* if */
    // Display the table with fields. There are two columns. The left column
    // contains the names of the fields, while the right column contains the
    // fields.
    %>
    <FORM action="dptadd.jsp" method="GET">
    <P><TABLE border="1">
    <TR>
    <TD><STRONG>DptNo:</STRONG></TD>
    <TD><INPUT type="text" name="DPTNO" value="<%= param_1 %>"></INPUT></TD>
    </TR>
    <TR>
    <TD><STRONG>DptName:</STRONG></TD>
    <TD><INPUT type="text" name="DPTNAME" value="<%= param_2 %>"></INPUT></TD>
    </TR>
    <TR>
    <TD colspan="3" align="center"><INPUT type="submit" value="Add this entry"></INPUT></TD>
    </TR>
    </TABLE>
    </FORM>
    <%
    } /* else */
    %>
    <P><TABLE border="1">
    <TR><TD>Back to list</TD></TR>
    </TABLE>
    </BODY>
    </HTML>
    Please guide me..

    Rajive,
    This is the same problem as in your other post:
    sql is running very slow
    So please refer to my answer there.
    Good Luck,
    Avi.

  • Java.lang.Exception,java.rmi.RemoteException

    Hi ,
    Whem I'm deploying my appliucation on WLS 10.3 I'm getting the following exception.
    ####<Nov 13, 2008 1:32:21 PM IST> <Warning> <EJB> <swetha> <AdminServer> <[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1226563341175> <BEA-012035> <The Remote interface method: 'public abstract java.util.Collection com.bt.resmgt.aam.model.absence.book.AttendanceManager.findAbsences(com.bt.fieldpeople.security.models.Subject,com.bt.resmgt.aam.model.employee.Employee,java.util.List,java.lang.String,java.lang.String,java.util.List,java.util.Date,java.util.Date,java.util.Date,boolean,boolean,boolean,boolean,boolean,boolean,boolean,java.lang.String[]) throws java.lang.Exception,java.rmi.RemoteException' in EJB 'AttendanceManager' contains a parameter of type: 'java.util.List' which is not Serializable. Though the EJB 'AttendanceManager' has call-by-reference set to false, this parameter is not Serializable and hence will be passed by reference. A parameter can be passed using call-by-value only if the parameter type is Serializable.>
    could anybody please help me out?
    any type of jelp will be greatly appreciated.
    Thanks,
    Neeraj

    Your problem is here:
    «'java.util.List' which is not Serializable»
    You're trying to deploy a remote bean. Local beans can work with a parameter that isn't serializable, because their access is made by reference (pointers). But for remote beans, the whole object must be serialized and send over the network to be received by the client. Thus, the java.util.List can't be serialised, so WL complains.
    You must choose a container that can be serialized like java.util.ArrayList, a LinkedList or a vector in case of lists, or use local beans. Anyway, I think serialised objects should always be used with bean functions parameters.

  • SOS: javax.ejb.CreateException: Create failed because primary key is null

    Hello,
    I am desperately trying to get my application server to create a record through CMP 2. My app server is JRun 4.
    Here is the client:
    package com.parispano.tests;
    import java.util.Date;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.parispano.account.entity.Account;
    import com.parispano.account.entity.AccountHome;
    public class ClientEJBDeuxTemp {
      public static void main(String[] args) {
        System.out.println("\nBegin account DemoClient...\n");
        try {
          // Create A Demo object, in the server
          // Note: the name of the class corresponds to the JNDI
          // property declared in the DeploymentDescriptor
          // From DeploymentDescriptor ...
          // beanHomeName demo.DemoHome
          Context ctx = getInitialContext();
          AccountHome ahome = (AccountHome) ctx.lookup("AccountEJBHome");
          //System.out.println("Creating Demo\n");
          Account account = ahome.create("toto","toto", "toto","toto","toto","toto","toto","toto","toto","toto","toto",new Date(),new Date());
        catch (Exception e) {
          System.out.println(":::::::::::::: Error :::::::::::::::::");
          e.printStackTrace();
        System.out.println("\nEnd DemoClient...\n");
      static String user     = "admin";
      static String password = "admin";
      static String url      = "ordi:2908";
       * Gets an initial context.
       * @return                  Context
       * @exception               java.lang.Exception if there is
       *                          an error in getting a Context
      static public Context getInitialContext() throws Exception {
        Properties p = new Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, "jrun.naming.JRunContextFactory");
        p.put(Context.PROVIDER_URL, url);
        if (user != null) {
          System.out.println ("user: " + user);
          p.put(Context.SECURITY_PRINCIPAL, user);
          if (password == null)
            password = "";
          p.put(Context.SECURITY_CREDENTIALS, password);
        return new InitialContext(p);
    }and here is the exception I get:
    javax.ejb.CreateException: Create failed because primary key is null
    I don't understand why I get this as the primary key is "toto" and therefore is not null.
    Here is the DD:
    <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
        <display-name>Account EJB</display-name>
        <enterprise-beans>
          <entity>
            <display-name>Account EJB</display-name>
            <ejb-name>AccountEJB</ejb-name>
            <home>com.parispano.account.entity.AccountHome</home>
              <remote>com.parispano.account.entity.Account</remote>
            <local-home>com.parispano.account.entity.AccountLocalHome</local-home>
            <local>com.parispano.account.entity.AccountLocal</local>
            <ejb-class>com.parispano.account.entity.AccountEJB</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.String</prim-key-class>
            <reentrant>False</reentrant>
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>account</abstract-schema-name>
            <cmp-field>
            <description>Login</description>
            <field-name>login</field-name>
            </cmp-field>
            <!-- -->
            <cmp-field>
              <description>Password</description>
              <field-name>password</field-name>
            </cmp-field>
            <cmp-field>
              <description>Surname</description>
              <field-name>surname</field-name>
            </cmp-field>
            <cmp-field>
              <description>First Name</description>
              <field-name>firstName</field-name>
            </cmp-field>
            <cmp-field>
              <description>Address One</description>
              <field-name>addressOne</field-name>
            </cmp-field>
            <cmp-field>
              <description>Address Two</description>
              <field-name>addressTwo</field-name>
            </cmp-field>
            <cmp-field>
              <description>Postcode</description>
              <field-name>postcode</field-name>
            </cmp-field>
            <cmp-field>
              <description>City</description>
              <field-name>city</field-name>
            </cmp-field>
            <cmp-field>
              <description>Country</description>
              <field-name>country</field-name>
            </cmp-field>
            <cmp-field>
              <description>Telephone</description>
              <field-name>telephone</field-name>
            </cmp-field>
            <cmp-field>
              <description>Email</description>
              <field-name>email</field-name>
            </cmp-field>
            <cmp-field>
              <description>Inscription Date</description>
              <field-name>inscriptionDate</field-name>
            </cmp-field>
            <cmp-field>
              <description>Last Visit Date</description>
              <field-name>lastVisitDate</field-name>
            </cmp-field>
              <primkey-field>login</primkey-field>
          </entity>
        </enterprise-beans>
      </ejb-jar>Can anyone tell me why I am getting this exception please?
    Thanks in advance,
    Julien Martin.

    Yes, I have set the PK. Actually this is happening when the number of columns are more than 63 columns. After I reduce the number of column, it is working fine.
    Is it the actual problem???
    fyi, I'm using jboss as the Application Server...

  • Java.rmi.RemoteException: Protocol error reported by the card! why?

    Hello,
    I am currently trying to run the JCK 2.2.1 SecureRMIDemo using SmartCardIO instead of OCF, but getting an error:
    java.rmi.RemoteException: Protocol error reported by the card
    (in my last post I succesfully ran the RMIDemo using my SmartCardIO implementation, see http://forums.sun.com/thread.jspa?threadID=5405634&tstart=15)
    So here is what I did:
    - I succesfully loaded the server app (com.sun.javacard.samples.SecureRMIDemo) on the card without changes.
    - I created an new accessor class: public class PINCardAccessor extends SmartCardIOAccessor (I wrote SmartCardIOAccessor for the RMIDemo, it should work fine as an accessor)
    - The contents of PINCardAccessor class and SecureOCFCardAccessor are the same, just the class declration makes the difference
    - Here is the most important part of my main method:
                   ca = new PINCardAccessor(false);
                   JavaCardRMIConnect  jcRMI = new JavaCardRMIConnect(ca);                         
                   jcRMI.selectApplet(appAID);
                   // send PIN
                   System.out.println("Sending PIN...");
                if (! ((PINCardAccessor) ca).authenticateUser( PRINCIPAL_APP_PROVIDER_ID ))
                     System.out.println("Wrong PIN!");
                     System.exit(0);
                   Purse myServ = (Purse) jcRMI.getInitialReference();
                   if(myServ == null)
                      throw new Exception("Received null instead of the initial ref");
                   // print balance
                   System.out.println("Balance: "+myServ.getBalance());And finally here is the debug output:
    accessor: select command
    0 a4 4 0 a a0 0 0 0 62 3 1 c a 1 7f
    90 0 6f 42 6e 40 5e 3e 2 2 38 81 33 f1 0 26 63 6f 6d 2f 73 75 6e 2f 6a 61 76 61 63 61 72 64 2f 73 61 6d 70 6c 65 73 2f 53 65 63 75 72 65 52 4d 49 44 65 6d 6f f 53 65 63 75 72 65 50 75 72 73 65 49 6d 70 6c
    90 0 6f 42 6e 40 5e 3e 2 2 38 81 33 f1 0 26 63 6f 6d 2f 73 75 6e 2f 6a 61 76 61 63 61 72 64 2f 73 61 6d 70 6c 65 73 2f 53 65 63 75 72 65 52 4d 49 44 65 6d 6f f 53 65 63 75 72 65 50 75 72 73 65 49 6d 70 6c
    Sending PIN...
    80 39 0 0 4 12 34 0 46 7f
    90 0 0 0
    Le=2
    csum1=0
    csum2=0
    90 0
    80 38 2 2 6 33 f1 ec a8 ff b8 7f
    90 0 99 0 6 ff 9f
    Le=5
    csum1=-97
    csum2=-97
    90 0 99 0 6
    java.rmi.RemoteException: Protocol error reported by the card
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.throwError(Unknown Source)
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.throwException(Unknown Source)
         at com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory.getObject(Unknown Source)
         at com.sun.javacard.ocfrmiclientimpl.JCRemoteRefImpl.parseAPDU(Unknown Source)
         at com.sun.javacard.ocfrmiclientimpl.JCRemoteRefImpl.invoke(Unknown Source)
         at com.sun.javacard.samples.SecureRMIDemo.SecurePurseImpl_Stub.getBalance(Unknown Source)
         at SecureClient.main(SecureClient.java:60)Please help me, I cant find the reason for this exception.
    thank you
    sebastaian

    Oh, thanks for pointing at the JCRE Spec, it is very informative, but i still have not found the problem yet.
    If i understand everything right, the communication's flow is
    SecureClient <-> PINCardAccessor <-> SmartCardIOAccessor <-> MySecurityService <-> SecurePurseImpl (with help of SecurePurseApplet)
    probably i made a mistake in a protocol of one or more layers.
    - MySecurityService, SecurePurseImpl and SecurePurseApplet are EXACTLY the one's from com.sun.javacard.samples.SecureRMIDemo of JCDK 2.2.1, so there cant be any mistake (?).
    - SmartCardIOAccessor worked fine in my RMIDemo tests, see http://forums.sun.com/thread.jspa?threadID=5405634&tstart=15 - there is also the implementation)
    - SecureClient must be obviously correctly
    so maybe it's something about PINCardAccessor? hmm...i havent found anything, but here is the complete code:
    import javax.smartcardio.CardException;
    * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
    * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    * @(#)SecureOCFCardAccessor.java     1.11 03/07/08
    public class PINCardAccessor extends SmartCardIOAccessor {
        public PINCardAccessor(boolean debug) throws CardException {
              super(debug);
         private static final byte INS_SELECT   = (byte)0xA4;
        private static final byte APDU_CMD_MASK = (byte)0xFC;
        private static final byte CLA_ISO7816 = (byte)0x00;
        private static final byte CLA_AUTH = (byte)0x80;
        private static final byte INS_AUTH = (byte)0x39;
        private static final boolean debug2 = false;
        /** Modifies the data and calls super.sendCommandAPDU to perform the actual send.
         * The data returned from the smart card is returned by this method within
         * the <CODE>ResponseAPDU</CODE> object
         * @param apdu The command APDU to be sent to the smart card
         * @return The response APDU returned from the card. <CODE>null</CODE> if none available.
         * @throws Exception if a communication error or timeout occurred
        public byte[] exchangeAPDU( byte[] sendData ) throws java.io.IOException{
            System.out.println("Send Data:"+SmartCardIOAccessor.getHexString(sendData));
            final boolean select = isSelect(sendData);
            byte[] dataWithChecksum;
            if(select) {
                dataWithChecksum = new byte[ sendData.length ];
                System.arraycopy(sendData, 0, dataWithChecksum, 0, sendData.length);
            else {
                dataWithChecksum = new byte[ sendData.length + 2];
                System.arraycopy(sendData, 0, dataWithChecksum, 0, sendData.length-1);
                dataWithChecksum[dataWithChecksum.length-1] = sendData[sendData.length-1];
                int Lc = dataWithChecksum[4];
                short csum = 0;
                for(short n = 5; n<Lc+5; ++n) {
                    csum += sendData[n];
                dataWithChecksum[Lc+5] = (byte) (csum>>8);
                dataWithChecksum[Lc+6] = (byte) (csum);
                dataWithChecksum[4] += 2;  // increase Lc
            if(debug2) {
                for(int i=0; i<dataWithChecksum.length;++i) {
                    System.out.print(Integer.toHexString(dataWithChecksum[i] & 0x00FF) + " ");
                System.out.println();
            byte[] receiveDataWithChecksum =  super.exchangeAPDU( dataWithChecksum );
            byte[] receiveData;
            if(debug2) {
                for(int i=0; i<receiveDataWithChecksum.length;++i) {
                    System.out.print(Integer.toHexString(receiveDataWithChecksum[i] & 0x00FF) + " ");
                System.out.println();
                System.out.println();
            if(!select)  // verify the checksum
                int Le = receiveDataWithChecksum.length - 2;   // 2 bytes reserved for SW
                if(debug2) {
                    System.out.println("Le=" + Le);
                short csum1 = 0;
                for(short n = 2; n<Le; ++n) {
                    csum1 += receiveDataWithChecksum[n];
                short csum2 = (short)
                (receiveDataWithChecksum[receiveDataWithChecksum.length - 2]<<8)
                |
                (receiveDataWithChecksum[receiveDataWithChecksum.length - 1] & 0x00FF)
                if(debug2) {
                    System.out.println("csum1=" + csum1);
                    System.out.println("csum2=" + csum2);
                System.out.println("csum1=" + Integer.toHexString(csum1));
                System.out.println("csum2=" + Integer.toHexString(csum2));
                if(csum1 != csum2) throw new java.io.IOException("Wrong checksum on returned data");
                receiveData = new byte[receiveDataWithChecksum.length-2];
                System.arraycopy(receiveDataWithChecksum, 0, receiveData, 0, receiveData.length);
            else {
                receiveData = new byte[receiveDataWithChecksum.length];
                System.arraycopy(receiveDataWithChecksum, 0, receiveData, 0, receiveData.length);
            if(debug2) {
                for(int i=0; i<receiveData.length;++i) {
                    System.out.print(Integer.toHexString(receiveData[i] & 0x00FF) + " ");
                System.out.println();
                System.out.println();
            System.out.println("Receive Data:"+SmartCardIOAccessor.getHexString(receiveData));
            return receiveData;
        boolean authenticateUser( short ID ){
            byte[] externalAuthCommand = new byte[8];
            externalAuthCommand[0] = CLA_AUTH;
            externalAuthCommand[1] = INS_AUTH;
            externalAuthCommand[4] = 2;  // Lc
            externalAuthCommand[5] = (byte)(ID>>8);
            externalAuthCommand[6] = (byte)ID;
            externalAuthCommand[7] = 0x7F;
            try {
                byte[] response = this.exchangeAPDU( externalAuthCommand );
                if(response[0] != (byte)0x90 || response[1] != 0x00) return false;
                else return true;
            }catch (Exception e){
                return false;
        private boolean isSelect(byte[] buffer) {
            if(buffer.length < 2) return false;
            if((buffer[0]&APDU_CMD_MASK)==CLA_ISO7816 && buffer[1]==INS_SELECT) {
                if(debug2) {
                    System.out.println("accessor: select command");
                return true;
            else {
                return false;
    }

  • Cannot find javax.ejb.CreateException fix classpath

    Hi Guys,
    I have made a Webdynpro in which I am using an EJB in the libraries of the project. When I access the classes of EJB I am getting a complie time error saying
    Cannot find class file for javax.ejb.CreateException. Fix the classpath then try rebuilding this project.
    Can you tell me how to fix this.
    Regards,
    Khusro Habib

    Hi,
    Guys I was able to solve this problem, by adding
    C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.tssap.ext.libs.j2ee_1.3.0\lib\ejb20.jar
    into the project properties>> in the Java Buildpath adding external jars.
    Khusro Habib

Maybe you are looking for

  • Is this a bug? master rowid value lost when saving on a master/detail form

    master/detail forms seem to lose the rowid after saving, if the unique identifier is set to ROWID to reproduce the problem: 1) create a master detail form on DEPT/EMP -- choose 'Managed by Database (ROWID)' on the 'Define Primary Key' page. -- do not

  • Asset: Error of Year End Closing and depreciation

    Experts, We are testing a scenerio in Quality Server. System was throwing error " You Can not post to asset in Company Code ABCD, fiscal year 2012". So we performed Fiscal year change "T-Code: AJRW" Now we have created asset in Year 2011, then posted

  • Why Address Book Smart Group Doesn't Work?

    I'm unable to find a solution to, or explination for, the following problem with Address Book and Smart Folders. I added a custom date field for my contacts. Set the date for one year and five days ago. Created Smart folder with condition: custom dat

  • How to stream music to car

    hi, i am trying to find out if i can stream music from my iphone4 via bluetooth to my car stereo or car speakers. the phone pairs up and works ok for calls

  • What is Report Document Format?

    Hi, I have seen "Report Document Format" in many Oracle Report Developer's job adverts. Following is an example. "Skills & Experience Required, Oracle Reports Developer - expert level, Report Document Format (RDF) - must have extensive knowledge in t