4 Replies Latest reply: Jun 3, 2015 2:08 AM by Wouter Van Der Meiden RSS

xDB SOAP Web Service on version 10 - XHiveDriverIf.init() error with Map or HashMap

ryanrockets

I am trying to upgrade the xDB SOAP Web Service written & released for xDB version 9 to work on version 10.

 

https://community.emc.com/docs/DOC-4479

 

I know the following:

 

On line #66 of method getXhiveSession() in the class XhiveSoapServerSession:

XhiveDriverIf newDriver = XhiveDriverFactory.getDriver();

if (!newDriver.isInitialized()) {

  newDriver.init(getDriverCacheSizeConstant());

}

the call to init() on an instance of the XhiveDriverIf, just as described here:

 

 

produces the following error stack trace in Tomcat 6:
SEVERE: com/google/common/collect/Maps
java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at com.xhive.kernel.bt.<init>(xdb:51)
at com.xhive.kernel.ch.a(xdb:97)
at com.xhive.core.r.a(xdb:253)
at com.xhive.core.r.init(xdb:281)
at com.xhive.core.r.init(xdb:297)
at com.xhive.core.r.init(xdb:291)
at com.xhive.soap.server.XhiveSoapServerSession.getXhiveSession(Unknown Source)
at com.xhive.soap.server.XhiveSoapServerSession.getServerSessionById(Unknown Source)
at com.xhive.soap.server.XhiveSoapServerSession.connect(Unknown Source)

 

Now, I can't look at the source code of xDB itself to make sure there is an "import com.google.common.collect.Maps" or similar. I am wondering if it is the load order of Tomcat.

 

 

I noticed that the google-collect.jar and other jar files are now organized in subdirectories of {xdb.lib}.
I modified the build.xml (actually common.xml) with some directory wildcards, like this:

 

    <path id="jaxws.classpath">
      <fileset dir="${jaxws.dir}">
        <include name="lib/**/*.jar" />
      </fileset>
    </path>

 

which also gets these copied over to the 'webapps/xhive-soap/WEB-INF/lib' directory on "ant deploy", but that is not solving the problem.

 

Any help would be most appreciated. I'm actually not a Java guy - I'm just tackling this because our enterprise application needs to talk to xDB.

 

~RyanR>
  • 1. Re: xDB SOAP Web Service on version 10 - XHiveDriverIf.init() error with Map or HashMap
    Wouter Van Der Meiden

    Hi,

     

    in xDB 9, all the jars are in XHIVE_HOME/lib itself,
    in xDB 10, some of them are still in XHIVE_HOME/lib itself,
    others have moved to subdirecories under XHIVE_HOME/lib.

     

    I guess your fix was close to a solution.

     

    In original common.xml, at line 21, in "-init" target,
    where we define classpaths, replace
          <fileset dir="${xdb.lib}">
            <include name="*.jar" />
          </fileset>
    by
          <fileset dir="${xdb.lib}">
            <include name="**/*.jar" />
          </fileset>

     

    In original common.xml, at line 139, in "create-war" target,
    replace
        <copy todir="${war.dir}/lib">
          <fileset dir="${lib.dir}" includes="*.jar" />
          <fileset dir="${lib.dir}/glassfish" includes="webservices-rt.jar" />
          <fileset file="${xdb.lib}/*.jar" />
        </copy>
    by
        <copy todir="${war.dir}/lib" flatten="true">
          <fileset dir="${lib.dir}" includes="*.jar" />
          <fileset dir="${lib.dir}/glassfish" includes="webservices-rt.jar" />
          <fileset dir="${xdb.lib}">
            <include name="**/*.jar" />
          </fileset>
        </copy>

     

    The expression "**/*.jar" is of course shorthand for
        any jar in any lib under "${xdb.lib}"

    In the "copy" task, the
        flatten="true"
    is needed because Tomcat webserver needs all the jars directly
    in a web applications WEB-INF/lib dir.

     

    Attached a common.xml file with this fix.

    regards,

     

     

    Wouter van der Meiden

    X-Hive Corporation

    Aert van Nesstraat 45

    3012 CA Rotterdam

    The Netherlands

     

    Phone: +31 (0)10 281 80 90

          +31 (0)10 281 80 80

      Fax: +31 (0)10 281 80 81

    Mail: wouter.vandermeiden@emc.com

  • 2. Re: xDB SOAP Web Service on version 10 - XHiveDriverIf.init() error with Map or HashMap
    ryanrockets

    Thank you! That did it. I was close, but not familiar enough with ant to know about the flatten option.

     

    Also, regarding the google collections library it was looking for, note that it has been moved to a project called guava which is a "a fully compatible, proper superset of the old Google Collections Library."

     

    http://code.google.com/p/google-collections/

  • 3. Re: xDB SOAP Web Service on version 10 - XHiveDriverIf.init() error with Map or HashMap
    ryanrockets

    The project won't build due to the loss of support for apt after Java 7.

    The command 'ant deploy' will fail at line 74 of common.xml: 

     

        <apt_jaxws fork="true"

                   debug="false"

                   verbose="true"

                   nocompile="false"

                   destdir="${xhive.soap.build.dir}"

                   sourcedestdir="${jaxws.src}"

                   sourcepath="${src.main}">

     

    [apt_jaxws] Error: Could not find or load main class com.sun.tools.apt.Main

  • 4. Re: xDB SOAP Web Service on version 10 - XHiveDriverIf.init() error with Map or HashMap
    Wouter Van Der Meiden

    Hi Ryan,

     

    Up to now all xDB versions compile with Java 7.

    So if your application that depends on xDB or xDB SOAP package

    needs to compile and/or run with Java 8 you have a problem.

     

    The apt related classes are deprecated in Java 7 and

    not available in Java 8.

     

    EMC does not support xDB SOAP package anymore,

    and AFAIK custumers have all the sources to do with it what they want.

     

    So I see there are two options:

    - either maintain the xDB SOAP package yourself

    - or convince EMC management that EMC should do this.

     

    If you want EMC to do this, your first action could be to mail

    me (see below) and Vojtech Toman (vojtech.toman@emc.com) who is

    the xDB manager, directly.

     

     

    kind regards,

     

     

     

     

    Wouter van der Meiden

    X-Hive Corporation

    Aert van Nesstraat 45

    3012 CA Rotterdam

    The Netherlands

     

    Phone: +31 (0)10 281 80 90

           +31 (0)10 281 80 80

      Fax: +31 (0)10 281 80 81

    Mail: wouter.vandermeiden@emc.com