File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassCastException: java.naming.Reference can not be cast to Ejb

 
Vish Shukla
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using JBoss as EJB container and my web application is deployed in the Tomcat in same machine. I am trying to call remote stateless session bean method. But context.lookup("") returns object of type java.naming.Reference rather than business interface. I think something is going horribly wrong here. Please help what can be the possible issue?

In one of the forum I read that it may be because of unnecessary jars present in the classpath. I am having following jars in the class path.
  • jboss-logging-spi.jar
  • jnp-client.jar
  • jbossall-client.jar


  • I also tried by removing jnp-client.jar but in vain. Here is my client code.



    Thanks in advance.
     
    Vish Shukla
    Ranch Hand
    Posts: 111
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello all,

    Got this issue solved. This helped me.
    http://www.coderanch.com/t/454071/EJB-Certification-SCBCD/certification/javax-naming-Reference-cannot-cast#2022716
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic