[jboss-user] [EJB 3.0] - ClassCastException on JNDI lookup
morisona
do-not-reply at jboss.com
Thu May 31 14:39:50 EDT 2007
There is reason to beieve that this problem is easy (http://jira.jboss.com/jira/browse/EJBTHREE-456), but I have searched the forum and can not find exactly the same situation.
The easiest way to reproduce it is to take the calcualtor.jsp from the EJB3Trail, and put it in a seperate war along with trail.slsb.Calculator.class. I then get
| 20:12:40,859 ERROR [STDERR] java.lang.ClassCastException: $Proxy136
| 20:12:48,437 ERROR [STDERR] at org.apache.jsp.calculator_jsp.jspInit(calculator_jsp.java:19)
| 20:12:48,437 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:78)
| 20:12:48,437 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:155)
|
The relevent bit of code in the jsp is:
| InitialContext ctx = new InitialContext();
| cal = (Calculator) ctx.lookup(
| "EJB3Trail/StatelessCalculator/local");
|
On the JMX JNDI screen I have:
| +- EJB3Trail (class: org.jnp.interfaces.NamingContext)
| ........
| | +- StatelessCalculator (class: org.jnp.interfaces.NamingContext)
| | | +- local (proxy: $Proxy136 implements interface trail.slsb.Calculator,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
|
Any help and I would be infinitely greatful.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050280#4050280
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050280
More information about the jboss-user
mailing list