This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

WebLogic 8.1 JSP precompilation problem  RSS feed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!