JWSDP / ANT Headaches

I have tried unsuccessfully build the JWSDP Tutorial examples, using the accompanying documentation as a guide. All of my environmental variables have been set accordingly (with the newer settings placed at the front of my CLASSPATH).
This is what I'm entering at the prompt:
C:\jwdsp-1_0-ea2\docs\tutorial\examples\gs>ant build
Despite what I thought was a careful reading of the setup instructions, I am receiving the following error:
taskdef class org.apache.catalina.ant.InstallTask cannot be found.
I tried to "backtrack" the class, based on the path, but could not find it. I then assumed that maybe I needed to include catalina.jar in my CLASSPATH, which I did. Still no luck.
I did read through everything closely a second and third time, to ensure that I wasn't missing anything. Do I need to set CATALINA_HOME? If so, what would that setting be (I'm running WINNT 4.0 SP 6).
Any help would be greatly appreciated!
Thank You,
SM

Thanks again for your help. I still had to do some "tweaking" to get things to work, but you put me on the right track. (Going over the build.xml file didn't hurt either.)
In case you're interested, these are the changes I made to the Environmental Variables settings (WINNT 4.0 SP 6). I'm listing them here, since they aren't documented elsewhere (at least not anywhere I could find).
CLASSPATH:
%JWSDP_HOME%\common\lib;%JWSDP_HOME%\server\lib\catalina-ant.jar;
PATH:
%SystemRoot%\system32;%SystemRoot%;%JWSDP_HOME%\bin;%JAVA_HOME\bin;%ANT_HOME%\bin;
This is the strange one, since the same files needed to run ANT are in %JWSDP_HOME%\bin, which is already in the PATH. It shouldn't be necessary to have it listed twice, but it won't work otherwise (?!)
ANT_HOME:
Directory where ANT is installed (such as C:\jakarta-ant-1.4.1
(The documentation makes no mention of this setting.)
Since I made these changes, there haven't been any problems. I awarded you the 5 Duke Dollars for putting me on the right track (and saving me from a mega-migraine).
~ Sheila

Similar Messages

  • Supressing the JAXB code for Extended Schemas using JWSDP

    Hi,
    Im trying to generate the JAXB code for the XML Schema using JWSDP using ANT build tool.
    Q : My schema(eg., Schema01.xsd) extends other two schemas(Schema02.xsd, Schema03.xsd).Here using JWSDP package using ANT Build tool, i want to Generate the JAXB java classes only for Schema01.xsd not for other two schemas.
    Can somebody help in this regard.
    Note : By default using JWSDP, Ant build tool, in "Build.xml" it expects schema name(eg. Schema01.xsd"). when i generate the java code, it generates code for the Schema and as well as its all exetended schemas.
    Q : how can supress generating the java code for the extended schemas.
    Regards
    Madhu

    Hi, no I didn't notice this, tried it now and got
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?><metadata xmlns="http://musicbrainz.org/ns/mmd-1.0#"><artist-list offset="0" count="1"><artist type="Group" id="ccd4879c-5e88-4385-b131-bf65296bf245" ext:score="100" xmlns:ext="http://musicbrainz.org/ns/ext#"><name>Echo & The Bunnymen</name><sort-name>Echo & The Bunnymen</sort-name><life-span begin="1978"/></artist></artist-list></metadata>is this right, its different to what I was originally trying to get

  • ANT not working with jwsdp

    I am trying to make the web service using the jwsdp1.5 and the Tomcat50-jwsdp
    I am facing the problems when the i use the command ant build it gives me the following error...
    Buildfile: build.xml
    BUILD FAILED
    C:\Sun\jwsdp-1.5\jaxrpc\samples\HelloWS\common\targets.xml:32: taskdef class org.apache.catalina.ant.DeployTask cannot be found
    I dont know what is the problem with it ..Even if i try to run the Sun's given example of HelloWorl then also it gives me error like this....
    C:\Sun\jwsdp-1.5\jaxrpc\samples\HelloWorld>ant build
    Buildfile: build.xml
    init:
    [echo] -------- HelloWorld Sample --------
    prepare:
    generate-server:
    edit-config:
    unedit-config:
    compile-server:
    [javac] Compiling 1 source file to C:\Sun\jwsdp-1.5\jaxrpc\build\samples\HelloWorld\classes\server
    create-war:
    [war] Building war: C:\Sun\jwsdp-1.5\jaxrpc\build\samples\HelloWorld\jaxrpc-HelloWorld-raw.war
    [delete] Deleting directory C:\Sun\jwsdp-1.5\jaxrpc\build\samples\HelloWorld\classes\server
    build-war:
    [echo] -------- HelloWorld --------
    [wsdeploy] command line: -keep -o C:\Sun\jwsdp-1.5\jaxrpc\build\samples\HelloWorld\jaxrpc-HelloWorld.war -verbose C:\Sun\jwsdp-1.5
    C:\Sun\jwsdp-1.5\jwsdp-shared\lib\mail.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\activation.jar;C:\Sun\jwsdp-1.5\jaxp\lib\jaxp-api.jar
    \endorsed\sax.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\xalan.jar;C:\Sun\jwsdp-1.5\jaxp\lib\endorsed\xercesImpl.jar;C:\Sun\jwsdp-1.5\j
    :\Sun\jwsdp-1.5\jaxrpc\lib\jaxrpc-impl.jar;C:\Sun\jwsdp-1.5\saaj\lib\saaj-api.jar;C:\Sun\jwsdp-1.5\saaj\lib\saaj-impl.jar;C:\Sun\jw
    hared\lib\xsdlib.jar;C:\Sun\jwsdp-1.5\jwsdp-shared\lib\jax-qname.jar;C:\Sun\jwsdp-1.5\apache-ant\lib\ant.jar
    [wsdeploy] info: created temporary directory: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\jaxrpc-deploy-e2c637
    [wsdeploy] [CustomClassGenerator: Class hello.HelloIF_echoValueType_RequestStruct exists. Not overriding.]
    [wsdeploy] [CustomClassGenerator: Class hello.ValueType exists. Not overriding.]
    [wsdeploy] [CustomClassGenerator: Class hello.HelloIF_echoValueType_ResponseStruct exists. Not overriding.]
    [wsdeploy] [CustomClassGenerator: Class hello.HelloIF_sayHelloBack_RequestStruct exists. Not overriding.]
    [wsdeploy] [CustomClassGenerator: Class hello.HelloIF_sayHelloBack_ResponseStruct exists. Not overriding.]
    [wsdeploy] [SOAPObjectSerializerGenerator: writing  serializer/deserializer for: {http://hello.org/wsdl}echoValueType]
    [wsdeploy] [SOAPObjectSerializerGenerator: writing  serializer/deserializer for: {http://hello.org/types}ValueType]
    [wsdeploy] [SOAPObjectSerializerGenerator: writing  serializer/deserializer for: {http://hello.org/wsdl}echoValueTypeResponse]
    [wsdeploy] [SOAPObjectSerializerGenerator: writing  serializer/deserializer for: {http://hello.org/wsdl}sayHelloBack]
    [wsdeploy] [SOAPObjectSerializerGenerator: writing  serializer/deserializer for: {http://hello.org/wsdl}sayHelloBackResponse]
    [wsdeploy] [SOAPObjectBuilderGenerator: writing object builder for: echoValueType]
    [wsdeploy] [SOAPObjectBuilderGenerator: writing object builder for: ValueType]
    [wsdeploy] [SOAPObjectBuilderGenerator: writing object builder for: echoValueTypeResponse]
    [wsdeploy] [SOAPObjectBuilderGenerator: writing object builder for: sayHelloBack]
    [wsdeploy] [SOAPObjectBuilderGenerator: writing object builder for: sayHelloBackResponse]
    [wsdeploy] [SerializerRegistryGenerator: creating serializer registry: hello.HelloWorldService_SerializerRegistry]
    BUILD FAILED
    java.lang.NoClassDefFoundError: javax.activation.DataHandler
    Please if anyone has the solution please let me know................

    I had the same problem but as soon as I got catalina-ant.jar into my CLASSPATH things worked OK. On my system, I found that file in the server/lib directory of my tomcat5 (catalina) installation.

  • Jwsdp and Ant problems

    Hi folks, I am having some problems with the JWSDP package.
    I have the fellows programs:
    - j2sdk at directory C:\j2sdk1.4.2
    - jwsdp at directory C:\jwsdp-1.1
    - ant at directory C:\jwsdp-1.1\jakarta-ant-1.5.1
    like the default installation of respective software.
    I set in my autoexec.bat file:
    - set JAVA_HOME=C:\j2sdk1.4.2
    - set JWSDP_HOME=C:\jwsdp-1.1
    - set ANT_HOME=C:\jwsdp-1.1\jakarta-ant-1.5.1
    When I try to execute the tomcat by the menu start/Prgrams/Jwsdp/start
    tomcat I receive a error message ("Out of Environment Space"), and to
    solve this I change the "memory settings" of my .bat (like at site www.moreservlets.com).
    After made this alteration the Tomcat execute normaly by the start menu,
    but don't execute by the prompt (C:>catalina start). I receive just the
    same message when I try execute without change the "memory settings".
    The another problem is, when I try execute the 'ant build' command on
    the prompt I receive the same message ("Out of Environment Space") and the message
    "ANT_HOME is set incorrectly or ant could be not located. Please set ANT_HOME".
    I waana know, why I receive this message if I just have set the environment variables?!!?
    and what I receive the message "Out of Environment Space"!??!
    Or even better, how I can setup the my programs at the jwsdp on Windows98SE?!!?
    thanks, any tip or advice is very welcome.

    Don't [url http://forum.java.sun.com/thread.jsp?forum=54&thread=410960]cross-post

  • How to build, package & deploy web services manually without ant on JWSDP

    Hello,
    How can I Build, Package & Deploy web services manually without using ant tool on JWSDP 1.3?.
    Because I am having difficulties in using ant tool for my own webservices. ant is very tightly coupled with the directory hierarchy & configuration files (as I go throught the examples of JWSDP1.3). Also I need to learn the overall process going on behind the scene.
    I have to teach the simplest required steps to build, package & deploy any webservice to any container independent of application server & OS without using ant tool. It would also help me to understand which items are required as specified in the Web Services Specifications & which one are implementation or platform specific.
    Any help would be greatly appreciated.
    Thanks,
    Iftikhar.

    Just follow the step of the JWSDP1.3 tutorial..

  • Please please help error trying to install JWSDP example using ant

    Hello,
    I'm very new to Java programming and desperately need some help. I'm trying to run the Duke's bookstore example in the web services tutorial. When I build it using the Ant tool it says "build successful", however when I come to install it it gives the following error:
    BUILD FAILED
    file:C:/jwsdp-1.2/jwsdp-1_2-tutorial/jwstutorial12/examples/common/targets.xml:1
    5: java.io.IOException: Server returned HTTP response code: 401 for URL: http://
    localhost:8080/manager/install?path=%2Fbookstore1&war=file%3A%2Fjwstutorial12%2F
    examples%2Fweb%2Fbookstore1%2Fbuild
    Any help would be gratefully received.
    Thanks

    From:
    ftp://ftp.isi.edu/in-notes/rfc2616.txt
    10.4.2 401 Unauthorized
    The request requires user authentication. The response MUST include a
    WWW-Authenticate header field (section 14.47) containing a challenge
    applicable to the requested resource. The client MAY repeat the
    request with a suitable Authorization header field (section 14.8). If
    the request already included Authorization credentials, then the 401
    response indicates that authorization has been refused for those
    credentials. If the 401 response contains the same challenge as the
    prior response, and the user agent has already attempted
    authentication at least once, then the user SHOULD be presented the
    entity that was given in the response, since that entity might
    include relevant diagnostic information. HTTP access authentication
    is explained in "HTTP Authentication: Basic and Digest Access
    Authentication" [43].
    Sounds like you need to check a username/password somewhere in the targets.xml file? Hope this helps. Cheers, Neil

  • Jwsdp installation, ant execution

    I installed jwsdp 1.1 on my system (windows xp)
    after following the getting started guide, my path looks like this
    C:\Documents and Settings\Vajja\jwsdp-1.1\jakarta-ant-1.5.1\bin;C:\Documents and Settings\Vajja\jwsdp-1.1\jwsdp-shared\bin;%JAVA_HOME%\bin;C:\Documents and Settings\Vajja\jwsdp-1.1\bin;
    yet i am not able to execute the ant command. the following error prompts when ever i try to execute the ant command
    Exception in thread "main" java.lang.NoClassDefFoundError: and
    can some one let me know why am i not able to execute ant on my system

    make a copy of Ant.bat
    sprinkle through with 'echo' comments see if you can find out where it
    is failing. On Win98se when I did this I found that lines like
    if exist blah
    don't work. and the 'For ' loop where it adds the JAR files for Ant to the class path didn't work because 'jakarta-ant-1.5' is too long a filename for DOS
    I don't know if WIndows XP has this problem though...
    Can you get java itself to work? If you type 'Java -version' do you get
    the version?
    What exactly is the error??
    Exception in thread "main" java.lang.NoClassDefFoundError:
    is it:
    .. NoClassDefFoundError: org.apache.ant.Main ?? or soemthing like that
    that will tell you what class can not be found.....

  • Jwsdp - examples  ant install problem

    hi,
    this is what i get when trying to install bookstore1 example app with ant (-verbose)install.
    ant prepare and ant build worked successfully. can someone give me a hint what i have to change? thanks a lot. jens
    Ant version 1.4.1 compiled on July 31 2002
    Buildfile: build.xml
    Detected Java version: 1.4 in: /home/jens/sdk1.4/jre
    Detected OS: Linux
    parsing buildfile /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build.xml with URI = file:/home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build.xml
    Project base dir set to: /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1
    [property] Loading /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build.properties
    [property] Unable to find property file: /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build.properties
    [property] Loading /home/jens/build.properties
    Build sequence for target `install' is [init, prepare, build, install]
    Complete build sequence is [init, prepare, build, install, reload, package, deploy, remove, list, undeploy]
    init:
    prepare:
    build:
    [javac] cart/ShoppingCart.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/cart/ShoppingCart.class is up to date.
    [javac] cart/ShoppingCartItem.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/cart/ShoppingCartItem.class is up to date.
    [javac] util/Currency.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/util/Currency.class is up to date.
    [javac] util/Counter.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/util/Counter.class is up to date.
    [javac] messages/BookstoreMessages.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/messages/BookstoreMessages.class is up to date.
    [javac] messages/BookstoreMessages_es.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/messages/BookstoreMessages_es.class is up to date.
    [javac] database/BookDB.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/database/BookDB.class is up to date.
    [javac] database/BookDetails.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/database/BookDetails.class is up to date.
    [javac] exception/BookNotFoundException.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/exception/BookNotFoundException.class is up to date.
    [javac] exception/BooksNotFoundException.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/exception/BooksNotFoundException.class is up to date.
    [javac] exception/OrderException.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/exception/OrderException.class is up to date.
    [javac] CatalogServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/CatalogServlet.class is up to date.
    [javac] BookDetailsServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/BookDetailsServlet.class is up to date.
    [javac] filters/HitCounterFilter.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/filters/HitCounterFilter.class is up to date.
    [javac] filters/OrderFilter.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/filters/OrderFilter.class is up to date.
    [javac] filters/CharResponseWrapper.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/filters/CharResponseWrapper.class is up to date.
    [javac] ReceiptServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/ReceiptServlet.class is up to date.
    [javac] listeners/ContextListener.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/listeners/ContextListener.class is up to date.
    [javac] BannerServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/BannerServlet.class is up to date.
    [javac] BookStoreServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/BookStoreServlet.class is up to date.
    [javac] ShowCartServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/ShowCartServlet.class is up to date.
    [javac] CashierServlet.java omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/classes/CashierServlet.class is up to date.
    [copy] web.xml omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/WEB-INF/web.xml is up to date.
    [copy] duke.books.gif omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/duke.books.gif is up to date.
    [copy] errorpage.html omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/errorpage.html is up to date.
    [copy] context.xml omitted as /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build/META-INF/context.xml is up to date.
    install:
    [install] FAIL - Encountered exception java.io.IOException: java.lang.reflect.InvocationTargetException
    BUILD FAILED
    /home/jens/jwsdp-1_0_01/docs/tutorial/examples/web/bookstore1/build.xml:91: FAIL - Encountered exception java.io.IOException: java.lang.reflect.InvocationTargetException
    at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:278)
    at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:171)
    at org.apache.catalina.ant.InstallTask.execute(InstallTask.java:157)
    at org.apache.tools.ant.Task.perform(Task.java:217)
    at org.apache.tools.ant.Target.execute(Target.java:184)
    at org.apache.tools.ant.Target.performTasks(Target.java:202)
    at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    at org.apache.tools.ant.Main.runBuild(Main.java:454)
    at org.apache.tools.ant.Main.start(Main.java:153)
    at org.apache.tools.ant.Main.main(Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.launcher.Launcher.main(Launcher.java:208)
    --- Nested Exception ---
    FAIL - Encountered exception java.io.IOException: java.lang.reflect.InvocationTargetException
    at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:274)
    at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:171)
    at org.apache.catalina.ant.InstallTask.execute(InstallTask.java:157)
    at org.apache.tools.ant.Task.perform(Task.java:217)
    at org.apache.tools.ant.Target.execute(Target.java:184)
    at org.apache.tools.ant.Target.performTasks(Target.java:202)
    at org.apache.tools.ant.Project.executeTarget(Project.java:601)
    at org.apache.tools.ant.Project.executeTargets(Project.java:560)
    at org.apache.tools.ant.Main.runBuild(Main.java:454)
    at org.apache.tools.ant.Main.start(Main.java:153)
    at org.apache.tools.ant.Main.main(Main.java:176)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sun.launcher.Launcher.main(Launcher.java:208)

    Unable to load the launcher file index. Invalid file type in file index.
    what is wrong here? ive downloaded file for 3 hours and this is what i get?

  • "ant install" command problem-JWSDP EA2

    Hello. I get an error message like the following:
    "Server returned HTTP response code: 401 for URL ..." when I invoked the "ant install" command. According to the tutorial, it says I need create a "build.properties" file in my home directory. It said for Windows 2000 it is c:\Documents. But I have W98SE and by default I do not have a Documents directory. So I created the Documents folder under the root directory of my local c: drive (c:\Documents). I then created a build.properties file that has the username and password as determined in the tomcat-users.xml file. Then I saved the file in c:\Documents folder. I executed the "ant install" command and I still get the error message. Then I was thinking that perhaps for W98SE, my home directory is c:\My Documents since that is my default directory when I'm saving files in Office applications. So I repeated the above, but saved the build.properties in c:\My Documents instead. But I still get the error message. I even enclosed my username and password in double-quotes and without double-quotes, but again I still get the error message. Please help. Thanks.

    I found out that my "home" directory is c:\windows based on this:
    System.out.println(System.getProperty("user.home"));
    But, I still get that "...Server returned HTTP response code: 401 for URL: http://localhost:8080/manger/install..." after I saved my build.properties file in the c:\windows folder. This is getting frustrating. arrrrrgh!!!! If I don't get any help, I guess I'm just going to install just the standalone Tomcat installation instead of the installation that came with JWSDP EA2. This ANT thing is getting on my nerve. :) It seems I could just use DOS batch files, which would similarily accomplish what the ANT tool is doing.

  • Upgrading to JAXB/JWSDP1.3 from JAXB/JWSDP 1.2 -- problems

    I am seeing 2 problems after upgrading to the JAXB found in WSDP 1.3 (from 1.2)
    We are using JAXB in a client/server style app where the server is accessed via a web interface and the client is delivered via Java Web Start (JWS). Both the server and client use JAXB-generated classes.
    We have an ant build.xml file that invokes xjc and this was working for us as expected.
    For the JWS piece, we need to sign the jars we use and for testing purposes we were self-signing them, including the jar files needed for JAXB also self-signed. This is also coordinated through an ant task.
    After replacing the jar files in our lib area with the ones from my recent download of the 1.3 version of JAXB the following happens.
    1. I am seeing compiler deprecation warnings for the generated code -- this did not happen in our use of JAXB from 1.2. For example:
    [javac] /Users/jjs/Projects/SGS-Install-Fixed/sgs/src/com/gestalt/sgs/uobdif/impl/runtime/SAXMarshaller.java:259: warning: ERR_MISSING_OBJECT in com.sun.xml.bind.marshaller.Messages has been deprecated
    [javac] Messages.format(Messages.ERR_MISSING_OBJECT), null,
    [javac] ^
    I am using Java 1.4.1 on Max OS X (I know... not supported but this doesn't seem like a platform dependency) and these warnings go away if I revert back to the JAXB jars from the 1.2 release of WSDP.
    2. These are only warnings, so my build proceeds with ant. But, when I get to the jar signing step I see:
    [signjar] Signing Jar : /Users/jjs/Projects/SGS-Install-Fixed/sgs/lib/jaxb-libs.jar
    [signjar] jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 63854 but got 19845 bytes)
    I looked at the jar file using the jar command and there are entries there:
    4038 Wed Dec 03 22:16:20 EST 2003 META-INF/MANIFEST.MF
    3303 Wed Dec 03 22:16:20 EST 2003 META-INF/SUN_MICR.RSA
    3780 Wed Dec 03 22:16:20 EST 2003 META-INF/SUN_MICR.SF
    0 Wed Dec 03 22:16:20 EST 2003 META-INF/pack.properties
    that suggest to me that perhaps the jar is now sigend by Sun and therefore can't be signed again. If I look at the corresponding jar from the JAXB/1.2, these SUN_MICR entries do not appear.
    Is this assumption correct? Can I deliver my app through web start with my apps own jars self-signed and the JAXB jars signed by Sun? I suppose I can un-jar the JAXB jars, remove the manifest material and then re-jar the files and sign those. I expect this might work.
    I am looking to share migration experiences (1.2 to 1.3) and to see what work-arounds there might be.
    Thanks
    Jim

    Replying to my own post.
    It seems that with the JWSDP 1.3 release, most (if not all) of the included jars are signed by Sun. You can NOT include jars with different signatures in the same web start application -- that's the error I get when I tried to do this.
    This means that if I want to package my jars using a self-signed certificate, I have to first un-jar all of the JAXB lib jars I want to include, get rid of the parts of the manifest that deal with signing, re-jar them and then sign all of the jars in my web start app using my own cert. More work for me, but not a show-stopper.
    I still am not sure why I am getting deprecated warnings from javac though.
    Jim

  • Creating And Deploying A JWSDP Web Service Client to Weblogic 8.1

    This setup produces an EAR containing a message driven bean in a jar file. When the MDB receives a message
    it checks to see if there is any data in a database table and if so calls the web service with that data. These instructions
    are for MS-Windows environments.
    In my setup I have:
    the weblogic domain at c:\b2b80
    the jwsdp at c:\apps\jwsdp-1.3
    extra jar files for the app server in c:\b2b80\lib
    the main weblogic installation at c:\apps\weblogic810\
    1> Download the the JWSDP version you wish to use and install it. (In this example I'm using 1.3)
    2> Create a project structure for you client like this:
         /project
              /earbuild
                   /META-INF
              /ejbbuild
                   /META-INF
              /ejbsource
              /wssource
    3> in the /project directory you will need a build.xml file that looks something like this: (the ant build targets are described at the end of this document)
    ==============================================================
    <?xml version="1.0"?>
    <project name="svcowner" default="buildall" basedir=".">
         <property file="classpath.settings"/>
         <property name="wssource" value="wssource"/>
         <property name="ejbsource" value="ejbsource"/>
         <property name="compileejbdest" value="ejbbuild"/>
         <property name="earbuilddest" value="earbuild"/>
         <property name="jarfilename" value="svcownerejb.jar"/>
         <property name="earfilename" value="svcowner.ear"/>
         <property name="debug" value="true"/>
         <property name="deprecation" value="true"/>
         <!-- this runs the create.bat which has all of the wscompile parameters -->
         <target name="cmdline_wscompile">
              <exec executable="wssource/create.bat"/>
         </target>
         <target name="compileejb" depends="cmdline_wscompile">
              <javac debug="${debug}" srcdir="${wssource}" classpath="${BUILD_CLASSPATH}"
                   destdir="${compileejbdest}" includes="**/*.java" deprecation="${deprecation}"/>
              <javac debug="${debug}" srcdir="${ejbsource}" classpath="${BUILD_CLASSPATH}"
                   destdir="${compileejbdest}" includes="**/*.java" deprecation="${deprecation}"/>
         </target>
         <target name="buildejbjar" depends="compileejb">
              <jar jarfile="${earbuilddest}/${jarfilename}" manifest="${compileejbdest}/META-INF/MANIFEST.txt">
                   <fileset dir="${compileejbdest}">
                        <include name="**/*.*"/>
                   </fileset>
              </jar>
         </target>
         <target name="buildear" depends="buildejbjar">
              <jar jarfile="${earfilename}">
                   <fileset dir="${earbuilddest}">
                        <include name="**/*.*"/>
                   </fileset>
              </jar>
         </target>
         <target name="deploy">
              <copy file="${earfilename}" todir="../../config/domain/applications"/>
         </target>
         <target name="buildall" description="build everything" depends="buildear, deploy">
         </target>
    </project>
    ==============================================================
    4> You need a matching classpath.settings file in the same directory, something like this:
    ==============================================================
    BUILD_CLASSPATH=/b2b80/lib/saaj-impl.jar;/b2b80/lib/saaj-api.jar;/b2b80/lib/jaxrpc-api.jar;/b2b80/lib/jaxrpc-impl.jar;c:/b2b80/lib/jaxrpc-spi.jar/b2b80/classes/;/b2b80/classes;/apps/weblogic810/server/lib/weblogic.jar;/apps/weblogic810/server/lib/weblogic_sp.jar;/apps/weblogic810/server/lib/xmlx.jar;/apps/weblogic810/server/ext/weblogic-tags.jar;/apps/weblogic810/server/ext/jdbc/oracle/920/ojdbc14_g.jar;/b2b80/lib/log4j.jar
    ==============================================================
    5> In the /project/earbuild/META-INF directory you need an application.xml file:
    ==============================================================
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN' 'http://java.sun.com/j2ee/dtds/application_1_2.dtd'>
    <application>
    <display-name>svcownerb2b</display-name>
    <description>Application description</description>
    <module>
    <ejb>svcownerejb.jar</ejb>
    </module>
    </application>
    ==============================================================
    6> The /project/ejbsource directory contains the source for the client application. In my case this is a message driven bean (note that code below isn't complete). The most important part of the code below is the setting of the javax.xml.soap.MessageFactory system property.
    System.getProperties().put("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
    If you don't do this a weblogic class will be used and the code will fail.
    ==============================================================
    package com.svcclient.ejb.svcownershipment;
    import java.text.*;
    import java.io.*;
    import java.sql.*;
    import java.util.Properties;
    import javax.ejb.*;
    import javax.jms.*;
    import javax.naming.*;
    import javax.sql.DataSource;
    import com.svcclient.util.*;
    import org.w3c.dom.*;
    import com.svcclient.websvc.svcowner.*;
    import javax.xml.rpc.Stub;
    public class SvcOwnerShipmentSubscriberMDB implements MessageDrivenBean, MessageListener
    private transient MessageDrivenContext mdc = null;
    private static Context context;
    private final static String CLASSNAME = "SvcOwnerShipmentSubscriberMDB";
    private String DATASOURCE_JNDI = "svcclient.b2b";
    private static DataSource mDS = null;
    private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    public SvcOwnerShipmentSubscriberMDB()
    System.getProperties().put("javax.xml.soap.MessageFactory","com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
    try
    if (context == null)
    context = new InitialContext() ;
    if (mDS == null)
    mDS = (DataSource)context.lookup(DATASOURCE_JNDI);
    catch (NamingException ex)
    ex.printStackTrace();
    catch(Exception ex)
    ex.printStackTrace();
    public void onMessage(javax.jms.Message message)
    TextMessage msg = null;
    String ordernumber = null;
    String lineid = null;
    try
    if (message instanceof TextMessage)
    msg = (TextMessage) message;
    ordernumber = msg.getStringProperty("ordernumber");
                   // the JMS message contains a property that is an order number
    createAndSendXML(ordernumber);
    catch (Throwable ex)
    ex.printStackTrace();
    private void createAndSendXML(String ordernumber)
    if(ordernumber==null)
    return;
    PreparedStatement statement = null;
    ResultSet rset = null;
    java.sql.Connection conn = null;
    try
    conn = DBHelper.getConnection(mDS,"SvcOwnerShipmentSubscriberMDB.createAndSendXML");
    statement = conn.prepareStatement("select * from ..."); // you SQL here
    statement.setString(1,ordernumber);
    rset = statement.executeQuery();
    StringBuffer data = new StringBuffer();
    data.append("<? version=\"1.0\"?>\n");
    data.append("<shippingRequest>\n");
    while(rset.next())
    data.append("\t<order_date>"+dateFormat.format(new java.util.Date(rset.getTimestamp("SCHEDULE_SHIP_DATE").getDate()))+"</order_date>\n");
    data.append("\t<brand_name>svcclient</brand_name>\n");
    data.append("\t<shipRequestType>Sale</shipRequestType>\n");
    data.append("</shippingRequest>\n");
              // call the web service with the data from the database
    DataExchanger_Impl impl = new DataExchanger_Impl();
    Stub stub = (Stub)(impl.getDataExchangerSoap());
    DataExchangerSoap dx = (DataExchangerSoap)stub;
    String resp = dx.exchangeData("svcclient", "mypassword", "Sales", data.toString());
    catch(SQLException sqle)
    sqle.printStackTrace();
    catch(Exception e)
    e.printStackTrace();
    finally
    try
    if (rset != null)
    rset.close();
    if (statement != null)
    statement.close();
    if (conn != null)
    conn.close();
    catch(Exception x){}
    public void ejbCreate() { System.out.println("In SvcOwnerShipmentSubscriberMDB.ejbCreate()"); }
    public void setMessageDrivenContext(MessageDrivenContext mdc) { this.mdc = mdc; }
    public void ejbRemove() throws javax.ejb.EJBException { System.out.println("In SvcOwnerShipmentSubscriberMDB.remove()"); }
    ==============================================================
    7> The /project/ejbbuild/META-INF directory needs a MANIFEST.txt file.
    Manifest-Version: 1.0
    8> The /project/ejbbuild/META-INF directory needs a ejb-jar.xml file. This just sets up the MDB which is the client.
    ==============================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <display-name>SvcOwnerShipmentSubscriberMDB</display-name>
    <enterprise-beans>
    <message-driven>
    <display-name>SvcOwnerShipmentSubscriberMDB</display-name>
    <ejb-name>SvcOwnerShipmentSubscriberMDB</ejb-name>
    <ejb-class>com.svcclient.ejb.svcownershipment.SvcOwnerShipmentSubscriberMDB</ejb-class>
    <transaction-type>Container</transaction-type>
    <message-driven-destination>
    <destination-type>javax.jms.Topic</destination-type>
    <subscription-durability>NonDurable</subscription-durability>
    </message-driven-destination>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>SvcOwnerShipmentSubscriberMDB</ejb-name>
    <method-name>onMessage</method-name>
    <method-params>
    <method-param>javax.jms.Message</method-param>
    </method-params>
    </method>
    <trans-attribute>NotSupported</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    ==============================================================
    9> The /project/ejbbuild/META-INF directory needs a weblogic-ejb-jar.xml file.
    ==============================================================
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>SvcOwnerShipmentSubscriberMDB</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>5</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <!-- JNDI Name of the Topic that the SvcOwnerShipmentSubscriberMDB listens for messages on -->
    <destination-jndi-name>jms.svcownerShipmentsTopic</destination-jndi-name>
    </message-driven-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    ==============================================================
    10> The /project/wssource directory needs a dataexchange.wsdl file. This is the WSDL describing the web service
    we want to connect to with our client.
    ==============================================================
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:tns="https://www.svcowner.com/mfg/DataExchange/"
    xmlns:s="http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    targetNamespace="https://www.svcowner.com/mfg/DataExchange/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    name="">
    <wsdl:types>
    <s:schema elementFormDefault="qualified"
    targetNamespace="https://www.svcowner.com/mfg/DataExchange/">
    <s:element name="exchangeData">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="sender" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="transactionType" type="s:string" />
    <s:element minOccurs="0" maxOccurs="1" name="data" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    <s:element name="exchangeDataResponse">
    <s:complexType>
    <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="exchangeDataResult" type="s:string" />
    </s:sequence>
    </s:complexType>
    </s:element>
    </s:schema>
    </wsdl:types>
    <wsdl:message name="exchangeDataSoapIn">
    <wsdl:part name="parameters" element="tns:exchangeData" />
    </wsdl:message>
    <wsdl:message name="exchangeDataSoapOut">
    <wsdl:part name="parameters" element="tns:exchangeDataResponse" />
    </wsdl:message>
    <wsdl:portType name="DataExchangerSoap">
    <wsdl:operation name="exchangeData">
    <wsdl:input message="tns:exchangeDataSoapIn" />
    <wsdl:output message="tns:exchangeDataSoapOut" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="DataExchangerSoap" type="tns:DataExchangerSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="exchangeData">
    <soap:operation soapAction="https://www.svcowner.com/mfg/DataExchange/exchangeData"
    style="document" />
    <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="DataExchanger">
    <wsdl:port name="DataExchangerSoap" binding="tns:DataExchangerSoap">
    <soap:address location="https://svc.svcowner.com/mfg/dataexchange.php" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    ==============================================================
    10> The /project/wssource directory needs a websvc_config.xml file. This file tells wscompile where
    to find the WSDL file and the package name for the generated classes.
    ==============================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
         <wsdl location="wssource/dataexchange.wsdl" packageName="com.svcclient.websvc.svcowner"/>
    </configuration>
    ==============================================================
    11> The /project/wssource directory needs a create.bat file. This just sets up the environment
    and calls the wscompile batch file in the JWSDP. I had to tweak the wscompile.bat file to match
    my environment as well.
    ==============================================================
    SETLOCAL
    SET WSDP=C:\apps\jwsdp-1.3\
    SET ANT_HOME=%WSDP%;apache-ant
    SET PATH=%ANT_HOME%\bin;%WSDP%jaxrpc\bin;%PATH%
    SET JAVA_HOME=c:\apps\weblogic810\jrockit81sp2_141_05
    call wscompile -gen:client -s ./wssource -keep -g -d ejbbuild wssource/websvc_config.xml
    ==============================================================
    12> The /project directory needs a build.bat file. Just a way for me to make sure my
    environment is set up right before doing the build.
    ==============================================================
    SETLOCAL
    SET ANT_HOME=c:\apps\jakarta-ant-1.4.1
    SET PATH=%ANT_HOME%\bin;%PATH%
    SET JAVA_HOME=c:\apps\weblogic810\jrockit81sp2_141_05
    call ant -buildfile build.xml %1 %2 %3 %4 %5 %6 %7 %8 %9
    ==============================================================
    13> You need to copy the following jar files from the JWSDP into a location they can be used by the
    app server during run time and also for the build process. In my set up this is c:\b2b80\lib. Note that
    these are pointed to by the file in step 4.
    c:\apps\jwsdp-1.3\jaxrpc\lib\jaxrpc-api.jar
    c:\apps\jwsdp-1.3\jaxrpc\lib\jaxrpc-impl.jar
    c:\apps\jwsdp-1.3\jaxrpc\lib\jaxrpc-spi.jar
    c:\apps\jwsdp-1.3\saaj\lib\saaj-api.jar
    c:\apps\jwsdp-1.3\saaj\lib\saaj-impl.jar
    14> You must make sure that the jar file in step 13 are at the front of the classpath for the
    weblogic server. WL comes with classes that conflict with these jars.
    15> I also had to add the root ssl certificate from the partners certificate authority to the java keystore
    using the keytool because this service uses SSL:
    C:\apps\weblogic810\jrockit81sp2_141_05\jre\bin>keytool -import -keystore ..\lib\security\cacerts -alias svcownerroot -keypass password -file c:\temp\svcownerroot.cer
    ==============================================================
    So the idea is this, you run the /project/build.bat file from within the /project directory. This
    calls ant which uses the build.xml file to create everything and copy the EAR to the weblogic deployment
    directory. The default ant target is buildall.
    The cmdline_wscompile target runs the /project/wssource/create.bat file which in turn runs the wscompile.bat
    file from the jwsdp. This causes the dataexchange.wsdl file to processed and the client files to be generated.
    The generated java files go into the /project/wssource directory. The generated class files go into the
    /project/ejbbuild directory. They need to be there so the MDB can use them.
    Next the compileejb ant target compiles the MDB java file and places the resulting class file into the
    /project/ejbbuild directory.
    Next the buildejbjar ant target takes everything in the /project/ejbbuild directory and creates the ejb jar
    file that will be included in the EAR. This file is placed in the /project/earbuild directory.
    Finally the buildear ant target takes everything in the /project/ejbbuild directory and produces the EAR
    file for deployment. The EAR file is placed in the /project directory.
    The deploy task simply copies the EAR file into the weblogic domain applications directory.

    It's really the web service that determines what kind of authentication is required. You can't just use any old strategy. If the web service isn't expecting it in that form, it won't work. Typically, either HTTP BASIC Auth or WS-Security is used. You'd have to contact the people responsible for the web service to know what kind of auth it requires.

  • JWSDP and J2EE Integration: Doesn't work. What's the point?

    My problems involve the integration of JWSDP and J2EE as described in these two documents:
    http://developer.java.sun.com/developer/technicalArticles/WebServices/wsj2ee/
    http://java.sun.com/j2ee/documentation/windows_guide.html
    It looks like a long one, but it�s really not that bad. All comments are appreciated.
    I�ve numbered each line-paragraph-section for easy reference later.
    (1) My ultimate goal is to setup a website that displays data from a database. I will use Java, Apache, Oracle, and whatever else I need to create a website that uses servlets, JavaServer Pages (JSP), and JDBC.
    (2) I�ve got four Pentium III computers:
    1. Windows 2000 Server to be the web server (MyWebServer, IP = 10.10.1.1).
    2. Windows 2000 Professional to be the database server (MyDatabaseServer, IP = 10.10.1.2).
    3. Windows 2000 Professional that I use to develop and test (MyDeveloperPC, IP = 10.10.1.3).
    4. Windows 2000 Professional that I use as a client to connect to the website (MyClientPC, IP = 10.10.1.4).
    (3) On MyWebServer I installed the following:
    Java 2 Standard Edition (J2SE)
    Java 2 Enterprise Edition (J2EE)
    Java Web Services Developer Pack (JWSDP)
    The JWSDP tutorial
    Apache HTTP Server
    (4) The files I downloaded and installed are as follows:
    j2sdk-1_4_0-rc-win.exe
    j2sdkee-1_3_1-win.exe
    jwsdp-1_0-ea1-win.exe
    jwsdp-1_0-ea1_01-tutorial.zip
    apache_1.3.23-win32-x86-no_src.exe
    (5) After installing these products, I set the environment variables as follows:
    JAVA_HOME = c:\j2se
    J2EE_HOME = c:\j2ee
    JWSDP_HOME = c:\jwsdp
    Path = c:\j2se\bin;c:\j2ee\bin;c:\jwsdp\bin; [and other previous statements]
    (6) I checked to see that Apache is running as a service. It is.
    On MyWebServer I start Tomcat and J2EE. Both start properly and are operating simultaneously.
    (7) From MyClientPC I open Internet Explorer and in the address box I type:
    http://10.10.1.1
    This displays the page c:\ApacheHTTP\apache\htdocs\index.html.en (The Apache default server installation page.)
    (8) I then enter this address in IE:
    http://10.10.1.1:8080
    This displays the page c:\jwsdp\webapps\root\index.html (The default JWSDP page).
    (9) I then enter this address in IE:
    http://10.10.1.1:8000
    This displays the page c:\j2ee\public_html\index.html (The J2EE 1.3 Default Home Page).
    (10) So far so good. Now I want to test JWSDP as a container for JSP pages.
    (11) I use ant to build the converter app found in the tutorial examples (in folder c:\jwsdp\�\tutorial\examples\gs). I then deploy the converter app to the c:\jwsdp\webapps\gs folder.
    (12) From MyClientPC I open Internet Explorer and in the address box I type:
    http://10.10.1.1:8080/gs
    The converter app works perfectly.
    (13) To eliminate the need to enter the port number, I create a link from the Apache default server installation page to the converter app. From MyClientPC and enter this address into IE:
    http://10.10.1.1
    I then click on the link to the converter app and it works perfectly.
    (14) Question: Is this the best way to display JSP pages without having to enter the port number?
    (15) Now it�s time to integrate JWSDP and J2EE as described in these two documents:
    http://developer.java.sun.com/developer/technicalArticles/WebServices/wsj2ee/
    http://java.sun.com/j2ee/documentation/windows_guide.html
    (16) After I complete this integration I cannot start both Tomcat and J2EE at the same time. This makes sense because they both share port 8080.
    I start Tomcat.
    (17) From MyClientPC and use Internet Explorer to test the various relevant addresses. Everything works the same as it did before except this one:
    http://10.10.1.1:8000
    The page cannot be displayed. The J2EE default home page is not displayed, which makes sense because the J2EE port is no longer 8000; it has been changed to 8080.
    (18) Now I shutdown Tomcat and start J2EE.
    From MyClientPC and use Internet Explorer to test the various relevant addresses:
    (19) http://10.10.1.1:8080
    Displays the JWSDP default home page.
    (20) http://10.10.1.1:8080/gs
    The page cannot be displayed. The converter app no longer works.
    (21) From MyWebServer and use Internet Explorer to test localhost:
    http://localhost:8080
    This displays the J2EE default home page.
    (22) Question: Why does localhost give me a different page than the IP address?
    (23) Question: What was the point of integrating JWSDP and J2EE?
    (24) I want to get the converter app working, so I create a .war file and attempt to add it to the J2EE deploytool (see the two integration documents listed above at section 15.) I create the .war file following the instructions in the JWSDP tutorial:
    http://java.sun.com/webservices/docs/ea1/tutorial/doc/WebApp3.html#64606
    (25) I change to the c:\jwsdp\�\tutorial\examples\gs\build folder.
    I then type:
    jar cvf converter.war .
    A .war file is created.
    (26) I open the deploytool: File, New, Application, and I name it �converter�.
    I attempt to add the .war file: File, Add to Application, Web WAR.
    (27) When I attempt to add the converter.war file I get this error:
    �converter.war does not appear to be a valid web JAR.�
    I tried a few different attempts, all with the same result. I�m stuck.
    (28) I ask again, What was the point of integrating JWSDP and J2EE?
    (29) If this is the preferred configuration, how do I display my JSP pages like the converter app?
    Please help!!!

    The JWSDP tutorial says to be in the �build� folder of the example when issuing the jar command to create the .war file. The build folder is created when I run the �ant build� command.
    Attempt 1 from the command prompt in folder c:\jwsdp\tutorial\examples\gs\build>
    I typed this command:
    jar cvf c:\jaxmservices\converter.war .
    In this case I directed the .war file to be placed in a different folder as you suggested. Here�s the output:
    added manifest
    adding: index.jsp(in = 921) (out= 525)(deflated 42%)
    adding: WEB-INF/(in = 0) (out= 0)(stored 0%)
    adding: WEB-INF/classes/(in = 0) (out= 0)(stored 0%)
    adding: WEB-INF/classes/Converter.class(in = 582) (out= 358)(deflated 38%)
    Didn�t work. Same error as before.
    Attempt 2 from the same folder:
    I typed this command as you suggested (I tried it with and without the final dot):
    jar tvf converter.war
    Here is the output:
    java.io.FileNotFoundException: converter.war (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:103)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at sun.tools.jar.Main.run(Main.java:185)
    at sun.tools.jar.Main.main(Main.java:904)
    I tried a few other variations on these attempts with no luck. I�m stuck.
    I�m attempting to create a .war file out of two files: index.jsp and converter.class.
    Now that I�ve integrated JWSDP and J2EE, is there some other way that I can run the converter app instead of a .war file and the deploytool? In other words, if I go back to using ant to build and deploy converter, where would I deploy it so that it will work with J2EE?
    By the way, it doesn�t have to be converter. I�d be happy if I could get any JSP page to work in J2EE after the integration.
    Forever grateful,
    Logan

  • Deploying servlet on Tomcat using "ant install" not working. Please help.

    Hello. Normally I can find answers by using search, but I can't today for some reason. So please bare with me if this has been mentioned before. I will try to provide as much info as possible so that helping me isn't too much a chore. Thank you.
    I have downloaded and installed the JWSDP 1.3. and Tomcat is running. I am also using Ant 1.5.4 (previous installation - not one included with JWSDP) and modeled my build.xml file after the template provided here:
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/build.xml.txt.
    When I run ant on my respository, everything builds fine. But when I run Ant with the install target, I get the following error:
    BUILD FAILED
    file:C:/owl/build.xml:366: java.io.IOException: Server returned HTTP response co
    de: 401 for URL: http://localhost:8080/manager/deploy?path=%2Fowl&war=file%3A%2F
    %2FC%3A%5Cowl%2Fbuild
    Here is line 366 build.xml:
    localWar="file://${build.home}"/>
    ...which is included in this block for the target "install":
    <target name="install" depends="compile"
    description="Install application to servlet container">
    <deploy url="${manager.url}"
    username="${manager.username}"
    password="${manager.password}"
    path="${app.path}"
    localWar="file://${build.home}"/>
    </target>
    When I point my brower to the url located in the error verbose, I get the following:
    FAIL - Encountered exception java.lang.NullPointerException
    I am trying to get my environment set up correctly before I start spending time developing servlets, but I am getting tempted to just develop to servlets and "manually" installing/deploying them either by copying and pasting or by using the Tomcat manager. I would really like to do everything from Ant though if possible. Please help.

    I don't think this is at all correct:
    localWar="file://${build.home}"/>You've got to create a real WAR file - a JAR file with WEB-INF and all its minions inside it:
    http://access1.sun.com/techarticles/simple.WAR.html
    That's the file you need to refer to there. You can manage that with Ant too, of course.
    Here's what my Ant build.xml looks like for Web apps (there's a build-web.properties file that follows):
    build-web.xml
    <project name="Tomcat Build Tasks" default="clean" basedir=".">
        <target name="init-props">
            <tstamp>
                <format property="touch.time" pattern="MM/dd/yyyy hh:mm aa" />
            </tstamp>
            <filterset id="ant.filters">
                <filter token="DATE" value="${TODAY}" />
                <filter token="TIME" value="${TSTAMP}" />
            </filterset>
            <!-- Load in all the settings in the properties file -->
            <property file="build.properties" />
            <!-- Load in all Tomcat settings in the properties file -->
            <property file="build-web.properties" />
        </target>
        <target name="prepare" depends="init-props">
            <mkdir dir="${war.classes}"/>
            <mkdir dir="${war.lib}"/>       
            <mkdir dir="${manifest}" />
        </target>
        <target name="clean" depends="init-props" description="clean up temporary files">
            <delete file="${project}.war" />   
            <delete dir="${war.root}"/>
            <delete dir="${manifest}" />
        </target>
        <target name="set-tomcat-classpath" depends="prepare">
            <path id="tomcat.class.path">                  
                <fileset dir="${tomcat.home}/bin">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${tomcat.home}/shared/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${tomcat.home}/common/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${tomcat.home}/server/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
                <fileset dir="${ant.home}/lib">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
            </path>              
        </target>
        <target name="create" depends="set-tomcat-classpath" description="create the war file">
            <!-- All files at root level -->       
            <!-- Temporarily put the JSPs at root until you figure this out -->
            <copy todir="${war.root}">
                <fileset dir="${src.jsp}"/>
            </copy>
    <!--
            <copy todir="${war.root}">
                <fileset dir="${src.html}" includes="*.html"/>
            </copy>
    -->
            <copy todir="${war.root}/css">
                <fileset dir="${src.css}"/>
            </copy>
            <copy todir="${war.root}/images">
                <fileset dir="${src.images}"/>
            </copy>
            <copy todir="${war.root}/js">
                <fileset dir="${src.js}"/>
            </copy>
            <!-- All files at the WEB-INF level and below -->       
            <copy todir="${war.web}">
                <fileset dir="${src.etc}" includes="web.xml"/>
            </copy>
            <!-- All files in the CLASSPATH lib -->
            <copy todir="${war.web}/lib">
                <fileset dir="${src.lib}" includes="**/*.jar" excludes="**/*-tests.jar, **/junit.jar"/>
            </copy>
            <!-- Put the dispatcher XML in WEB-INF/config -->
            <copy todir="${war.web}/config">
                <fileset dir="${src.etc}" includes="${project}-config.xml"/>
            </copy>
            <!-- Put XSL stylesheets in WEB-INF/xsl -->
            <copy todir="${war.web}/xsl">
                <fileset dir="${src.xsl}" includes="**/*.xsl"/>
            </copy>
            <!-- Put the project JAR file in WEB-INF/lib -->
            <copy todir="${war.web}/lib">
                <fileset dir="${deploy}" includes="**/${project}.jar"/>
            </copy>
            <!-- Create the manifest -->
            <buildnumber />
            <manifest file="${manifest}/manifest.mf">
                <attribute name="Implementation-Title"      value="${project}" />
                <attribute name="Built-By"                  value="${user.name}"/>
                <attribute name="Build-Date"                value="${TODAY}" />
                <attribute name="Major-Version"             value="${major}" />
                <attribute name="Minor-Version"             value="${minor}" />
                <attribute name="Build-Number"              value="${build.number}" />
            </manifest>
            <!-- Create the WAR file -->
            <jar jarfile="${project}.war"
                 manifest="${manifest}/manifest.mf">
                <fileset dir="${war.root}"/>
                <metainf dir="${src.etc}" includes="context.xml"/>
            </jar>
        </target>
        <target name="create-tomcat-admin-tasks" depends="set-tomcat-classpath">
    <!--
            <pathconvert targetos="windows" refid="tomcat.class.path" property="converted.class.path" />
            <echo message="CLASSPATH: ${converted.class.path}" />
    -->       
            <taskdef name="install"     classname="org.apache.catalina.ant.InstallTask"     classpath="tomcat.class.path"/>
            <taskdef name="remove"      classname="org.apache.catalina.ant.RemoveTask"      classpath="tomcat.class.path"/>       
            <taskdef name="reload"      classname="org.apache.catalina.ant.ReloadTask"      classpath="tomcat.class.path"/>
            <taskdef name="deploy"      classname="org.apache.catalina.ant.DeployTask"      classpath="tomcat.class.path"/>       
            <taskdef name="undeploy"    classname="org.apache.catalina.ant.UndeployTask"    classpath="tomcat.class.path"/>       
            <taskdef name="start"       classname="org.apache.catalina.ant.StartTask"       classpath="tomcat.class.path"/>       
            <taskdef name="stop"        classname="org.apache.catalina.ant.StopTask"        classpath="tomcat.class.path"/>       
            <taskdef name="list"        classname="org.apache.catalina.ant.ListTask"        classpath="tomcat.class.path"/>       
            <taskdef name="resources"   classname="org.apache.catalina.ant.ResourcesTask"   classpath="tomcat.class.path"/>       
            <taskdef name="roles"       classname="org.apache.catalina.ant.RolesTask"       classpath="tomcat.class.path"/>
        </target>
        <target name="install" depends="create-tomcat-admin-tasks" description="install the war file on Tomcat">
            <install    url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}"
                        config="file:/${basedir}/${src.etc}/context.xml"
                        war="file:/${basedir}/${project}.war" />
        </target>
        <target name="remove" depends="create-tomcat-admin-tasks" description="remove the war file on Tomcat">
            <remove     url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="reload" depends="create-tomcat-admin-tasks" description="reload the war file on Tomcat">
            <reload     url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="deploy" depends="create-tomcat-admin-tasks" description="deploy the war file on Tomcat">
            <deploy    url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}"
                        config="file:/${basedir}/${src.etc}/context.xml"
                        war="file:/${basedir}/${project}.war" />
        </target>
        <target name="undeploy" depends="create-tomcat-admin-tasks" description="undeploy the war file on Tomcat">
            <undeploy   url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="start" depends="create-tomcat-admin-tasks" description="start an application on Tomcat">
            <start      url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}"/>
        </target>
        <target name="stop" depends="create-tomcat-admin-tasks" description="stop an application on Tomcat">
            <stop       url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        path="/${project}" />
        </target>
        <target name="list" depends="create-tomcat-admin-tasks" description="list all applications running on Tomcat">
            <list       url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"/>
        </target>
        <target name="resources" depends="create-tomcat-admin-tasks" description="list all resources on Tomcat">
            <resources  url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"/>
        </target>
        <target name="data-sources" depends="create-tomcat-admin-tasks" description="list all data sources on Tomcat">
            <resources  url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"
                        type="javax.sql.DataSource"/>
        </target>
        <target name="roles" depends="create-tomcat-admin-tasks" description="list all user roles on Tomcat">
            <roles      url="${tomcat.manager.url}"
                        username="${tomcat.username}"
                        password="${tomcat.password}"/>
        </target>
    </project>
    build.properties
    # Properties file for setting up an Ant build.xml
    # Project specific items that change each time
    project=api-prototype
    major=1
    minor=0
    version=${major}.${minor}
    jar.name=${project}
    versiondate=${TODAY}
    # Directory structure (these should never change)
    bin=bin
    deploy=deploy
    doc=doc
    manifest=META-INF
    xml=xml
    # Everything under src should come out of a repository
    src=src
    src.bin=${src}/bin
    src.config=${src}/config
    src.data=${src}/data
    src.dtd=${src}/dtd
    src.java=${src}/java
    src.lib=${src}/lib
    src.profile=${src}/profile
    src.properties=${src}/properties
    src.schema=${src}/schema
    src.sql=${src}/sql
    src.templates=${src}/templates
    src.testdata=${src}/testdata
    src.xml=${src}/xml
    src.xsl=${src}/xsl
    # These are created and deleted by Ant each time
    javadocs=javadocs
    reports=reports
    output=output
    output.classes=${output}/classes
    output.lib=${output}/lib
    # Required for proper use of XDoclet
    xdoclet.home = C:/Tools/xdoclet-1.2b3
    build-web.properties
    war.root=war-root
    war.pages=${war.root}/pages
    war.web=${war.root}/WEB-INF
    war.classes=${war.web}/classes
    war.css=${war.web}/css
    war.js=${war.web}/js
    war.lib=${war.web}/lib
    war.tld=${war.web}/tld
    # Properties needed by Tomcat tasks
    ant.home =
    tomcat.home         =
    tomcat.manager.url  = http://localhost:8080/manager
    tomcat.username     =
    tomcat.password     = MOD

  • Problem running car demo jwsdp-1.3,Tomcat 5.0

    Hello. I am having problems running the car demo on the jwsdp-1.3 with Tomcat 5.0.
    I get the following error message:
    "A jar file containing the Servlet 2.3 and JSP1.2 classes is required to compile
    carstore. Please define the property servlet.jar in your build.properties file and ensure
    that the file exists."
    I replaced the jsf EA 4 with the beta, and cleared out the cache in catalina as per the
    installation documents. I am probably missing something here. I checked my path,
    (I am using windows xp) and made sure the jsf directory was in the path.
    Any help would be greatly appreciated. Thanks in advance.
    regards,
    cyuno

    Thanks for your response.
    I changed the path to the tomcat 5.0 that came with the jwsdp-1.3.
    However, I am still getting the same error message. I have checked the build.properties file, the path, the path where ant is located, and the path is pointing to the jwsdp-1.3 directory.
    I have been working with the examples in the java web services tutorial, and for the most part have not had any problems running the examples using the jwsdp-1.3, ant and tomcat 5.0(except for CH 11, on the jaxb examples)
    Thanks again for your help
    regards,
    cy unpingco

  • Help needed with JWSDP-1-2

    Ive just got the developer package to install,
    ant build seems to work fine.
    tomcat seems to boot up no problem (although How can i check this)
    when i use the command: ant install for the example tutorial/example/gs,
    it comes up with the following error
    file:F:/webservices/tutorial/jwsdp-1_2-tutorial/jwstutorial12/examples/common/targets.xml:15: java.i
    o.FileNotFoundException: http://localhost:8080/manager/install?path=%2Fgs&war=file%3A%2Fjwstutorial1
    2%2Fexamples%2Fgs%2Fbuild
    Whe i also try subsequent ant commands such as remove it also complains about the manager like:
    file:F:/webservices/tutorial/jwsdp-1_2-tutorial/jwstutorial12/examples/common/targets.xml:27: java.i
    o.FileNotFoundException: http://localhost:8080/manager/remove?path=%2Fgs
    Should I be able to navigate to:
    http://localhost:8080/manager ???? (i cant anyway)
    Does this mean that the Tomcat manager is not working properly???
    Any help appreciated.

    I managed to hack it a bit. Ive now managed to get hte tomcat to run properly and also build ot run as properly as possible.
    But now im stuck on how to resolve this problem?
    install:
    [install] FAIL - Encountered exception java.lang.IllegalArgumentException: Context path /${context
    .path} must match the directory or WAR file name: file:${build}
    Has anybody got any ideas how hte context path is constructed or how I can change it.
    Is there a simple way to mimic the install process??

Maybe you are looking for