You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/02/02 15:44:32 UTC

DO NOT REPLY [Bug 33358] New: - jasper2 bug because classloader-problems

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33358>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33358

           Summary: jasper2 bug because classloader-problems
           Product: Tomcat 5
           Version: 5.0.30
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: marco@morca.de


hi there, 
 
i think the patch of bugreport 
http://issues.apache.org/bugzilla/show_bug.cgi?id=32330 is not correct. 
jspc get an error if i compile jsp's with struts-el tags like 
<html-el:option>. 
following stacktrace is coming: 
  [jasper2] SCHWERWIEGEND: MessageResourcesFactory.createFactory 
  [jasper2] java.lang.ClassNotFoundException: 
org.apache.struts.util.PropertyMessageResourcesFactory 
  [jasper2]     at java.net.URLClassLoader$1.run(URLClassLoader.java:199) 
  [jasper2]     at java.security.AccessController.doPrivileged(Native Method) 
  [jasper2]     at java.net.URLClassLoader.findClass(URLClassLoader.java:187) 
  [jasper2]     at java.lang.ClassLoader.loadClass(ClassLoader.java:289) 
  [jasper2]     at java.lang.ClassLoader.loadClass(ClassLoader.java:235) 
  [jasper2]     at 
org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:117) 
  [jasper2]     at 
org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:148) 
  [jasper2]     at 
org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:493) 
  [jasper2]     at 
org.apache.struts.taglib.html.BaseHandlerTag.<clinit>(BaseHandlerTag.java:64) 
  [jasper2]     at java.lang.Class.forName0(Native Method) 
  [jasper2]     at java.lang.Class.forName(Class.java:141) 
  [jasper2]     at 
org.apache.strutsel.taglib.html.ELLinkTagBeanInfo.class$(ELLinkTagBeanInfo.java:46) 
  [jasper2]     at 
org.apache.strutsel.taglib.html.ELLinkTagBeanInfo.getPropertyDescriptors(ELLinkTagBeanInfo.java:46) 
  [jasper2]     at 
java.beans.Introspector.getTargetPropertyInfo(Introspector.java:459) 
  [jasper2]     at java.beans.Introspector.getBeanInfo(Introspector.java:372) 
  [jasper2]     at java.beans.Introspector.getBeanInfo(Introspector.java:144) 
  [jasper2]     at 
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3684) 
  [jasper2]     at 
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2102) 
  [jasper2]     at 
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1583) 
  [jasper2]     at 
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) 
  [jasper2]     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) 
  [jasper2]     at 
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) 
  [jasper2]     at 
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1689) 
  [jasper2]     at 
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441) 
  [jasper2]     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) 
  [jasper2]     at 
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) 
  [jasper2]     at 
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) 
  [jasper2]     at org.apache.jasper.compiler.Node$Root.accept(Node.java:456) 
  [jasper2]     at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) 
  [jasper2]     at 
org.apache.jasper.compiler.Generator.generate(Generator.java:3272) 
  [jasper2]     at 
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244) 
  [jasper2]     at 
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) 
  [jasper2]     at org.apache.jasper.JspC.processFile(JspC.java:805) 
  [jasper2]     at org.apache.jasper.JspC.execute(JspC.java:938) 
... 
in the source code of Jspc.java the finaly-block in the processFile method for 
resetting the classloader is wrong there. because 
it resets the classloader after the first file was processed. and any other 
jsp's, that uses 
the struts-el-tags (for example <html-el:option...) can not be compiled. i 
think the finaly-block belongs 
to the end of the execute-method with following change: 
        } finally { 
            if(originalClassLoader != null) { 
                Thread.currentThread().setContextClassLoader(originalClassLoader); 
                loader = null; // set to null!! 
            } 
        } 
where originalClassLoader is declared as instance variable as: 
private ClassLoader originalClassLoader = null; 
 
what's your opinion? 
 
marco

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org