1

我在 EJB3 遇到了一个奇怪的问题。已部署和 EJB3,并且正在尝试从已部署的实例访问业务方法。执行查找时出现以下错误:

  • UserAuthenticationRemote 是远程 i/face
  • UserAuthenticationBean 是 Bean

代码(失败):

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

错误日志:

    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)

请帮忙!

谢谢,山姆

4

2 回答 2

2

问题仅在于 jar 文件。所以删除你项目中的所有 jar 文件并从 jboss-6.0.0.Final\client 文件夹中获取 jar 文件,这是你正在运行的服务器并作为类路径放置,然后它会运行良好

于 2011-07-28T05:33:17.353 回答
2

导入 jbossall-client.jar 并从你的类路径中删除 jboss-client.jar

于 2012-11-27T14:44:59.563 回答