3 Replies Latest reply on Apr 20, 2012 7:53 PM by 664991

    WLST readDomain null pointer exception

    931025
      I am trying to read a domain, create template and then migrate the domain over. I am successfully able to invoke WLST, but when i try to read the domain using readDomain, it is throwing the following null pointer exception:

      wls:/offline> readDomain("/apps/apps9.1/demo")
      Traceback (innermost last):
      File "<console>", line 1, in ?
      File "/var/tmp/WLSTOfflineIni58116.py", line 83, in readDomain
      java.lang.NullPointerException
      at com.bea.plateng.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1464)
      at com.bea.plateng.domain.script.jython.WLScriptContext.readDomain(WLScriptContext.java:409)
      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:597)
      at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:160)
      at org.python.core.PyMethod.__call__(PyMethod.java:96)
      at org.python.core.PyObject.__call__(PyObject.java:270)
      at org.python.core.PyInstance.invoke(PyInstance.java:261)
      at org.python.pycode._pyx3.readDomain$17(/var/tmp/WLSTOfflineIni58116.py:83)
      at org.python.pycode._pyx3.call_function(/var/tmp/WLSTOfflineIni58116.py)
      at org.python.core.PyTableCode.call(PyTableCode.java:208)
      at org.python.core.PyTableCode.call(PyTableCode.java:267)
      at org.python.core.PyFunction.__call__(PyFunction.java:172)
      at org.python.pycode._pyx37.f$0(<console>:1)
      at org.python.pycode._pyx37.call_function(<console>)
      at org.python.core.PyTableCode.call(PyTableCode.java:208)
      at org.python.core.PyCode.call(PyCode.java:14)
      at org.python.core.Py.runCode(Py.java:1135)
      at org.python.core.Py.exec(Py.java:1157)
      at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:148)
      at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:89)
      at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:70)
      at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:44)
      at weblogic.management.scripting.WLST.main(WLST.java:178)
      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:597)
      at weblogic.WLST.main(WLST.java:29)

      java.lang.NullPointerException: java.lang.NullPointerException
      wls:/offline>

      I have checked my classpath and it does have all the required jar files in it as well. I am at a loss as to what is causing this error....any hints/pointers would be good....
        • 1. Re: WLST readDomain null pointer exception
          664991
          Hi


          This line is not correct

          readDomain("/apps/apps9.1/demo")

          It does not read a template

          is demo the template file, the it should be of the jar format so:

          readDomain("/apps/apps9.1/demo.jar")

          Is it a directory that contains a domain template then it should be

          readDomain("/apps/apps9.1/demo/wls.jar") ( this is an example, wls.jar is the base template shipped with WLS)


          regards


          Michel

          Edited by: Michel Schildmeijer on 17-apr-2012 15:59
          • 2. Re: WLST readDomain null pointer exception
            931025
            Thanks Michel. From what I read about WLST, readDomain() allows one to open/read a domain and not read a template.

            This is what I want to do:

            1. read the domain -- readDomain('/apps/apps9.1/demo')
            2. create a template -- writeTemplate('/apps/apps9.1/templates/demo.jar')
            3. use the template created in step 3 to create a domain on another machine -- createDomain('/apps/apps9.1/templates/demo.jar’,’/apps/apps10.3/demo_10’,’user’, ‘passwd’)

            The issue comes when I try to read in the domain in step 1, I am getting the null pointer error described in my post above.

            Thanks.
            • 3. Re: WLST readDomain null pointer exception
              664991
              you are correct, sorry
              do you have the full script?

              and keep the session open if the error occurs and look in the "/var/tmp/WLSTOfflineIni58116.py to look at the line about which it is complaining

              could be a syntax error in your script...did you copy and paste it into a script or typed it?