server.bat writes corrupted runserver.bat

I’m using webMethods 4.0.1 sp 3.

I recently started up the server via the command line, and then stopped it by pressing ctrl-C. When I then tried to re-launch the server, it gave me the following error:

C:\webMethods\B2BServer4\bin>server.bat -debug 5 -log none
Exception in thread “main” java.lang.NoClassDefFoundError: com/wm/util/Values
at com.wm.app.b2b.server.Main.main(Main.java:36)

The generated runserver.bat looks as follows:

“C:\jdk1.3.1_04\bin\java.exe” -ms128M -mx256M -classpath “C:\webMethods\B2BServer4\updates\B2BS_4-0-1_SP3.jar;C:\webMethods\B2BServer4\lib\server.jar” com.wm.app.b2b.server.Main -debug 5 -log none 5 C:\jdk1.3.1_04\lib\i18n.jar;;C:\webMethods\B2BServer4\lib\classes;C:\webMethods\B2BServer4\lib\client.jar;C:\webMethods\B2BServer4\lib\mail.jar;C:\webMethods\B2BServer4\lib\server.jar;C:\webMethods\B2BServer4\lib\jars\certpath-compat-api.jar;C:\webMethods\B2BServer4\lib\jars\cryptix-jce-api.jar;C:\webMethods\B2BServer4\lib\jars\cryptix-jce-provider.jar;C:\webMethods\B2BServer4\lib\jars\cryptix-message-api.jar;C:\webMethods\B2BServer4\lib\jars\cryptix-openpgp-provider.jar;C:\webMethods\B2BServer4\lib\jars\cryptix-pki-api.jar;C:\webMethods\B2BServer4\lib\jars\cs_cloudscape.jar;C:\webMethods\B2BServer4\lib\jars\cs_tools.jar;C:\webMethods\B2BServer4\lib\jars\extserver.jar;C:\webMethods\B2BServer4\lib\jars\mm.mysql-2.0.14-bin.jar;C:\webMethods\B2BServer4\lib\jars\sljc.jar;C:\webMethods\B2BServer4\lib\jars\slje.jar;C:\webMethods\B2BServer4\lib\jars\classes111.zip;C:\webMethods\B2BServer4\lib\jars\nls_charset11.zip;C:\webMethods\B2BServer4\lib\jars\tncore.zip;packages\WmPartners\code\classes;packages\WmWin32\code\classes;;"

It is not surprising that the above does not run, it is more surprising that the updatemanager writes such a file.

My colleagues and I had the same problem in the past, and could only solve it by reinstalling webMethods.

Help?

Try renaming runserver.bat to runserver.save.

If I try to rename/remove runserver.bat and launch server.bat again, it re-creates a corrupted file.

Taking a lesson from an old Enterprise rule-of-thumb regarding the adapter config files, never, ever, use backslashes ("").

The server.bat file came straight from the webMethods distribution, I only changed the JAVA_MIN_MEM, JAVA_MAX_MEM, and JAVA_ROOT settings, in order to run a decent WM process and a server that is able to compile Java functions.

I applied your changes. What you recommend results in a different runserver.bat, which is nevertheless corrupted.

“C:/webMethods/B2BServer4/jvm/bin/java.exe” -ms128M -mx256M -classpath “C:\webMethods\B2BServer4\updates\B2BS_4-0-1_SP3.jar;C:\webMethods\B2BServer4\lib\server.jar;;C:/webMethods/B2BServer4/jvm/lib/i18n.jar;;C:/webMethods/B2BServer4/lib/classes;C:/webMethods/B2BServer4/lib/client.jar;C:/webMethods/B2BServer4/lib/mail.jar;C:/webMethods/B2BServer4/lib/server.jar;C:certpath-compat-api.jar;C:cryptix-jce-api.jar;C:cryptix-jce-provider.jar;C:cryptix-message-api.jar;C:cryptix-openpgp-provider.jar;C:cryptix-pki-api.jar;C:cs_cloudscape.jar;C:cs_tools.jar;C:extserver.jar;C:mm.mysql-2.0.14-bin.jar;C:sljc.jar;C:slje.jar;C:classes111.zip;C:nls_charset11.zip;C:tncore.zip;;” com.wm.app.b2b.server.Main

Something may not have like the backslashes after all.

I have had this problem before. Try removing classpath from your Windows environment variables (obviously you’ll want to save the content). The windows command line has a maximum command length of 256 characters (Which I wish I new how to change) and webMethods generates a command that is longer than that if your classpath is anything more than a few characters long.

Regards

Vic

Adding to Victor’s comment, you can also try the following:

Create a c:\jars directory and move all the
jar files from
C:\Program Files\webMethods\B2BServer4\lib\jars to this directory and
make the following change in your server.bat:

if exist “%B2B_ROOT%\lib\jars” (
call :appendJarsAndZips “%B2B_ROOT%\lib\jars”
)

CHANGE TO:

if exist “c:\jars” (
call :appendJarsAndZips “c:\jars”
)

Thanks for your hints.

I have had the problem of a too long environment variable before. As I recall, I get a different error when that happens.

I am not entirely sure, but I believe my classpath was empty, at the time that I had this problem.

Meanwhile, I have re-installed the webMethods server, and got rid of the batch files, updateManager and so forth. I simply re-installed the webMethods program files (with the “custom install” option). By proceeding in that way, I was able to get by, without having to re-configure Trading Networks.

I noticed that the installation replaced jcode.bat. Maybe that this file got corrupted.

I’ll try all of your hints next time that this happens.