0 Replies Latest reply: Dec 13, 2011 3:53 AM by user2652343 RSS

    Unable to build example JPF application  in Ant

    user2652343
      (sorry to post this in several forums - this issue cuts across WLP, WLS, OEPE, WLS Ant tools etc)

      I'm investigating upgrading a large legacy WLP 8.1 app, and hit an issue with JPF and the wlcompile Ant task,
      so I'm attempting to create a simple hello-world JPF app and see if I can get that to compile. Unfortunately,
      to date I've only hit the same issue again.

      I'm running WLP and WLS 10.3.2, and in a brand new Portal web project I add a very simple page flow as follows:
      package example;
      
      import javax.servlet.http.HttpSession;
      import org.apache.beehive.netui.pageflow.PageFlowController;
      import org.apache.beehive.netui.pageflow.annotations.Jpf;
      
      @Jpf.Controller(simpleActions = { @Jpf.SimpleAction(name = "begin", path = "index.jsp") })
      public class ExampleController extends PageFlowController {
           private static final long serialVersionUID = 1L;
      
           /**
            * Callback that is invoked when this controller instance is created.
            */
           @Override
           protected void onCreate() {
           }
      
           /**
            * Callback that is invoked when this controller instance is destroyed.
            */
           @Override
           protected void onDestroy(HttpSession session) {
           }
      }
      I then use a combination of Eclipse (Export->Ant Build files) - which creates a build.xml with all the classpath set ok but only using javac,
      and weblogic.XMLBuildGen - which creates a build.xml without the classpath set but using wlcompile.

      I'm expecting wlcompile to process the above and generate some JPF configuration files (corresponding to the annotations), as well as compiling the
      Java code itself. However I get:
      compile:
      [wlcompile] [JAM] Error: unexpected exception thrown:
      [wlcompile] com.bea.util.jam.internal.javadoc.JavadocParsingException: Parsing failure in C:\dev\11g-workspace\blank-11g-portal-web\src\exampleExampleController.java at line 8.  Most likely, an annotation is declared whose type has not been imported.
      [wlcompile]     at com.bea.util.jam.internal.javadoc.JavadocTigerDelegateImpl_150.getAnnotationTypeFor(JavadocTigerDelegateImpl_150.java:410)
      [wlcompile]     at com.bea.util.jam.internal.javadoc.JavadocTigerDelegateImpl_150.extractAnnotations(JavadocTigerDelegateImpl_150.java:176)
      [wlcompile]     at com.bea.util.jam.internal.javadoc.JavadocTigerDelegateImpl_150.extractAnnotations(JavadocTigerDelegateImpl_150.java:152)
      [wlcompile]     at com.bea.util.jam.internal.javadoc.JavadocClassBuilder.addAnnotations(JavadocClassBuilder.java:404)
      [wlcompile]     at com.bea.util.jam.internal.javadoc.JavadocClassBuilder.populate(JavadocClassBuilder.java:216)
      [wlcompile]     at com.bea.util.jam.internal.elements.ClassImpl.ensureLoaded(ClassImpl.java:725)
      [wlcompile]     at com.bea.util.jam.internal.elements.ClassImpl.getAnnotation(ClassImpl.java:394)
      [wlcompile]     at weblogic.application.utils.AnnotationDetector.hasAnnotation(AnnotationDetector.java:172)
      [wlcompile]     at weblogic.application.utils.AnnotationDetector.hasAnnotatedSources(AnnotationDetector.java:163)
      [wlcompile]     at weblogic.ejb.spi.EJBJarUtils.hasEJBSources(EJBJarUtils.java:35)
      [wlcompile]     at weblogic.ant.taskdefs.build.module.EJBModuleFactory.claim(EJBModuleFactory.java:48)
      [wlcompile]     at weblogic.ant.taskdefs.build.module.ModuleFactory.createModules(ModuleFactory.java:76)
      [wlcompile]     at weblogic.ant.taskdefs.build.Application.build(Application.java:59)
      [wlcompile]     at weblogic.ant.taskdefs.build.WLCompileTask.privateExecute(WLCompileTask.java:194)
      [wlcompile]     at weblogic.ant.taskdefs.build.WLCompileTask.execute(WLCompileTask.java:160)
      [wlcompile]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [wlcompile]     at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      [wlcompile]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [wlcompile]     at java.lang.reflect.Method.invoke(Method.java:597)
      [wlcompile]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      [wlcompile]     at org.apache.tools.ant.Task.perform(Task.java:348)
      [wlcompile]     at org.apache.tools.ant.Target.execute(Target.java:357)
      [wlcompile]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [wlcompile]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
      [wlcompile]     at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      [wlcompile]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [wlcompile]     at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
      [wlcompile]     at org.apache.tools.ant.Main.runBuild(Main.java:758)
      [wlcompile]     at org.apache.tools.ant.Main.startAnt(Main.java:217)
      [wlcompile]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
      [wlcompile]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
      [wlcompile] [JAM] Warning: failed to resolve class PageFlowController
          [javac] Compiling 1 source file to C:\tmp\blank-11g-portal-web\APP-INF\classes
      As you can see above, the Annotations do have imports and are included in .jar files
      that are on the classpath for wlcompile (I've tried both the compile classpath and the
      classpath used by the wlcompile task itself).

      The code compilation is successful, suggesting this is an issue with the JAM tool.

      I can see from Google searches that others have hit the same issue, with no resolution
      suggested.

      Any help gratefully received!