I'm having an issue with wsgen
and while I've seen some answers that worked none of those solutions seems to be working for me. I believe the problem is related to the structure of the source and binaries.
My WSTest
project is setup with the following folders:
bin
└───com
└───example
└───ws
src
└───com
└───example
└───ws
The main class is Test
which resides in package com.example.ws
.
I'm running wsgen
from the main project folder WSTest
using the following command:
wsgen -cp ./bin/com/example/ws -d ./src/com/example/ws -s ./src/com/example/ws Test
This results in:
Exception in thread "main" java.lang.NoClassDefFoundError (wrong name: com/example/ws/Test)
This makes sense since the class is part of a package. So I change my command to the following:
wsgen -cp ./bin/com/example/ws -d ./src/com/example/ws -s ./src/com/example/ws com.example.ws.Test
But now I get class not found from the wsgen
tool:
Class not found: "com.example.ws.Test"
Usage: WSGEN [options]
What am I missing?
Have you tried something like this?
The classpath folder is were
wsgen
looks for class files. The package within the class is resolved to folder paths, socom.example.ws.Test
should be a file likecom/example/ws/Test.class
within thebin
classpath folder.From the Java documentation: