This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes WebLogic 8.1 JSP precompilation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "WebLogic 8.1 JSP precompilation problem" Watch "WebLogic 8.1 JSP precompilation problem" New topic
Author

WebLogic 8.1 JSP precompilation problem

Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
Hi,

We use the wlappc Ant task to precompile each of our application's JSPs on Weblogic 8.1 like so:


This works correctly on two of our applications, however the third fails with the following error:
precompile-jsps.xml:16: weblogic.utils.compiler.ToolFailureException: [J2EE:160119]Appc is unable to process the file '/home/gareth/software/bea/user_projects/domains/mydomain/applications/myapp'. The following error occurred:

The class "com.mycompany.myapp.ApplicationContextListener" referred by the descriptor element "listener" is not found. Please ensure that it is present in the classpath.

at weblogic.servlet.internal.dd.compliance.ComplianceUtils.checkCompliance(ComplianceUtils.java:47)
at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:139)
at weblogic.appc.compileWAR(appc.java:866)
at weblogic.appc.compileWAR(appc.java:822)
at weblogic.appc.compileInput(appc.java:472)
at weblogic.appc.runBody(appc.java:186)
at weblogic.utils.compiler.Tool.run(Tool.java:192)
at weblogic.utils.compiler.Tool.run(Tool.java:147)
at weblogic.appc.main(appc.java:1037)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
at weblogic.ant.taskdefs.j2ee.Appc.privateExecute(Appc.java:199)
at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

weblogic.servlet.internal.dd.compliance.ComplianceException: The class "com.mycompany.myapp.ApplicationContextListener" referred by the descriptor element "listener" is not found. Please ensure that it is present in the classpath.
at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:75)
at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:81)
at weblogic.servlet.internal.dd.compliance.WebAppDescriptorComplianceChecker.validateListeners(WebAppDescriptorComplianceChecker.java:107)
at weblogic.servlet.internal.dd.compliance.WebAppDescriptorComplianceChecker.check(WebAppDescriptorComplianceChecker.java:73)
at weblogic.servlet.internal.dd.compliance.ComplianceUtils.checkCompliance(ComplianceUtils.java:45)
at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:139)
at weblogic.appc.compileWAR(appc.java:866)
at weblogic.appc.compileWAR(appc.java:822)
at weblogic.appc.compileInput(appc.java:472)
at weblogic.appc.runBody(appc.java:186)
at weblogic.utils.compiler.Tool.run(Tool.java:192)
at weblogic.utils.compiler.Tool.run(Tool.java:147)
at weblogic.appc.main(appc.java:1037)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
at weblogic.ant.taskdefs.j2ee.Appc.privateExecute(Appc.java:199)
at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

--------------- nested within: ------------------
weblogic.utils.compiler.ToolFailureException: [J2EE:160121]Errors encountered while compiling module '/home/gareth/software/bea/user_projects/domains/mydomain/applications/myapp':

The class "com.mycompany.myapp.ApplicationContextListener" referred by the descriptor element "listener" is not found. Please ensure that it is present in the classpath.
- with nested exception:
[
The class "com.mycompany.myapp.ApplicationContextListener" referred by the descriptor element "listener" is not found. Please ensure that it is present in the classpath.
]
at weblogic.appc.compileWAR(appc.java:837)
at weblogic.appc.compileInput(appc.java:472)
at weblogic.appc.runBody(appc.java:186)
at weblogic.utils.compiler.Tool.run(Tool.java:192)
at weblogic.utils.compiler.Tool.run(Tool.java:147)
at weblogic.appc.main(appc.java:1037)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
at weblogic.ant.taskdefs.j2ee.Appc.privateExecute(Appc.java:199)
at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:124)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
- with nested exception:
[weblogic.utils.compiler.ToolFailureException: [J2EE:160121]Errors encountered while compiling module '/home/gareth/software/bea/user_projects/domains/mydomain/applications/myapp':

The class "com.mycompany.myapp.ApplicationContextListener" referred by the descriptor element "listener" is not found. Please ensure that it is present in the classpath.
- with nested exception:
[
The class "com.mycompany.myapp.ApplicationContextListener" referred by the descriptor element "listener" is not found. Please ensure that it is present in the classpath.
]]


The ApplicationContextListener.class is in the appropriate location in the src.dir WEB-INF/clases folder, as with the other two applications, so why would the classpath suddenly not be correct for this app?

ALSO if I set the JAVA_HOME environment variable to point to a Java5 JDK the script precompiles correctly. Only the Java 1.4 JDK has this problem...

Any ideas?
Gareth Western
Ranch Hand

Joined: Apr 07, 2004
Posts: 45
The fact that it worked for Java 5 was the clue I needed.

The problem was that the application's class files had not been retrotranslated from Java 5. After retrotranslation the application precompiled correctly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebLogic 8.1 JSP precompilation problem