0 Replies Latest reply: Jan 20, 2014 6:32 AM by b594944d-7c66-481b-a30a-c3816aa1e3a4 RSS

    mofcomp on Solaris 10u11 fails with NullPointerException

    b594944d-7c66-481b-a30a-c3816aa1e3a4

      I created a VirtualBox VM of Solaris 10 1/13 (update 11) using the x86 ISO from http://www.oracle.com/technetwork/server-storage/solaris10/downloads/index.html.

      I'm trying to get one of the sample WBEM providers to work by following /usr/demo/wbem/provider/jni/README. Here are the steps I performed:-

      ==============================
      # java -version
      java version
      "1.6.0_37"
      Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
      Java HotSpot(TM) Client VM (build 20.12-b01, mixed mode, sharing)
      ==============================
      # cd /usr/demo/wbem/provider/jni
      ==============================
      # CLASSPATH=.:/usr/sadm/lib/wbem.jar:/usr/sadm/lib/xml.jar:/usr/sadm/lib/wbem/sunwbem.jar:/usr/sadm/lib/wbem/extension
      ==============================
      # whoami
      root
      ==============================
      # cp -f * /usr/sadm/lib/wbem
      ==============================
      # ls
      NativeProvider.class  Native_Example.h README
      NativeProvider.java  Native_Example.java libnative.so
      Native_Example.class  Native_Example.mof  native.c
      ==============================
      # /usr/sadm/bin/mofcomp /usr/demo/wbem/provider/jni/Native_Example.mof -u root -p password
      CIM_ERR_FAILED
      :Other Exception: java.lang.NoClassDefFoundError: com/sun/trustedsolaris/TsolAttrs
      Warning: MOF compiler failed /usr/demo/wbem/provider/jni/Native_Example.mof -u root -p password ; EXITVALUE=1
      ==============================
      # gedit /usr/sadm/bin/mofcomp
      ==============================
      # # Added ':/usr/sadm/lib/smc/lib/TrustedSolaris.jar' to the end of the CLASSSPATH declared on line 86 of /usr/sadm/bin/mofcomp
      ==============================
      # /usr/sadm/bin/mofcomp /usr/demo/wbem/provider/jni/Native_Example.mof -u root -p password
      java
      .lang.NullPointerException
      Warning: MOF compiler failed /usr/demo/wbem/provider/jni/Native_Example.mof -u root -p password ; EXITVALUE=1
      ==============================
      # # Downloaded & installed JDK 1.2.2_017 from <http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase12-419414.html#7740-j2sdk-1.2.2_017-oth-JPR>
      ==============================
      # JAVA_HOME=/usr/jdk/instances/jdk1.2.2
      ==============================
      # /usr/sadm/bin/mofcomp /usr/demo/wbem/provider/jni/Native_Example.mof -u root -p password
      java
      .lang.NullPointerException
      Warning: MOF compiler failed /usr/demo/wbem/provider/jni/Native_Example.mof -u root -p password ; EXITVALUE=1
      ==============================

      How do I get mofcomp to work? I'm developing a WBEM provider of my own based on this sample. Running wbemconfig fails with a CIMException:-

      # /usr/sadm/lib/wbem/wbemconfig
      CIM_ERR_INVALID_NAMESPACE
      :
      \root\cimv2
      java
      .lang.reflect.InvocationTargetException
        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 com
      .sun.wbem.bootstrap.StartWBEMServices.startWBEM(StartWBEMServices.java:204)
        at com
      .sun.wbem.bootstrap.StartWBEMServices.main(StartWBEMServices.java:216)
      Caused by: CIM_ERR_INVALID_NAMESPACE:
      \root\cimv2
        at com
      .sun.wbem.repository.PSRlogImpl.getNameSpaceEntryFromMap(PSRlogImpl.java:1770)
        at com
      .sun.wbem.repository.PSRlogImpl.enumInstancesDo(PSRlogImpl.java:1695)
        at com
      .sun.wbem.repository.PSRlogImpl.enumInstances(PSRlogImpl.java:1675)
        at com
      .sun.wbem.repository.PSRlogImpl.enumerateInstances(PSRlogImpl.java:1618)
        at com
      .sun.wbem.repository.PSRlogImpl.enumerateInstances(PSRlogImpl.java:1604)
        at com
      .sun.wbem.cimom.CIMOMImpl.enumerateInstanceNames(CIMOMImpl.java:3780)
        at com
      .sun.wbem.cimom.CIMOMImpl.updateClasspath(CIMOMImpl.java:4158)
        at com
      .sun.wbem.cimom.CIMOMImpl.firstTimeInit(CIMOMImpl.java:729)
        at com
      .sun.wbem.cimom.CIMOMImpl.<init>(CIMOMImpl.java:263)
        at com
      .sun.wbem.cimom.WBEMServices.StartCIMOM(WBEMServices.java:28)
        
      ... 6 more