5 Replies Latest reply on Jul 16, 2013 8:04 AM by lith

    wlappc - error in finding weblogic.Home

    685087
      I have inherited an ant build script and am trying to work through different issues with the script so that we can use Hudson to perform automated builds and deploys. The build script executes fine when run from the command prompt, but it does not build inside of Hudson or Eclipse.

      Please feel free to ask if you need additional information.


      System Information:
      Weblogic 9.2
      Ant 1.7.0

      Ant Task:
           <wlappc source="${classes.ejb.dir}" output="${serverjars.dir}/ejbs/${project.name}_ejb.jar"
                classpath="${appserver.lib.dir}/weblogic.jar:${lib.dir}/log4j-1.2.8.jar:${appserver.lib.dir/webservices.jar:${commonjars.dir}/pojos/common.jar:${classes.dir}:${lib.dir}/xbean.jar:${lib.dir}/cs-xmltypes.jar"/>

      Error:
      [wlappc] <Feb 13, 2009 4:47:20 PM CST> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile your application. Recompile with the -verbose option for more details. Please see the error message(s) below.>



      BUILD FAILED

      C:\workspaces\IPS\project\build.xml:265: weblogic.utils.compiler.ToolFailureException: error in finding weblogic.Home

           at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:299)

           at weblogic.ant.taskdefs.j2ee.Appc.privateExecute(Appc.java:250)

           at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:159)

           at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

           at sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:585)

           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)

      Caused by: weblogic.utils.compiler.ToolFailureException: error in finding weblogic.Home

           at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:53)

           at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)

           at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)

           at weblogic.application.compiler.Appc.runBody(Appc.java:166)

           at weblogic.utils.compiler.Tool.run(Tool.java:158)

           at weblogic.utils.compiler.Tool.run(Tool.java:115)

           at weblogic.application.compiler.Appc.main(Appc.java:177)

           at weblogic.appc.main(appc.java:14)

           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:585)

           at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:290)

           ... 18 more

      Caused by: java.lang.RuntimeException: error in finding weblogic.Home

           at weblogic.Home.getInstance(Home.java:90)

           at weblogic.Home.getPath(Home.java:96)

           at weblogic.ejb.container.persistence.InstalledPersistence.setInstallationLocation(InstalledPersistence.java:299)

           at weblogic.ejb.container.persistence.InstalledPersistence.initialize(InstalledPersistence.java:134)

           at weblogic.ejb.container.persistence.InstalledPersistence.getInstalledType(InstalledPersistence.java:114)

           at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.getPersistenceType(MBeanDeploymentInfoImpl.java:684)

           at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(MBeanDeploymentInfoImpl.java:629)

           at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:221)

           at weblogic.ejb.container.ejbc.EJBCompiler.getStandAloneDeploymentInfo(EJBCompiler.java:1339)

           at weblogic.ejb.container.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:162)

           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:475)

           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:435)

           at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:295)

           at weblogic.application.compiler.EJBCompiler.compile(EJBCompiler.java:96)

           at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:118)

           at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)

           at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)

           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)

           at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)

           ... 29 more

      --- Nested Exception ---

      weblogic.utils.compiler.ToolFailureException: error in finding weblogic.Home

           at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:53)

           at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)

           at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)

           at weblogic.application.compiler.Appc.runBody(Appc.java:166)

           at weblogic.utils.compiler.Tool.run(Tool.java:158)

           at weblogic.utils.compiler.Tool.run(Tool.java:115)

           at weblogic.application.compiler.Appc.main(Appc.java:177)

           at weblogic.appc.main(appc.java:14)

           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:585)

           at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:290)

           at weblogic.ant.taskdefs.j2ee.Appc.privateExecute(Appc.java:250)

           at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:159)

           at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)

           at sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:585)

           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)

      Caused by: java.lang.RuntimeException: error in finding weblogic.Home

           at weblogic.Home.getInstance(Home.java:90)

           at weblogic.Home.getPath(Home.java:96)

           at weblogic.ejb.container.persistence.InstalledPersistence.setInstallationLocation(InstalledPersistence.java:299)

           at weblogic.ejb.container.persistence.InstalledPersistence.initialize(InstalledPersistence.java:134)

           at weblogic.ejb.container.persistence.InstalledPersistence.getInstalledType(InstalledPersistence.java:114)

           at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.getPersistenceType(MBeanDeploymentInfoImpl.java:684)

           at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeBeanInfos(MBeanDeploymentInfoImpl.java:629)

           at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:221)

           at weblogic.ejb.container.ejbc.EJBCompiler.getStandAloneDeploymentInfo(EJBCompiler.java:1339)

           at weblogic.ejb.container.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:162)

           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:475)

           at weblogic.ejb.container.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:435)

           at weblogic.application.compiler.AppcUtils.compileEJB(AppcUtils.java:295)

           at weblogic.application.compiler.EJBCompiler.compile(EJBCompiler.java:96)

           at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:118)

           at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:43)

           at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)

           at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)

           at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)

           ... 29 more
        • 1. Re: wlappc - error in finding weblogic.Home
          david.karr
          First of all, it's always a good idea to learn how to search the internet for issues you run into. In this case, Googling for the exact string (in quotes): "error in finding weblogic.Home" will find all the people who've run into the same problem you have. Several of these are duplicates of the same instance of the problem (different mailing list archive viewers).

          I would suggest the following:

          * Putting weblogic.jar in the classpath value of "wlappc" probably does nothing, but you should verify that once you get this working.
          * In Eclipse, you'll likely need to add the path to the weblogic.jar file to the Build Path of the project. You'll probably have to do something similar for Hudson.
          * Setting the environment variable "WEBLOGIC_HOME" to the root of the "weblogic" directory (this may not be called "weblogic" in all versions of WebLogic, like "wlserver_10.3" in WL 10.3).
          • 2. Re: wlappc - error in finding weblogic.Home
            683991
            Hi Joe,

            The Home.java actually looks for home directory of wls, and this is done in two ways.

            1) It try to get the location using System.getProperty("weblogic.home");
            2) From classpath it takes the location of weblogic.jar and chop it to home directory.

            My understanding is, you forgot to keep the weblogic.jar in classpath.

            The other alternative is set ANT_OPTS=-Dweblogic.home="c:\bea..."

            Thanks,
            Tanmoy Roy
            • 3. Re: wlappc - error in finding weblogic.Home
              760257
              Use ant supplied by Weblogic. It doesn't guarantee other custom ant tasks.
              • 4. Re: wlappc - error in finding weblogic.Home
                938087
                The ANT_OPTS=-Dweblogic.home="C:\Oracle\wlserver_10.3" setting got me past the problem. Thanks!
                • 5. Re: wlappc - error in finding weblogic.Home
                  lith

                  I'm not using Ant, but based on your answer I tried java -Dweblogic.home=<path> -jar <jar>, which did work.

                   

                   

                  Thanks!

                   

                   

                  lith