[jboss-user] [EJB 3.0] - Re: java.lang.ClassCastException: $Proxy79 getting conext

helloween0809 do-not-reply at jboss.com
Mon Dec 11 03:22:18 EST 2006


I met the same problem.

and the same code runs correctly in a java eclipse. 


============= the code ===================

public class MainFrame {
	
	public static void main(String[] args) throws Exception {

		Properties props = new Properties();
		
		props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
		props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
		props.setProperty("java.naming.provider.url", "localhost:1099");
		
		InitialContext initCtx = new InitialContext(props);
		
		Rankgrade rankgrade = (Rankgrade)initCtx.lookup("RankgradeBean/remote");
		
	}

}



=========== the excepiton ====================

16:16:28,064 WARN  [RequestProcessor] Unhandled Exception thrown: class java.lang.ClassCastException
16:16:28,064 ERROR [[action]] Servlet.service() for servlet action threw exception
java.lang.ClassCastException: $Proxy100
	at com.ufmobile.mstreet.rank.action.RankGradeAction.execute(RankGradeAction.java:57)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
	at java.lang.Thread.run(Thread.java:595)


========= the JNDI ===================

  +- StreetBean (class: org.jnp.interfaces.NamingContext)
  |   +- local (proxy: $Proxy92 implements interface com.ufmobile.mstreet.street.bo.Street,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
  |   +- remote (proxy: $Proxy91 implements interface com.ufmobile.mstreet.street.bo.Street,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
  +- RankplaceBean (class: org.jnp.interfaces.NamingContext)
  |   +- local (proxy: $Proxy75 implements interface com.ufmobile.mstreet.rank.bo.Rankplace,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
  |   +- remote (proxy: $Proxy73 implements interface com.ufmobile.mstreet.rank.bo.Rankplace,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
  +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)





View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992699#3992699

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992699



More information about the jboss-user mailing list