Skip to main content

[wscompile] error : com.sun.tools.javac.Main is not available

2 replies [Last post]
najmi
Offline
Joined: 2003-06-17
Points: 0

Dear colleagues,

This issue is with JAX-RPC 1.x. My project is working to move to JAX-WS.

I have hit the brick wall with this issue...

I have a mvn pom that uses maven-antrun-plugin to run wscompile.

It defines a section as follows:

The resulting wscompile command looks like the following according to
output it produces:

[wscompile] command line: wscompile -d ./target/classes
-features:wsi,nodatabinding -g -gen:client -keep -model
./target/model.xml.gz -s ./src/main/java -verbose
./src/main/webapp/WEB-INF/config.xml -classpath
/usr/lib64/jvm/java-1.5.0-sun-1.5.0_update10/lib/tools.jar:./target/classes:/home/najmi/.m2/repository/ca/on/gov/mgs/gsdc/bd/bd-bni-bindings/1.0/bd-bni-bindings-1.0.jar:/home/najmi/.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar:/home/najmi/.m2/repository/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:/home/najmi/.m2/repository/com/sun/xml/rpc/jaxrpc-spi/1.1.3_01/jaxrpc-spi-1.1.3_01.jar:/home/najmi/.m2/repository/log4j/log4j/1.2.8/log4j-1.2.8.jar:/home/najmi/.m2/repository/jaxb/jaxb-impl/1.0.5/jaxb-impl-1.0.5.jar:/home/najmi/.m2/repository/javax/xml/namespace/1.0.1/namespace-1.0.1.jar:/home/najmi/.m2/repository/com/sun/xml/parsers/jaxp-ri/1.4/jaxp-ri-1.4.jar:/home/najmi/.m2/repository/jaxb/jaxb-libs/1.0.5/jaxb-libs-1.0.5.jar:/home/najmi/.m2/repository/org/jvnet/hyperjaxb2/hyperjaxb2-testing/0.6.0/hyperjaxb2-testing-0.6.0.jar:/home/najmi/.m2/repository/com/sun/msv/datatype/xsd/xsdlib/20060615/xsdlib-20060615.jar:/home/najmi/.m2/repository/org/hibernate/hibernate/3.1.3/hibernate-3.1.3.jar:/home/najmi/.m2/repository/asm/asm/2.2.1/asm-2.2.1.jar:/home/najmi/.m2/repository/antlr/antlr/2.7.6rc1/antlr-2.7.6rc1.jar:/home/najmi/.m2/repository/javax/xml/bind/jaxb-api/1.0/jaxb-api-1.0.jar:/home/najmi/.m2/repository/com/sun/xml/bind/jaxb-impl/1.0.6/jaxb-impl-1.0.6.jar:/home/najmi/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:/home/najmi/.m2/repository/org/jvnet/hyperjaxb2/hyperjaxb2-shared/0.6.0/hyperjaxb2-shared-0.6.0.jar:/home/najmi/.m2/repository/isorelax/isorelax/20030108/isorelax-20030108.jar:/home/najmi/.m2/repository/org/jvnet/jaxbcommons/jaxbcommons-shared/1.0.3/jaxbcommons-shared-1.0.3.jar:/home/najmi/.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar:/home/najmi/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.0.2/FastInfoset-1.0.2.jar:/home/najmi/.m2/repository/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar:/home/najmi/.m2/repository/org/jvnet/jaxbcommons/jaxbcommons-testing/1.0.3/jaxbcommons-testing-1.0.3.jar:/home/najmi/.m2/repository/com/sun/xml/rpc/jaxrpc-impl/1.1.3_01/jaxrpc-impl-1.1.3_01.jar:/home/najmi/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/najmi/.m2/repository/cglib/cglib/2.2_beta1/cglib-2.2_beta1.jar:/home/najmi/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar:/home/najmi/.m2/repository/javax/xml/jaxr-api/1.0_03/jaxr-api-1.0_03.jar:/home/najmi/.m2/repository/commons-collections/commons-collections/2.1.1/commons-collections-2.1.1.jar:/home/najmi/.m2/repository/javax/xml/jax-qname/1.1/jax-qname-1.1.jar:/home/najmi/.m2/repository/com/sun/xml/bind/jaxb-xjc/1.0.6/jaxb-xjc-1.0.6.jar:/home/najmi/.m2/repository/javax/xml/parsers/jaxp-api/1.4/jaxp-api-1.4.jar:/home/najmi/.m2/repository/com/sun/xml/messaging/saaj/saaj-impl/1.3/saaj-impl-1.3.jar:/home/najmi/.m2/repository/asm/asm-attrs/2.2.1/asm-attrs-2.2.1.jar:/home/najmi/.m2/repository/com/sun/xml/bind/jaxb-libs/1.0.6/jaxb-libs-1.0.6.jar:/home/najmi/.m2/repository/javax/xml/jaxrpc-api/1.1/jaxrpc-api-1.1.jar:/home/najmi/.m2/repository/com/oracle/classes12/9.0.2.0.0/classes12-9.0.2.0.0.jar:/home/najmi/.m2/repository/commons-logging/commons-logging-api/1.0.4/commons-logging-api-1.0.4.jar:/home/najmi/.m2/repository/commons-io/commons-io/1.2/commons-io-1.2.jar

Notice that tools.jar is first in classpath.

However, the execution still complains:

[ServiceInterfaceGenerator: creating service interface: xxxx]
[ServiceGenerator: creating service: xxxx_Impl]
[SerializerRegistryGenerator: creating serializer registry:
xxxx_SerializerRegistry]
[wscompile] error : com.sun.tools.javac.Main is not available in the
classpath..
[wscompile] error: compilation failed, errors should have been reported

The same problem was discussed here without any conslusive results:

http://osdir.com/ml/java.jax-rpc.user/2005-06/msg00005.html

Any idea what I can do to fix this problem? Please ping on IM when
possible for a brief conversation.

Thanks for your help.

--
Regards,
Farrukh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
najmi
Offline
Joined: 2003-06-17
Points: 0

It appears that it is some weird classloader issue that is fixed by specifying
fork="true" on wscompile command line as follows:



kohsuke
Offline
Joined: 2003-06-09
Points: 0

Hmm. I really don't recommend using @fork at all.

Was it ${java.home}/../lib/tools.jar, as opposed to ${java.home}/lib/tools.jar ?