1

I am having a weird problem here with EJB3. Deployed and EJB3 and am trying to access the business method from the deployed instance. I get the following error when the lookup is executed:

  • UserAuthenticationRemote is the remote i/face
  • UserAuthenticationBean is the Bean

Code (which fails):

UserAuthenticationRemote remoteInterface = (UserAuthenticationRemote) context.lookup("UserAuthenticationBean/remote");

Error log:

    java.lang.ClassCastException: javax.naming.Reference cannot be cast to eds.enhancedqc.authentication.UserAuthenticationRemote 
            at        eds.enhancedqc.client.application.LoginDialog$3.doInBackground(LoginDialog.java:220)
            at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)

    Exception "java.lang.ClassNotFoundException: org.openide.loaders.DataObject"while constructing DataFlavor for: application/x-java-openide-dataobjectdnd; mask=1; class=org.openide.loaders.DataObject
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    Exception "java.lang.ClassNotFoundException: org.openide.loaders.DataObject"while constructing DataFlavor for: application/x-java-openide-dataobjectdnd; mask=1; class=org.openide.loaders.DataObject
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:619)

Please help!

Thanks, Sam

2
  • 1
    IMHO, you should take some time to write in good english and to format the code, maybe people will then have a look. PS: the error is weird, the client code looks ok, but what is org.openide.loaders.DataObject, why do you have a java.lang.ClassNotFoundException on this class? Sep 17, 2009 at 1:20
  • I figured the problem. The error was due to use of JBoss 5.0.1 lib/jar files, whereas I am on 5.1.0. I cleaned up the project dependencies and it worked. --- Abt bad English, I wrote it in a hurry and never meant to trouble anyone who's reading it. Afterall IMHO we are here to solve problems and not to write essays in Queens English :-) Sep 22, 2009 at 21:41

2 Answers 2

2

The problem is with the jar file only. so remove all the jar file form you project and take the jar file from jboss-6.0.0.Final\client folder, which is your running server and put as class path then it will run fine

2

import jbossall-client.jar and remove jboss-client.jar from your classpath

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.