:
>>
>>> 2 call org.jboss.wsf.spi.tools.cmd.WSProvide directly.
>>> Thi methos has two way to realize:
>>> One is using classloader and the other is using eclipse launch
>>> configuration(as Rob said)
>>> These two ways both need to load some jars according to the
>>> wsprovider.sh. I do not know if these sh are same from different
>>> verion of jboss AS or WS. So I tested them and know they can
>>> resolved the issue. But I do not use it.
>> eh - why not ? this sounds by far as the best solution and you can
>> always have variations of it dependent on wether it is AS or WS you
>> are using.
>> And you would need to know that for what you do in solution 4 anway,
>> right ?
> In the end of the wsprovider.sh:
> "$JAVA" $JAVA_OPTS \
> -Djava.endorsed.dirs="$JBOSS_ENDORSED_DIRS" \
> -Dlog4j.configuration=wstools-log4j.xml \
> -classpath "$WSPROVIDE_CLASSPATH" \
> org.jboss.wsf.spi.tools.cmd.WSProvide "$@"
>
> the $WSPROVIDE_CLASSPATH include many jars too. If we use classloader
> or java launch configuration to run it, we need to resolve the sh and
> get these jars and add them to environment's classpath. I don't know
> if the format of the sh files are same , so it is not easy to do.
I do not understand the problem ?
WSPROVIDE_CLASSPATH is something that is easy to find is it not ? And
isn't WS and AS using the same ?
Yes, WSPROVIDE_CLASSPATH is easy to find. And
now we only use jboss as
4.2 or 4.3, and jboss ws 2.x.
So it is same. We can get the jars from the sh file and add them to a
java launch or classloader's classpath.
We may ask the jboss ws team about the WSPROVIDE_CLASSPATH's jars too.
But I think it is not a good
way. Because maybe now we can get the jars, for example 10 jars. But
maybe in future, we will use jboss ws 3.x,
if the wsprovide.sh from jboss ws 3.x has 11jars, I believe the jboss ws
guys do not know what the ws future version
will be like. Then how should we do?
So I think the right way is to resolve the wsprovide.sh to get the jars
when we want to use, don't care the version of jboss ws or as.
But if we use this way -- resolve the wsprovide.sh--, there is a
problem. The wsprovider.sh has not a good format, so resolving the
wsprovide.sh in java codes is not easy.
As above what I said, I think this not a good way. At least, this is
worse than using temp.jar. ;-)
>
>
>>> 4 create a temp.jar and add all of the jars into the temp.jar's
>>> menifest file. Then use this jar instead of all of the jars to the
>>> class path
>>> Now I use this method to resolve this issue.
>> This does not sound like a good idea! Classloading rules changes
>> when stuff is put into the same jar plus it is not how the user
>> would run these
>> if he could. Plus it requires a massive copying of classes/files.
> No, I do not copy any file. I just add the jars' paths to the
> temp.jar's manifest file. So I think to load the temp.jar just is
> equivalent to load all the jars.
Ohh - ok that is very different from what I read :) I like that, but
how can your manifest.mf file refer to .jar's spread all over the
filesystem ? manifest.mf's are
always relative not absolute are they ?
No, manifest.mf may use absolute path. When
we use jar, we hope wherever
we can use the jar,my machine, your machine or other machine, so we need
to use relative path all time.
But we can use absolute path in manifest.mf because in our scene, we
need it only one time.
Could you give an example of the manifest.mf file you generate ?
Of course! See the
attached file. For the manifest.mf file can refer to
.jars spread all over the filesystem, windows or linux, I do much work
to handle the absolute path, for exmaple:
how to instead of the space in the path, how to handle the directory,
how to replace windows' file sperator and so on.
p.s. Make sure you create a uniquely named file and delete it again ;)
I use some
codes to generate jar:
tempJar = File.createTempFile("temp", ".jar");
org.jboss.tools.common.util.FileUtil.jar(new File[0],
tempJar.getAbsolutePath(), mf);
The jar is just a temp file, so we need not to care the uniquely named
file and how to delete it.
/max
Manifest-Version: 1.2
Class-Path: /home/grid/workspace/runtime%20-ws/test/build/classes/ /ho
me/grid/workspace/runtime%20-ws/test/src/ /home/grid/softinstall/jbos
s-4.2.3.GA/client/jboss-common-client.jar /home/grid/softinstall/jbos
s-4.2.3.GA/client/antlr.jar /home/grid/softinstall/jboss-4.2.3.GA/cli
ent/jaxb-api.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jboss-j
axrpc.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jbossws-framew
ork.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jaxws-rt.jar /ho
me/grid/softinstall/jboss-4.2.3.GA/client/jboss-jsr77-client.jar /hom
e/grid/softinstall/jboss-4.2.3.GA/client/trove.jar /home/grid/softins
tall/jboss-4.2.3.GA/client/jbossws-jboss42.jar /home/grid/softinstall
/jboss-4.2.3.GA/client/wstx.jar /home/grid/softinstall/jboss-4.2.3.GA
/client/stax-ex.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jbos
ssx-client.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jboss-cli
ent.jar /home/grid/softinstall/jboss-4.2.3.GA/client/concurrent.jar /
home/grid/softinstall/jboss-4.2.3.GA/client/policy.jar /home/grid/sof
tinstall/jboss-4.2.3.GA/client/jaxb-xjc.jar /home/grid/softinstall/jb
oss-4.2.3.GA/client/jbossws-client.jar /home/grid/softinstall/jboss-4
.2.3.GA/client/wsdl4j.jar /home/grid/softinstall/jboss-4.2.3.GA/clien
t/streambuffer.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jboss
ws-common.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jboss-aspe
ct-jdk50-client.jar /home/grid/softinstall/jboss-4.2.3.GA/client/hibe
rnate-annotations.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jb
oss-jaxws.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jbosscx-cl
ient.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jmx-invoker-ada
ptor-client.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jmx-clie
nt.jar /home/grid/softinstall/jboss-4.2.3.GA/client/stax-api.jar /hom
e/grid/softinstall/jboss-4.2.3.GA/client/logkit.jar /home/grid/softin
stall/jboss-4.2.3.GA/client/jboss-xml-binding.jar /home/grid/softinst
all/jboss-4.2.3.GA/client/jboss-ejb3x.jar /home/grid/softinstall/jbos
s-4.2.3.GA/client/getopt.jar /home/grid/softinstall/jboss-4.2.3.GA/cl
ient/FastInfoset.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jbo
ss-system-client.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jbo
ss-deployment.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jboss-
annotations-ejb3.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jbo
ss-ejb3-client.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jboss
jmx-ant.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jettison.jar
/home/grid/softinstall/jboss-4.2.3.GA/client/commons-codec.jar /home
/grid/softinstall/jboss-4.2.3.GA/client/jboss-saaj.jar /home/grid/sof
tinstall/jboss-4.2.3.GA/client/mail.jar /home/grid/softinstall/jboss-
4.2.3.GA/client/scout.jar /home/grid/softinstall/jboss-4.2.3.GA/clien
t/jacorb.jar /home/grid/softinstall/jboss-4.2.3.GA/client/xmlsec.jar
/home/grid/softinstall/jboss-4.2.3.GA/client/jboss-remoting.jar /home
/grid/softinstall/jboss-4.2.3.GA/client/jbossha-client.jar /home/grid
/softinstall/jboss-4.2.3.GA/client/commons-httpclient.jar /home/grid/
softinstall/jboss-4.2.3.GA/client/jboss-jaxws-ext.jar /home/grid/soft
install/jboss-4.2.3.GA/client/avalon-framework.jar /home/grid/softins
tall/jboss-4.2.3.GA/client/commons-logging.jar /home/grid/softinstall
/jboss-4.2.3.GA/client/jaxb-impl.jar /home/grid/softinstall/jboss-4.2
.3.GA/client/jbossmq-client.jar /home/grid/softinstall/jboss-4.2.3.GA
/client/jnp-client.jar /home/grid/softinstall/jboss-4.2.3.GA/client/j
avassist.jar /home/grid/softinstall/jboss-4.2.3.GA/client/log4j.jar /
home/grid/softinstall/jboss-4.2.3.GA/client/jbossws-spi.jar /home/gri
d/softinstall/jboss-4.2.3.GA/client/jboss-transaction-client.jar /hom
e/grid/softinstall/jboss-4.2.3.GA/client/jaxws-tools.jar /home/grid/s
oftinstall/jboss-4.2.3.GA/client/jboss-j2ee.jar /home/grid/softinstal
l/jboss-4.2.3.GA/client/jboss-serialization.jar /home/grid/softinstal
l/jboss-4.2.3.GA/client/jboss-aop-jdk50-client.jar /home/grid/softins
tall/jboss-4.2.3.GA/client/activation.jar /home/grid/softinstall/jbos
s-4.2.3.GA/client/ejb3-persistence.jar /home/grid/softinstall/jboss-4
.2.3.GA/client/jboss-iiop-client.jar /home/grid/softinstall/jboss-4.2
.3.GA/client/jbossall-client.jar /home/grid/softinstall/jboss-4.2.3.G
A/client/hibernate-client.jar /home/grid/softinstall/jboss-4.2.3.GA/c
lient/servlet-api.jar /home/grid/softinstall/jboss-4.2.3.GA/client/jb
oss-srp-client.jar /home/grid/softinstall/jboss-4.2.3.GA/lib/jaxb-api
.jar /home/grid/softinstall/jboss-4.2.3.GA/lib/concurrent.jar /home/g
rid/softinstall/jboss-4.2.3.GA/lib/jboss-xml-binding.jar /home/grid/s
oftinstall/jboss-4.2.3.GA/lib/getopt.jar /home/grid/softinstall/jboss
-4.2.3.GA/lib/commons-codec.jar /home/grid/softinstall/jboss-4.2.3.GA
/lib/commons-httpclient.jar /home/grid/softinstall/jboss-4.2.3.GA/lib
/jboss-jmx.jar /home/grid/softinstall/jboss-4.2.3.GA/lib/commons-logg
ing.jar /home/grid/softinstall/jboss-4.2.3.GA/lib/jaxb-impl.jar /home
/grid/softinstall/jboss-4.2.3.GA/lib/jboss-system.jar /home/grid/soft
install/jboss-4.2.3.GA/lib/log4j-boot.jar /home/grid/softinstall/jbos
s-4.2.3.GA/lib/jboss-common.jar /home/grid/softinstall/jboss-4.2.3.GA
/server/default/lib/jboss-iiop.jar /home/grid/softinstall/jboss-4.2.3
.GA/server/default/lib/jbossjta-integration.jar /home/grid/softinstal
l/jboss-4.2.3.GA/server/default/lib/antlr.jar /home/grid/softinstall/
jboss-4.2.3.GA/server/default/lib/bsh.jar /home/grid/softinstall/jbos
s-4.2.3.GA/server/default/lib/jboss.jar /home/grid/softinstall/jboss-
4.2.3.GA/server/default/lib/jboss-jaxrpc.jar /home/grid/softinstall/j
boss-4.2.3.GA/server/default/lib/hibernate3.jar /home/grid/softinstal
l/jboss-4.2.3.GA/server/default/lib/jbossws-framework.jar /home/grid/
softinstall/jboss-4.2.3.GA/server/default/lib/hsqldb-plugin.jar /home
/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jboss-hibernate.j
ar /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jboss-srp
.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jboss-c
ommon-jdbc-wrapper.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/lib/jbossws-jboss42.jar /home/grid/softinstall/jboss-4.2.3.GA/
server/default/lib/cglib.jar /home/grid/softinstall/jboss-4.2.3.GA/se
rver/default/lib/bsf.jar /home/grid/softinstall/jboss-4.2.3.GA/server
/default/lib/bindingservice-plugin.jar /home/grid/softinstall/jboss-4
.2.3.GA/server/default/lib/jboss-jsr88.jar /home/grid/softinstall/jbo
ss-4.2.3.GA/server/default/lib/jsp-api.jar /home/grid/softinstall/jbo
ss-4.2.3.GA/server/default/lib/mail-plugin.jar /home/grid/softinstall
/jboss-4.2.3.GA/server/default/lib/bsh-deployer.jar /home/grid/softin
stall/jboss-4.2.3.GA/server/default/lib/jbossws-common.jar /home/grid
/softinstall/jboss-4.2.3.GA/server/default/lib/jmx-adaptor-plugin.jar
/home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jnpserver.j
ar /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/hibernate
-annotations.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default
/lib/jboss-jaxws.jar /home/grid/softinstall/jboss-4.2.3.GA/server/def
ault/lib/jboss-jca.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/lib/scheduler-plugin-example.jar /home/grid/softinstall/jboss-
4.2.3.GA/server/default/lib/jboss-jsr77.jar /home/grid/softinstall/jb
oss-4.2.3.GA/server/default/lib/jboss-management.jar /home/grid/softi
nstall/jboss-4.2.3.GA/server/default/lib/autonumber-plugin.jar /home/
grid/softinstall/jboss-4.2.3.GA/server/default/lib/jboss-ejb3x.jar /h
ome/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jboss-remoting
-int.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/log
4j-snmp-appender.jar /home/grid/softinstall/jboss-4.2.3.GA/server/def
ault/lib/commons-codec.jar /home/grid/softinstall/jboss-4.2.3.GA/serv
er/default/lib/quartz.jar /home/grid/softinstall/jboss-4.2.3.GA/serve
r/default/lib/jboss-saaj.jar /home/grid/softinstall/jboss-4.2.3.GA/se
rver/default/lib/dom4j.jar /home/grid/softinstall/jboss-4.2.3.GA/serv
er/default/lib/mail.jar /home/grid/softinstall/jboss-4.2.3.GA/server/
default/lib/jboss-remoting.jar /home/grid/softinstall/jboss-4.2.3.GA/
server/default/lib/jboss-monitoring.jar /home/grid/softinstall/jboss-
4.2.3.GA/server/default/lib/commons-httpclient.jar /home/grid/softins
tall/jboss-4.2.3.GA/server/default/lib/jboss-jaxws-ext.jar /home/grid
/softinstall/jboss-4.2.3.GA/server/default/lib/hsqldb.jar /home/grid/
softinstall/jboss-4.2.3.GA/server/default/lib/el-api.jar /home/grid/s
oftinstall/jboss-4.2.3.GA/server/default/lib/xmlentitymgr.jar /home/g
rid/softinstall/jboss-4.2.3.GA/server/default/lib/commons-logging.jar
/home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jbossjta.ja
r /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/scheduler-
plugin.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/p
roperties-plugin.jar /home/grid/softinstall/jboss-4.2.3.GA/server/def
ault/lib/javassist.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/lib/log4j.jar /home/grid/softinstall/jboss-4.2.3.GA/server/def
ault/lib/jbossws-spi.jar /home/grid/softinstall/jboss-4.2.3.GA/server
/default/lib/jaxen.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/lib/jboss-transaction.jar /home/grid/softinstall/jboss-4.2.3.G
A/server/default/lib/bcel.jar /home/grid/softinstall/jboss-4.2.3.GA/s
erver/default/lib/jbossts-common.jar /home/grid/softinstall/jboss-4.2
.3.GA/server/default/lib/hibernate-entitymanager.jar /home/grid/softi
nstall/jboss-4.2.3.GA/server/default/lib/jboss-j2ee.jar /home/grid/so
ftinstall/jboss-4.2.3.GA/server/default/lib/jboss-serialization.jar /
home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/jbosssx.jar /
home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/activation.ja
r /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/joesnmp.ja
r /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/ejb3-persi
stence.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default/lib/c
ommons-collections.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/lib/jbossmq.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/lib/jboss-vfs.jar /home/grid/softinstall/jboss-4.2.3.GA/server
/default/lib/servlet-api.jar /home/grid/softinstall/jboss-4.2.3.GA/se
rver/default/deploy/jboss-web.deployer/jsf-libs/jsf-api.jar /home/gri
d/softinstall/jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer
/jsf-libs/jsf-impl.jar /home/grid/softinstall/jboss-4.2.3.GA/server/d
efault/deploy/jboss-web.deployer/jsf-libs/jboss-faces.jar /home/grid/
softinstall/jboss-4.2.3.GA/server/default/deploy/jboss-aop-jdk50.depl
oyer/trove.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default/d
eploy/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar /home/g
rid/softinstall/jboss-4.2.3.GA/server/default/deploy/jboss-aop-jdk50.
deployer/pluggable-instrumentor.jar /home/grid/softinstall/jboss-4.2.
3.GA/server/default/deploy/jboss-aop-jdk50.deployer/jrockit-pluggable
-instrumentor.jar /home/grid/softinstall/jboss-4.2.3.GA/server/defaul
t/deploy/jboss-aop-jdk50.deployer/jboss-aop-jdk50.jar /home/grid/soft
install/jboss-4.2.3.GA/server/default/deploy/ejb3.deployer/jboss-ejb3
.jar /home/grid/softinstall/jboss-4.2.3.GA/server/default/deploy/ejb3
.deployer/jboss-annotations-ejb3.jar /home/grid/Download/CreditCheckW
ebService/build/ /home/grid/Download/CreditCheckWebService/src/ /home
/grid/softinstall/jdk1.5.0_15/jre/lib/rt.jar /home/grid/softinstall/j
dk1.5.0_15/jre/lib/jsse.jar /home/grid/softinstall/jdk1.5.0_15/jre/li
b/jce.jar /home/grid/softinstall/jdk1.5.0_15/jre/lib/charsets.jar /ho
me/grid/softinstall/jdk1.5.0_15/jre/lib/ext/dnsns.jar /home/grid/soft
install/jdk1.5.0_15/jre/lib/ext/localedata.jar /home/grid/softinstall
/jdk1.5.0_15/jre/lib/ext/sunpkcs11.jar /home/grid/softinstall/jdk1.5.
0_15/jre/lib/ext/sunjce_provider.jar