Hi,

I was trying to j2ee web service example helloservice. When I was building the simpleclient I got the error:

wsimport-client-generate-nosecure:

wsimport-client-generate-nojvmargs:
     [echo] C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\ma
in.xml/../../../../../../glassfish/lib/endorsed
     [echo] helloservice.endpoint
     [echo] build/generated/wsimport/client
     [echo] build/jar
     [echo] http://localhost:8080/helloservice/HelloService?WSDL
 [wsimport] Consider using <depends>/<produces> so that wsimport won't do unnece
ssary compilation
 [wsimport] JDK's tools.jar was not found in C:\Program Files\Java\lib\tools.jar
. Usually this means you are running JRE, not JDK. Please use the java command i
n JDK 5.0 or later (not JRE.)
 [wsimport] Command invoked: wsimport "C:\Program Files\Java\jre6\bin\java.exe"
-Djava.endorsed.dirs=C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-p
roject\main.xml/../../../../../../glassfish/lib/endorsed -classpath C:\glassfish
v3\glassfish\modules\acc-config.jar; ... C:\glassfishv3\glassfish\modules\weld-integration.jar;C:\glassfishv3\glassfish\modules\weld-osgi-bundle.jar com.sun.tools.ws.WsImport -d C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\jaxws\simpleclient\build\jar -Xendorsed -keep -s C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\jaxws\simpleclient\build\generated\wsimport\client http://localhost:8080/helloservice/HelloService?WSDL -p helloservice.endpoint

BUILD FAILED
C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\jaxws-ant.xml:
27: The following error occurred while executing this line:
C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\jaxws-ant.xml:
42: wsimport failed

The generating code is:

<target name="wsimport-client-generate-nosecure" unless="wsimport.secure">
        <antcall target="wsimport-client-generate-nojvmargs"/>
    </target>
    
    <target name="wsimport-client-generate-nojvmargs">
		<echo message="${jaxws.endorseddir.prefix}/lib/endorsed"/>
		<echo message="${wsimport.package}"/>
		<echo message="${build.generated.dir}/wsimport/client"/>
		<echo message="${build.classes.dir}"/>
		<echo message="${wsimport.wsdl.location}"/>
        <wsimport sourcedestdir="${build.generated.dir}/wsimport/client"
                  package="${wsimport.package}" 
                  destdir="${build.classes.dir}"
                  wsdl="${wsimport.wsdl.location}"
                  verbose="${verbose}"
                  fork="true"
                  xendorsed="true">
            <jvmarg line="-Djava.endorsed.dirs=${jaxws.endorseddir.prefix}/lib/endorsed"/>
        </wsimport>
    </target>

I don't know why I am getting this stupid mistake. I didn't modify anything. I just ran the ant command inside the simpleclient directory. Before that I ran the ant all command inside helloservice directory. So I am not sure how to deal with that. Please offer some help here.

Thanks.

Forget it. Because of that jerk who wrote this in the jaxws-ant.xml:

<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport" onerror="ignore">
            <classpath path="${java.home}/../lib/tools.jar:${javac.classpath}"/>
            <classpath refid="javaee.classpath"/>
        </taskdef>

If it is solved, then please mark it as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.