Bugs item #689653, was opened at 2003-02-19 15:10
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=689653&group_id=22866
Category: JBossMX
Group: v3.2
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Muruga Chinnananchi (muruga)
>Assigned to: Scott M Stark (starksm)
Summary: Dynamic Class Loading issue
Initial Comment:
Problem Description:
----------------
Dynamically generated classes (while running jboss
server) that are placed under C:/classes/ directory
is not visible to the war file which is deployed
under server/default/deploy/ directory.
My Configuration:
--------------
Version: 3.2 RC 2.0 (with bundled Jetty)
Platform: Windows 2000
Jdk: 1.3.1_02
Steps to reproduce:
---------------
1. Create a classes directory under c:/
2. Add the classes directory to the conf/jboss-
service.xml <classpath>
<classpath codebase="file:/C:/classes/" />
3. Start the jboss server in default mode ( run.bat)
4. Put the attached myapp.war file in the
default/deploy directory
5. Copy and Paste the following content in
MyClass.java and compile it and put it under
c:/classes directory.
package com.mycom;
public class MyClass
{
private String data;
public MyClass()
{
data = "foooo";
}
public String getData( )
{
return data;
}
}
6. Try invoking the MyApp war like below
http://localhost:8080/myapp/
7. You will see ClassDefNotFound printStackTrace
on the dos shell.
2003-02-19 14:32:46,078 WARN
[org.jboss.jbossweb] WARNING: Exception
for /myapp/
java.lang.NoClassDefFoundError:
com/mycom/MyClass
at java.lang.Class.newInstance0(Native
Method)
at java.lang.Class.newInstance
(Class.java:237)
at
org.apache.jasper.servlet.JspServletWrapper.getServl
et(JspServletWrapper.java:146)
at
org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:189)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:295)
at
org.apache.jasper.servlet.JspServlet.service
(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle
(ServletHolder.java:360)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dis
patch(WebApplicationHandler.java:280)
at
org.mortbay.jetty.servlet.Dispatcher.dispatch
(Dispatcher.java:194)
at
org.mortbay.jetty.servlet.Dispatcher.forward
(Dispatcher.java:129)
at
org.mortbay.jetty.servlet.Default.handleGet
(Default.java:239)
at
org.mortbay.jetty.servlet.Default.service
(Default.java:153)
at javax.servlet.http.HttpServlet.service
(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle
(ServletHolder.java:360)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dis
patch(WebApplicationHandler.java:280)
at
org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:553)
at org.mortbay.http.HttpContext.handle
(HttpContext.java:1656)
at
org.mortbay.jetty.servlet.WebApplicationContext.ha
ndle(WebApplicationContext.java:549)
at org.mortbay.http.HttpContext.handle
(HttpContext.java:1606)
at org.mortbay.http.HttpServer.service
(HttpServer.java:862)
at org.jboss.jetty.Jetty.service
(Jetty.java:497)
at
org.mortbay.http.HttpConnection.service
(HttpConnection.java:752)
at
org.mortbay.http.HttpConnection.handleNext
(HttpConnection.java:916)
at
org.mortbay.http.HttpConnection.handle
(HttpConnection.java:769)
at
org.mortbay.http.SocketListener.handleConnection
(SocketListener.java:202)
at org.mortbay.util.ThreadedServer.handle
(ThreadedServer.java:289)
at
org.mortbay.util.ThreadPool$PoolThread.run
(ThreadPool.java:455)
----------------------------------------------------------------------
>Comment By: Scott M Stark (starksm)
Date: 2003-02-19 22:52
Message:
Logged In: YES
user_id=175228
The only time this happens is if the class is not under the
classes directory when the war starts. If it is, this runs fine. If
the class is not there at startup and moved in latter this error
occurs.
Obviously the jsp compiler sees this class since a servlet is
being created, but the URLClassLoader has apparently
already determined that the directory does not contain the
class and this result is cached. This is not something we will
change anytime in the near future. Allowing classes to be
added is one thing that might be supported at some future
time, but its not a priority.
----------------------------------------------------------------------
Comment By: Muruga Chinnananchi (muruga)
Date: 2003-02-19 15:27
Message:
Logged In: YES
user_id=81331
Here is the MyClass.java source file!
----------------------------------------------------------------------
Comment By: Muruga Chinnananchi (muruga)
Date: 2003-02-19 15:25
Message:
Logged In: YES
user_id=81331
If you want you can just copy the attached
MyClass.class to your c:/classes directory.
----------------------------------------------------------------------
Comment By: Muruga Chinnananchi (muruga)
Date: 2003-02-19 15:12
Message:
Logged In: YES
user_id=81331
Here is the attachment.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=689653&group_id=22866
-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development