Bugs item #833558, was opened at 2003-10-31 03:06
Message generated for change (Comment added) made by juanmartinez
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=833558&group_id=22866

Category: None
Group: v3.2
>Status: Open
Resolution: None
Priority: 5
Submitted By: Juan Martinez (juanmartinez)
Assigned to: Nobody/Anonymous (nobody)
Summary: ClassCastException in NamingContext

Initial Comment:
Hi. 
 
I get a ClassCastException in NamingContext when I 
deploy the EAR file from Bug#809152 -- maybe this is a 
feature feature -- I would like to know why I get the 
exception: 
 
22:11:53,243 WARN  [NamingContext] Failed to connect 
to localhost:1099 
javax.naming.CommunicationException: Failed to connect 
to server localhost:1099 [Root exception is 
java.lang.ClassCastException] 
        at 
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:215) 
        at 
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1181) 
        at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514) 
        at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507) 
        at 
javax.naming.InitialContext.lookup(InitialContext.java:347) 
        at web.EJBServlet.doGet(EJBServlet.java:29) 
        at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:740) 
        at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
 
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
 
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 
        at 
org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
        at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) 
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
 
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) 
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
 
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) 
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) 
        at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) 
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781) 
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
 
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589) 
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) 
        at java.lang.Thread.run(Thread.java:534) 
Caused by: java.lang.ClassCastException 
        at 
org.jnp.interfaces.NamingContext.getServer(NamingContext.java:199) 
        ... 46 more 
 
Servlet output is: 
javax.naming.CommunicationException: Receive timed out 
[Root exception is java.net.SocketTimeoutException: 
Receive timed out] 
        at 
org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1115) 
        at 
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1192) 
        at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514) 
        at 
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507) 
        at 
javax.naming.InitialContext.lookup(InitialContext.java:347) 
        at web.EJBServlet.doGet(EJBServlet.java:29) 
 
I have tried with JBoss-3.2.2 and Branch_3_2; both 
have the same problem. 
 
When I do: "telnet localhost 1099" I get: 
Trying ::1... 
Connected to localhost. 
Escape character is '^]'. 
¬ísrjava.rmi.MarshalledObject|½ícü>IhashlocBytest[BobjBytesq~xpA­
Rur[B¬óTàxp%¬íthttp://0.0.0.0:8083/q~q~uq~Ĭísr 
org.jnp.server.NamingServer_Stubxr?java.rmi.server.RemoteStubéþÜÉáe?xrjava.rmi.server.RemoteObjectÓa´
 
                                                          
a3xpw8 
147.13.95.217Jlgø(·xConnection closed by foreign host.          
UnicastRef2 
 
The IP address is my machine address. 
 
If I replace all references from localhost to my 
machine name I get the same problems. 
 
nmap shows that the JBoss ports are open. 
 
I must be doing something wrong... 
 
Thanks in advance! 
 Juan 
 

----------------------------------------------------------------------

>Comment By: Juan Martinez (juanmartinez)
Date: 2003-11-10 02:17

Message:
Logged In: YES 
user_id=870070

I'm reopen this bug, since I found the follwing: 
 
Servlet-2.3 spec: 
9.5:...The web application class loader must be able to 
load classes from any of these archive files (WEB-INF/lib) 
 
J2EE-1.3 spec: 
8.2.1: 3d: A notable exception to this rule is JAR files 
located in the WEB-INF/lib directory of a web application. 
 
I've attached my updated bug.ear archive (source) such that 
you can easy try it. 
 
Targets: 
dist: *With* the jbossall-client.jar in WEB-INF/lib (fails) 
dist-without: *With out* the file (success) 
 
Web: 
http://localhost:8080/secure    (should work) 
http://localhost:8080/unsecure  (shouldn't work -- 
principal = null) 
http://localhost:8080/secure    (shouldn't work -- wrong 
password) 
 
I've tried the newest Branch_3_2 code. 
 
Hope this helps. 
 Juan 
 

----------------------------------------------------------------------

Comment By: Juan Martinez (juanmartinez)
Date: 2003-11-07 07:42

Message:
Logged In: YES 
user_id=870070

I still thinks it is a regression between the RC4 and the 
current Branch_3_2. 
 
It used to be possible to distribute an application (EAR) 
which contained the jbossall-client.jar file inside the WAR 
such that I could use the WAR file outside a JBoss 
environment. 
 
The remote object doesn't have a classloader and codebase 
registered with it -- so it may be a classloader issue. 
 
I get a lot of "New jmx UCL with url null" around the 
initialization of the bug.ear file -- I don't if this is 
the problem (maybe Scott has an idea). 
 
I havn't changed the default settings in JBoss other than 
added the two login-config.xml entries. 
 
The result is that my build.xml scripts has changed between 
the RC4 build and the Branch_3_2 build -- my code hasn't. 
 
Hope this gives an idea of my thoughts. 
 Juan 
 

----------------------------------------------------------------------

Comment By: Laurent Etiemble (letiemble)
Date: 2003-11-07 07:30

Message:
Logged In: YES 
user_id=437455

As it seems to work, I close the issue.



----------------------------------------------------------------------

Comment By: Juan Martinez (juanmartinez)
Date: 2003-11-05 07:04

Message:
Logged In: YES 
user_id=870070

I tried to remove the 
 
bug.ear/bug.war/WEB-INF/lib/jbossall-client.jar 
 
file from the archive, since it was a JBoss class that 
failed. 
 
And success -- the EAR file works perfectly now ! :) 
 Juan 
 

----------------------------------------------------------------------

Comment By: Juan Martinez (juanmartinez)
Date: 2003-11-05 06:00

Message:
Logged In: YES 
user_id=870070

I read the ClassLoading.pdf when I saw that the classloader 
for org.jnp.interfaces.Naming and the stub object was 
different (getClass().getClassLoader()). A good read btw. 
 
Below is the output from the displayClassInfo operation: 
 
org.jnp.interfaces.Naming Information 
Repository cache version: 
org.jnp.interfaces.Naming(ab444)[EMAIL PROTECTED] 
url=file:/home/jm/CVS/jboss/jboss-3.2/build/output/jboss-3.2.3RC1/server/default/tmp/deploy/tmp60911jboss-service.xml
 
,addedOrder=2} 
[EMAIL PROTECTED] 
url=file:/home/jm/CVS/jboss/jboss-3.2/build/output/jboss-3.2.3RC1/server/default/tmp/deploy/tmp60911jboss-service.xml
 
,addedOrder=2} 
[EMAIL PROTECTED] 
[EMAIL PROTECTED] 
....file:/home/jm/CVS/jboss/jboss-3.2/build/output/jboss-3.2.3RC1/bin/run.jar 
....file:/usr/local/jdk-1.4.2_02/lib/tools.jar 
[EMAIL PROTECTED] 
....file:/usr/local/jdk-1.4.2_02/jre/lib/ext/dnsns.jar 
....file:/usr/local/jdk-1.4.2_02/jre/lib/ext/sunjce_provider.jar 
....file:/usr/local/jdk-1.4.2_02/jre/lib/ext/ldapsec.jar 
....file:/usr/local/jdk-1.4.2_02/jre/lib/ext/localedata.jar 
++++CodeSource: 
(file:/home/jm/CVS/jboss/jboss-3.2/build/output/jboss-3.2.3RC1/server/default/lib/jnpserver.jar
 
) 
Implemented Interfaces: 
++interface java.rmi.Remote(161b0bc) 
++++ClassLoader: null 
++++Null CodeSource 
 
### Instance0 found in UCL: 
[EMAIL PROTECTED] 
url=file:/home/jm/CVS/jboss/jboss-3.2/build/output/jboss-3.2.3RC1/server/default/tmp/deploy/tmp60911jboss-service.xml
 
,addedOrder=2} 
 
I think that the 
 
 ClassLoader: null 
 Null CodeSource 
 
lines looks strange. 
 
I can generate the ucl.log if needed. 
 Juan 
 

----------------------------------------------------------------------

Comment By: Juan Martinez (juanmartinez)
Date: 2003-11-03 03:26

Message:
Logged In: YES 
user_id=870070

I spend the weekend looking into this issue, but didn't 
find a solution; the returned object is a 
org.jnp.server.NamingServer_Stub which implements 
org.jnp.interfaces.Naming. 
 
This should be correct, but the type cast still fails -- no 
idea why. 
 
I tried switching JDK to jdk-1.4.1_05 but that didn't help 
either. 
 
Finally I looked through my harddisk and found my old build 
[3.2.2RC4 (build: CVSTag=JBoss_3_2_2_RC4 
date=200309172341)] -- which I used to create bug#809152. 
This build still works on the tested machines (no 
ClassCadtException). 
 
So it must be a regression between this build and 
JBoss-3.2.2 and current Branch_3_2. 
 
Hope someone has an idea how to solve it. 
 Juan 
 

----------------------------------------------------------------------

Comment By: Juan Martinez (juanmartinez)
Date: 2003-10-31 06:23

Message:
Logged In: YES 
user_id=870070

A small update:  
1) The IP address in the telnet should be 127.0.0.1 -- I  
got two cases mixed  
2) Current output is on Linux with Sun 1.4.2_02  
3) Same problem with Win2000SP4 and Sun 1.4.2_02  
4) Linux machine is connected to Internet behind firewalls  
5) Win2000 is not connected to Internet  
  
Hopes this give you a better idea.  
 Juan  
 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=833558&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to