Classpath Problem

I am using a third party jar file in my service and the service refuses to compile in Webmethods Developer. I have edited the ‘server.bat’ file to include the jar in the CLASSPATH. I have the jar file in my SYSTEM’s CLASSPATH and have also copied the jar to the code/jars directory of the package where I have written the service.
Can anybody help me on this?

put the jar file in \IntegrationServer\packages&#60;package>\code\jars . where <package> is your package name .

G’day Amitabh,

How did you resolve this issue.
I have a similar problem, can you please let me know how you fixed this.

Cheers,
Mick

If your custom jar file is globally used by several packages place a jar file into IS directory: <webmethods>/IntegrationServer/lib/jars
If your jar file is used by only one package you can place it as Navneet sugests into package directory:
<package>/code/jars
But in both cases you must add imports to your java services Developer shared tab with full package/class naming like java.util.* forexample.

The problem has not been solved due to a bigger problem. My packages are not appearing in the packages directory, even though it appears in the webMethods developer. Will let you know once it is solved.

Has anybody faced this kind of a problem?

Hi,
I am using webmethods 4.6 and i tried to create a java service,when i compiled i received compiler not found and i changed the path of the java root in server.sh file but of no use can any one help to solve this prob…

looking forward
shanti

Shanti, make sure your JAVA_HOME in the server.sh points to a JDK, not just a JRE (ie. the $JAVA_HOME/bin directory should have an javac executable in it).

I always explicitly set the path to the JDK I want to compile with by setting the server.cnf (IS Extended Settings) like so:

watt.server.compile=\Java\jdk1.3.1_06\bin\javac -classpath {0} -d {1} {2}

Then is doesn’t matter what path or JVM runs IS and I don’t have to edit server.bat/sh

HTH,
Fred

Thanks for your reply eric and fred but i tried them and i am not successful can u give specific steps to do that i am new to this i have not changed the server.sh until now

looking forward
shanti

What do you mean by “not successful”?

When you compile a Java service with Developer, IS runs the command line that is set in server.cnf. If the javac path is set correctly, javac will run.

Are you getting the same error in Developer?
A different error?
What is in the server error log and/or console?
What OS?
What is you path?
Can you run that javac on some other .java file?

Hi fred,
I was able to run other java files and not able to compile my java services from the webmethods so i am sending the server.sh file below check it out and give me some tips you mentioned explicitly but i was not able to make that step aslo…
The change i made is the Java_root = c:\newwm\bin

#!/bin/sh

#############################################################################

Copyright (c) 1996-2001, webMethods Inc. All Rights Reserved.

server.sh : launch webMethods Integration Server

Change B2B_ROOT and JAVA_ROOT to reflect their locations on your system

This script is designed to work with Java VM’s that conform to the

command-line conventions of Sun Microsystems ™ Java Development Kit

or Java Runtime Environment.

#############################################################################

JAVA_MIN_MEM=96M
JAVA_MAX_MEM=128M
JAVA_MEMSET="-ms${JAVA_MIN_MEM} -mx${JAVA_MAX_MEM}"

##############################################################################

Items in PREPENDCLASSES will be added to the classpath right after the server.jar

Items in the APPENDCLASSES will be added to the absolute end of the CLASSPATH

##############################################################################

PREPENDCLASSES=
APPENDCLASSES=

---- SET INITIALLY BY THE INSTALLER ----

B2B_ROOT=C:\Program Files\webMethods\IntegrationServer4
JAVA_ROOT=C:\newwm\bin

---- BE CAREFUL MAKING ANY CHANGES BELOW THIS LINE ----

if [ "1" = "local" ]; then shift B2B_ROOT=`pwd` JAVA_PATH=`which java` JAVA_ROOT=`dirname {JAVA_PATH}`/…
RUNLOCAL=“true”
else
RUNLOCAL=“false”
fi

---- SYSTEM SETTINGS ----

LS_CMD=ls

---- JAVA VM SETUP ----

if [ -x “${JAVA_ROOT}/bin/java” ]; then
JAVA_EXE=“bin/java”
else
JAVA_EXE=“bin/jre”
fi

JAVA_RUN="{JAVA_ROOT}/{JAVA_EXE} ${JAVA_MEMSET}"

SAVED_CP={CLASSPATH} SAVED_LD={LD_LIBRARY_PATH}

NOTE: for HP-UX

SAVED_HP=${SHLIB_PATH}

NOTE: for AIX

SAVED_AIX=${LIBPATH}

---- SERVER RUN LOOP ----

Loop while the exit code is 42

err=42

while [ “${err}” = “42” ]
do

… always launch from server directory

cd ${B2B_ROOT}

CLASSPATH={B2B_ROOT}/lib/classes LD_LIBRARY_PATH={B2B_ROOT}/lib:${SAVED_LD}

SHLIB_PATH={B2B_ROOT}/lib:{SAVED_HP}
LIBPATH={B2B_ROOT}/lib:{SAVED_AIX}

if [ -x {JAVA_ROOT}/lib/classes.zip ]; then JAVA_CP={JAVA_ROOT}/lib/classes.zip
fi

if [ -x {JAVA_ROOT}/lib/dt.jar ]; then JAVA_CP={JAVA_ROOT}/lib/dt.jar
fi

JAVA_CP={JAVA_CP}:{JAVA_ROOT}/lib/i18n.jar

if [ -d {JAVA_ROOT}/jre ]; then JAVA_CP={JAVA_CP}:${JAVA_ROOT}/jre/lib/rt.jar
fi

B2B_MAIN=“com.wm.app.b2b.server.Main”
B2B_JAR=${B2B_ROOT}/lib/server.jar

if [ RUNLOCAL = "false" ]; then CLASSPATH={JAVA_CP}
CLASSPATH={CLASSPATH}:{B2B_ROOT}/lib/classes
CLASSPATH={CLASSPATH}:{B2B_ROOT}/lib/client.jar:{B2B_ROOT}/lib/mail.jar CLASSPATH={CLASSPATH}:${B2B_JAR}

Your JAVA_ROOT may be the issue in the shell. Try removing the “bin” from it’s PATH. Without removing it your path would look like “C:\newwm\bin\bin\java”, unless that was your intention.

You can also set the compiler in the extended config file from your Admin browser. Read your documentation for complete details.

HTH,
Jim Palmer

Under the webmethods directory you will find a jvm directory.

Set the classpath environmental variable on the machine where IS is running to:

<path>\webmethods\jvm\win.sun13\bin (For Windows>

<path>/webmethods/jvm/win.sun13/bin (For Unix)