Classpath trouble

ok. I had a ShoppingCart working perfect when it was in one directory. Now, I move it to a different one, and errors arise. I've tried modifying the classpath but nothing works.
// old app directory
c:\jakarta-tomcat-4.0.3\webapps\ROOT\WEB-INF\classes\cart (this works here)
// new app directory
c:\jakarta-tomcat-4.0.3\webapps\ROOT\WEB-INF\classes\vdatabase\cart
// errors
c:\jakarta-tomcat-4.0.3\webapps\ROOT\WEB-INF\classes\cartC:\jakarta-tomcat-4.0.3\webapps\ROOT\WEB-INF\classes\vdatabase\cart>ja
vac AddToShoppingCartServlet.java
AddToShoppingCartServlet.java:18: cannot resolve symbol
symbol : class Item
location: class vdatabase.cart.AddToShoppingCartServlet
Item item = new Item(productCode, description, price, quantity);
^
^
AddToShoppingCartServlet.java:22: cannot resolve symbol
symbol : class ShoppingCart
location: class vdatabase.cart.AddToShoppingCartServlet
ShoppingCart cart = (ShoppingCart) session.getAttribute("Shopping
Cart");
^
This is basically saying all the different ajoining classes aren't being found.
the only thing i did was switch the package to package vdatabase.cart;
// classpath
c:\jakarta-tomcat-4.0.3\webapps\ROOT\WEB-INF\classes\vdatabase\cart;
(note: i removed cart and vdatabase, does not work)
thanks in advance

yes. I changed the package names in all files, but only about 3 of the 8 will eight will compile w/out giving the errors shown above.

Similar Messages

  • Classpath troubles in Solaris 8

    Hi, I'm trying to run my application build on JWSDP1.2 on Solaris 8. I've installed the JWSDP and J2SDK and they work fine. But now I'm stuck with the classpath.
    I use (something like :) the following start script:
    HME="/export/home/NAME"
    JAX="$HME/jwdsp1.2/jaxb/lib"
    JWS="$HME/jwsdp1.2/jwsdp-shared/lib"
    CLSPATH="../:.:$JAR/jaxb-api.jar:$JAR/jaxb-impl.jar:$JAR/jaxb-libs.jar:$JWS/relaxngDatatype.jar:$JWS/namespace.jar"
    java -classpath $CLSPATH -Jar Manager.Jar
    When I run this script in 'HME/Manager' I get the message:
    NoClassDefFoundError: javax/xml/bind/JAXBException
    that class resides in jaxb-api.jar!
    Who can tell me what I've done wrong? I've checked the paths a dozen of times and tried relative as well as absolute paths. I even tried the directory to which /export/home is 'mounted'.
    The application runs fine on Windows XP using the same classpath and jar(name)s...
    Thanks in advance

    Hi!
    In your classpath... aren't you using $JAR instead of $JAX ??
    In the line:
    CLSPATH="../:.:$JAR/jaxb-api.jar:$JAR/jaxb-impl.jar:$JAR/jaxb-libs.jar:$JWS/relaxngDatatype.jar:$JWS/namespace.jar"

  • Advanced classpath troubles :(

    I've tried the general programming thread, searched my #ss off on the internet. A lot of people have (experienced) the same problem as I do now. but believe me NOBODY ever replied to every cry for help. I've seen posts dated from 1999 till now (2003, doh) but noone ever gives a concrete answer. So PLEASE try and help me, and so many others!
    What is my problem:
    I'm trying to run a Java application on Solaris 9 (to which I'm relatively new) this application uses some jars of the JWSDP1.2 packages. When I try to run my application, Java does not seem able to find the jar containing javax/xml/bind/JAXBException according to the message (slashes included)
    I use a script to start my application like this
    [prompt] ./runmgr/
    The script is:
    HME="/export/home/me"
    JAX="$HME/jwsdp1.2/jaxb.lib"
    JWS="$HME/jwsdp1.2.jwsdp-shared/lib"
    JAVA="$HME/j2sdk1.4.2/jre/bin"
    CLASSPATH="./:$JAX/jaxb-api.jar:$JAX/jaxb-libs.jar:$JAX/jaxb-impl.jar:$JWS/namespace.jar:$JWS/relaxngDatatype.jar"
    export CLASSPATH
    $JAVA/java -jar -verbose -classpath $CLASSPATH $HME/Manager/Manager.jar com.response.timber.manager.Manager -c
    # Yes I've tried : java -jar -classpath $CLASSPATH Manager.jar -c
    Some info:
    - I'm logged in as root (I shouldn't, I know)
    - there's no CLASSPATH var already available in the terminal
    - I use a terminal from within X
    - Error message: Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    Yes, I've:
    - checked the paths over and over
    - used absolute and relative pathnames in every possible combination
    - tried environment variables and script variables
    - tried it with and without 'export'ing the classpath
    - tried to run it with the jars in the same dir as the application
    - checked if the/a jar(s) in the classpath contains javax.xml.bind.JABXException.
    The solution will probably simple, but as I feel stupid already, it doesn't matter anymore :) Please help me out...

    I will cover some of the basics, here. Sorry if you already have done so.
    Which jar file is supposed to contain javax/xml/bind/JAXBException.class?
    Is that jar file uncorrupted?
    You have a lot of dependent environment variables in your launch script. Are they being expanded correctly. Is the resultant path to said jar file correct?

  • One more for the classpath experts

    Hi there,
    I am having classpath trouble. Have made a little example of my problem. I have a simple HelloWorld program called Test. Here is what I do...
    First, I try to run it with no CLASSPATH or �classpath info and naturally it fails because it can�t find the Test class.
    [~/mainwebsite_html/core]$ java Test
    Exception in thread "main" java.lang.NoClassDefFoundError: Test Then I put the classpath info in to allow it to find the test class and it is fine. This also works with the full path info.
    [~/mainwebsite_html/core]$ java -classpath . Test
    Hello WorldThen, I move the class file into another directory.
    [~/mainwebsite_html/core]$ cp Test.class otherdir/Test.class I execute the file with the correct classpath info but now it no longer works.
    [~/mainwebsite_html/core]$ java -classpath ./otherdir otherdir/Test
    Exception in thread "main" java.lang.NoClassDefFoundError: otherdir/TestI have tried all sorts of combinations of full path directories, using ./ and not ./ etc.
    It seems so simple that I just don't get why it wont work...
    All answers appreciated.
    regards
    Andrew

    thanks Kayaman - but I don't get it.
    This Test program is not in a package. All I want to
    do it run it. Does that mean I need to cd to that
    directory to run it? (Might be a solution I suppose)No. He's saying that you specified otherdir twice. You only need to specify it in the classpath, not in the class name. If you do combine a directory with the classname, then it refers to the class' package.
    How do I run a java program somewhere else in the
    system (even assuming I get the classpath right?)Just like he showed you: java -classpath theParentDir TheClass
    Side note: You really should put your classes into packages.

  • Compilation problem -- classes in same package

    I feel like I should know the answer to this, but since I can't figure it out, I'll ask it anyway. I have the following three classes, all in the same package. The Dog class compiles just fine. As for the other two, the compiler insists it "cannot find symbol" when it comes to Dog. Can anyone help?
    package com.example;
    public class Dog {
        private String breed;
        public Dog(String breed) {
             this.breed = breed;
        public String getBreed() {
             return breed;
    package com.example;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class ListenerTester extends HttpServlet {
        public void doGet (HttpServletRequest request, HttpServletResponse response)
                       throws IOException, ServletException {
             response.setContentType("text/html");
             PrintWriter out = response.getWriter();
             out.println("test context attributes set by listener<br>");
             out.println("<br>");
             Dog dog = (Dog) getServletContext().getAttribute("dog");
             out.println("Dog's breed is: " + dog.getBreed());
    package com.example;
    import javax.servlet.*;
    public class MyServletContextListener implements ServletContextListener {
        public void contextInitialized(ServletContextEvent event) {
              ServletContext sc = event.getServletContext();
              String dogBreed = sc.getInitParameter("breed");
              Dog d = new Dog(dogBreed);
              sc.setAttribute("dog", d);
        public void contextDestroyed(ServletContextEvent event) {
    }

    Ok, your .java files and .class files are in the correct location.
    What you should have done is:
    1.) Go to C:\tomcat\web-apps\listenerTest\WEB-INF\classes
    2.) compile your program using "javac -cp c:\tomcat\lib\servlet-api.jar;. com/example/*.java" (note the "." on the classpath, which tells java to include the current directory on its classpath).
    It would also be a good idea to have a sparate tree for the sources and the classes.
    And to develop your application independently from the deployment target.
    But those are semi-advanced topics that you could ignore for now.
    Edit: and again: there's nothing wrong with having classpath trouble when starting Java. But it means that you still have to learn some basics, before you should attempt any J2EE development. Seriously, don't do that yet.

  • Trouble Setting Classpath on Windows XP

    I'm having trouble setting up a classpath on Windows XP for SDK1.3.1_04.
    I've tried Control Panel\Advanced\Environment Variables\System Variables. There was a Path variable present, to which I've added:
    c:\jdk1.3.1_04\bin;
    There wasn't a Classpath variable present though. I've tried adding it myself in System Variables as follows:
    Variable name: Classpath
    Variable value: set classpath=.;
    But no joy. When I run "set" from the command prompt, there's no classpath present.
    I'd appreciate any help.
    Cheers.

    Hi,
    I am running on XP (unfortunately), but also win2000 and win98.
    Setting up the classpath is not a problem, although if you are logged in as root, then it does not always show correctly.
    Try logging back in as yourself and then checking the classpah through the set command.
    Altrnatively, if this is not the problem, actualy try a reboot. which should not be necessary.
    best
    kev

  • I am having trouble with the classpath

    I use the jikes compiler, and I am having trouble setting my classpath. The current classpath I have is: C:\program files\java\j2re1.4.0_01\lib\rt.jar
    When I compile my Java file it says that it could not find the directory java/lang.
    I have the program Robocode and the compiler on it uses Jikes, and it works, but when I try to compile one of my files on either Jcreator or MsDos Prompt it doesn't work for me. Can anybody help me on how to set my classpath?

    take a look in the directory tree and see if javac is in it. when i have a path with jre in it, there isn't any compiler just the java runtime environment. you may need to install the jdk.

  • Trouble with classpath?

    I am having a lot of trouble with my classpath, I think. Whenever I open a html file that I wrote, it shows up class appletName not found. I'm pretty sure I am doing something wrong in my classpath. Here is my autoexec.bat file..
    SET COMSPEC=C:\WINDOWS\COMMAND.COM
    SET windir=C:\WINDOWS
    SET winbootdir=C:\WINDOWS
    SET PATH=C:\j2sdk1.4.2_01\bin;C:\WINDOWS;C:\WINDOWS\COMMAND
    SET PROMPT=$p$g
    SET TEMP=C:\WINDOWS\TEMP
    SET TMP=C:\WINDOWS\TEMP
    SET JAVA_HOME=C:\j2sdk1.4.2_01
    SET CATALINA_HOME=C:\windows\desktop\apache
    SET CLASSPATH=.;c:\windows\desktop;C:\windows\desktop\eclipse\resin-3.0.6\lib\jsdk-24.jar;C:\windows\desktop\eclipse\resin-3.0.6\dob\WEB-INF\classes;
    SET RESIN_HOME=c:\windows\desktop\eclipse\resin-3.0.6
    What am I doing wrong? Please help.. (I do set the values into regestry by opening the system information utility thingy).

    I can't say much about the M$ VM.
    But I'll bet the applet is ignoring that CLASSPATH. It's a useless environment variable.
    You've got to put your Java classes in a JAR, set that JAR equal to the codebase, and put it in the right place on the server. When a user requests the page with the applet, the codebase is downloaded from the server.
    What machine have you set the CLASSPATH on? The server or the client? How would the value on one affect the other? The right thing to do is set up the codebase. - MOD

  • Troubles with PATH/CLASSPATH

    I have been trying to set up my PATH/CLASSPATH variables on my WINDOWS XP computer for quite some time but cant quite get it right. In the PATH variable, if I put the entry for the java SDK first, I can use java commands via cmd.exe but I cant use windows commands (such as ping). If I put the default entries at the begining then the java entry at the end, I can use windows commands, but not the java ones. Why does it only register the first entry on the list?
    The CLASSPATH variable works fine.

    Possibly you are including a space " " in the expression?
    They aren't allowed. Here's my path statement (on 98SE):
    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\BATCH;C:\J2SDK1.4.2_01\BIN;C:\PROGRA~1\UTILIT~1;C:\PROGRA~1\WIN98RK
    Copy and paste your statement here if you still have problems.

  • Mac OS / classpath / custom event problem

    I'm having a bit of trouble with a particular classpath
    anomaly, and I have a feeling that it might be a Mac thing.
    Not sure if anyone else can reproduce this, but I managed to
    make a custom event and a class that extends the EventDispatcher
    once. Since then, Flash has refused to admit that any class
    associated with a custom event exists - mostly producing the error
    1046. Even after you take out any references to the event
    dispatcher or a custom event, the class is ignored.
    All my classes are kept in a single 'Packages' folder with
    sub folders that I include in the import statement (I've
    triple-checked the classpath settings, the import statements, and
    the classes themselves - I have probably a hundred or so other
    classes that are fine, and all referenced in the same way, some
    that extend EventDispatcher, some that don't.
    I come across this a few times now - once I was able to fix
    it by putting the .as file in the same folder as my first custom
    event, but this no longer works.
    I'm running Mac OS X 4.11 on two computers - both have the
    same trouble.
    I've tried copying the classes to other folders and changing
    the package/import path accordingly - no go.
    Even stranger, if you copy and paste to a new .as file, and a
    different package folder, the problem persists in that Flash claims
    the revised Package statement (to reflect the new location) does
    not reflect the position of the file - when it clearly does.
    I haven't had this problem with any other home-grown class -
    only those that reference a custom event.
    It sounds like it should be pilot error, and I've spent a
    long time trying to spot a silly mistake. But as this problem has
    recurred a few times now, I'm beginning to think it isn't me.
    Anybody else experience similar classpath problems with AS3
    on a Mac? Anybody have any suggestions?

    I am also a newbie and my answer could be wrong.
    But from the looks of it, You are Unable to load performance pack.
    The solution is "Please ensure that libmuxer library is in :'.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    I hope BEA or someone can tell you the file name of libmuxer. And make sure it is in the Folder where the script is searching/looking.
    Good luck.
    fred

  • Can't import schemas in classpath when generating JAXB

    I'm trying to create schemas that are used to provide basic components for more complex schemas, using the same design idea behind creating abstract Java classes and then extending them. I'm having trouble referring to classes in different modules, though. Below is the start of a schema that refers to a schema that is stored in another jar file:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://xml.kitfox.com/schema/tw/ts"
        elementFormDefault="qualified"
        xmlns:tns="http://xml.kitfox.com/schema/tw/ts"
        xmlns:cmn="http://xml.kitfox.com/schema/common">
        <xsd:import schemaLocation="/com/kitfox/common.xsd" namespace="http://xml.kitfox.com/schema/common"/>
        <xsd:complexType name="sourceType">
            <xsd:attribute name="uid" type="cmn:uidType"/>
        </xsd:complexType>I'm generating my JAXB with the following task:
        <target name="bind-preferences" depends="init">
            <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
                <classpath>
                    <pathelement path="${javac.classpath}"/>
                </classpath>
            </taskdef>
            <xjc destdir="gen" extension="true" removeOldOutput="true">
                <schema dir="src">
                    <include name="**/*.xsd"/>
                </schema>
                <produces dir="gen">
                    <include name="**/*.java"/>
                </produces>
            </xjc>
        </target>Unfortunately, this causes the following error:
    [WARNING] schema_reference.4: Failed to read schema document '/com/kitfox/common.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
      line 9 of file:/C:/dev/kitfox.com/gameEngine/proj/tileWorld/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'type definition' component.
      line 24 of file:/C:/dev/kitfox.com/gameEngine/proj/tileWorld/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'simpleType definition' component.
      line 24 of file:/C:/dev/kitfox.com/gameEngine/proj/tileWorld/src/com/kitfox/tw/ts.xsdI know that the classpath passed into the xjc task contains the jar with my original schema. What can I do so that JAXB finds it? Also, how would I tell JAXB to extend the classes already generated for common.xsd in my original jar rather than regenerating them in the jar I'm compiling?

    Thanks. I've looked into using a catalog (the ant task allows you to specify a catalog), but don't think I've got the syntax right. Does the following look right to you?
    <!DOCTYPE catalog
      PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
             "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
    <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
             prefer="public">
      <uri name="common.xsd"
       uri="../gb/src/com/kitfox/common.xsd"/>
    </catalog>I've changed my schema to look like:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://xml.kitfox.com/schema/tw/ts"
        elementFormDefault="qualified"
        xmlns:tns="http://xml.kitfox.com/schema/tw/ts"
        xmlns:cmn="http://xml.kitfox.com/schema/common">
        <xsd:import schemaLocation="common.xsd" namespace="http://xml.kitfox.com/schema/common"/>
        <xsd:complexType name="sourceType">
            <xsd:attribute name="uid" type="cmn:uidType"/>
        </xsd:complexType>I'm still getting errors:
    [WARNING] schema_reference.4: Failed to read schema document 'common.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
      line 9 of file:/C:/dev/kitfox.com/proj/tw/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'type definition' component.
      line 24 of file:/C:/dev/kitfox.com/proj/tw/src/com/kitfox/tw/ts.xsd
    [ERROR] src-resolve: Cannot resolve the name 'cmn:uidType' to a(n) 'simpleType definition' component.
      line 24 of file:/C:/dev/kitfox.com/proj/tw/src/com/kitfox/tw/ts.xsdI've tried some variations such as leaving out the import/@schemaLocation attribute and hoping that the catalog could resolve that with the namespace alone or creating a fake http:// url for the schemaLocation, but none of that works. Would you know what I'm doing wrong with this catalog? The catalog and ant file are in the same directory and the relative path to the common.xsd file is correct.

  • Novice Trying to Set The CLASSPATH Variable

    I am trying to compile a file (which can be downloaded at http://java.sun.com/docs/books/tutorial/getStarted/QandE/FirstClass.java). Despite being able to successfully compile several other files, this particular one will not compile. According to my JAVA Tutorial book, the problem may lie in the CLASSPATH variable, but I am having a great deal of trouble trying to set/understand it. My operating system is WINDOWS 2000. PLEASE HELP!!!

    in win 2000, the classpath can be set by the following process.
    Right Click My Computer icon and click on properties.
    (This can be done by going to the Control Panel and Double Clicking the System icon too).
    Once you have the properties window of the system click on the 'Advanced' tab.
    There is a button called 'Environment variables'.Click on it.
    You will have a part called 'System Variables' there.
    Here there is an entry called Classpath. Just add the entry of what you want to add to the classpath, separating each entry with a ';' semicolon as mentioned there and click on the Set button.
    That should set the classpath.If that does not take effect immediately, restart the system and it will take effect.
    Tell me if it worx.
    All the best. Bye!
    Cheers,
    Win!

  • How can i set the classpath??

    CAN ANYONE PLEASE HELP ME HOW TO SET THE CLASSPATH IN WINDOWS ME ,WHAT IS THE RIGHT CODE TO SET THE CLASSPATH I AM USING JDK1.3 VERSION.
    THANK YOU VERY MUCH
    ERICK LUCCIO

    Try this way Start->Program->System tools-> System Summary>startup .Try to find the variable classpath,make sure the path is correct.The classpath contain the the *.java & *.class you save. I'm also new in java .This path & classpath question is so trouble to me .Now i'm running jdk1.3.1_2 in WINME ,WINNT AND WIN2000 IN no problem.........

  • Trouble running DurableSubscriberExample

    Hi
    I am having trouble running the "DurableSubscriberExample.java" that is in Appendix A of the "Java Message Tutorial" (http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client_samples.html#1002876)
    These are the steps I followed:
    1. I compiled the classes - "DurableSubscriberExample.java" and "SampleUtilities.java".
    2. I stared the j2ee server.
    3. I created a topic called jms/Topic as follows:
    j2eeadmin -addJmsDestination jms/Topic topic
    4. I created a connection factory with a Client ID by copy-pasting the following from the tutorial (section 8.2.3) as instructed:
    j2eeadmin -addJmsFactory jms/DurableTopicCF topic -props clientID=MyID
    5. Then I specified the connection factory name and the topic name on the command line as instructed:
    java -Djms.properties=C:\j2sdkee1.3.1\config\jms_client.properties DurableSubscriberExample DurableTopicCF jms/Topic
    This is the error I get:
    JNDI API lookup failed: javax.naming.NameNotFoundException: DurableTopicCF not found
    Any idea what's wrong?

    I installed J2sdkee1.3.1 to Win98, I can startup the J2ee server. Once I typed j2eeadmin -addJmsDestination MyQueue queue, I got the following message :
    C:\j2sdkee1.3.1\bin>j2eeadmin -addJMSDestination jms/MyQueue queue
    Usage:
    -addJdbcDriver <class name>
    -addJdbcDatasource <jndi name> <url>
    -addJdbcXADatasource <jndi name> <class name> [<xa user name> <xa password>] [-
    rops (<name>=<value>)+]
    -addJmsDestination <jndi name> (queue|topic)
    -addJmsFactory <jndi name> (queue|topic) [-props (<name>=<value>)+]
    -addConnectorFactory <jndi name> [<app name>:]<rar filename> [<xa user name> <x
    password>] [-props (<name>=<value>)+]
    -list<resource type>
    -remove<resource type> <name>
    -removeAll<resource type>
    my j2eeadmin.bat as follow
    @echo off
    REM
    REM Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    REM SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    REM
    rem
    rem Set JAVA_HOME and J2EE_HOME before running this script.
    rem
    if not "%J2EE_HOME%" == "" goto CONT0
    echo ERROR: Set J2EE_HOME before running this script.
    goto END
    :CONT0
    if EXIST "%J2EE_HOME%\bin\setenv.bat" goto CONT1
    echo ERROR: Set J2EE_HOME to the path of a valid j2sdkee.
    goto END
    :CONT1
    call %J2EE_HOME%\bin\setenv.bat
    if not "%JAVA_HOME%" == "" goto CONT2
    echo ERROR: Set JAVA_HOME before running this script.
    goto END
    :CONT2
    if EXIST "%JAVA_HOME%\bin\java.exe" goto CONT3
    echo ERROR: Set JAVA_HOME to the path of a valid jdk.
    goto END
    :CONT3
    rem @echo on
    %JAVA_HOME%\bin\java -Xmx128m -D%SSL_OPTION1%=%SSL_OPTION2% -D%JAAS_OPTION1%=%JAAS_OPTION2% -Dcom.sun.enterprise.home=%J2EE_HOME% -classpath %CPATH% com.sun.enterprise.tools.admin.AdminTool %*
    :END
    I can start up the server. I can use the deploytool, so that my setenv may be correctly.
    Any expert can help me. thank a lottttttttttt

  • Re: servicegen classpath

    HI Kevin,
    Please make sure your webservice.jar is the same version as weblogic.jar. If
    you still can't get it work, could please send me your EJB? and a full
    stack trace can also be very helpful.
    Thanks
    -Neal
    Can you post or send me personally following things..
    "Kevin Jones" <[email protected]> wrote in message
    news:[email protected]...
    No,
    and I'm not sure why it should. Surely all that's doing is adding my
    environment CLASSPATH to the servicegen classpath. I don't have an
    environment classpath set (setting the environment classpath is
    generally regarded as being a bad idea),
    Kevin Jones
    Neal Yin wrote:
    Please check if this works ...
    <path id="class.path">
    <pathelement path="${java.class.path}"/>
    <pathelement location="${WL_HOME}/server/lib/webservices.jar"/>
    <pathelement location="${WL_HOME}/server/lib/weblogic.jar"/>
    </path>
    Thanks
    -Neal
    "Kevin Jones" <[email protected]> wrote in message
    news:[email protected]...
    I'm using the servicegen ant task but I'm having trouble in getting it
    to work if I don't have a global classpath environment variable set.
    This is from the 'simple' sample with WLS 7.0
    <path id="class.path">
    <pathelement location="${WL_HOME}/server/lib/webservices.jar"/>
    <pathelement location="${WL_HOME}/server/lib/weblogic.jar"/>
    </path>
    <target name="ear" depends="check, build-ejb">
    <delete dir="${build}" />
    <mkdir dir="${build}" />
    <copy todir="${build}" file="${dist}/${ejbc_jar_file}"/>
    <servicegen
    destEar="${APPLICATIONS}/${ear_file}"
    warName="${war_file}"
    contextURI="webservice">
    <classpath refid="class.path"/>
    <service
    ejbJar="${build}/${ejbc_jar_file}"
    targetNamespace="http://www.bea.com/examples/Trader"
    serviceName="TraderService"
    serviceURI="/TraderService"
    generateTypes="True"
    expandMethods="True" >
    <client
    packageName="examples.webservices.complex.statelessSession"
    clientJarName="${client_file}"
    />
    </service>
    </servicegen>
    </target>
    I've tried setting the classpath as a ref, as a string and as nested
    elements. In all cases I get a ClassNotFoundException for
    TopLevelDescriptorMBean.class (which is in weblogic.jar)
    If I set my environment classpath to
    classpath=c:\bea\weblogic700\server\lib\webservices.jar;c:\bea\weblogic700\s
    erver\lib\weblogic.jar
    then the task works fine.
    The task is defined via a taskdef
    Am I missing something obvious, or does the task simply not work
    properly with a user defined classpath?
    Kevin Jones

    I got this to work by defining the classpath in the taskdef.. ie
    <taskdef name="servicegen" classname="weblogic.ant.taskdefs.webservices.servicegen.ServiceGenTask"
    classpathref="project.classpath"/>
    <servicegen
    destEar="${build.dist}/${project.name}.ear"
    warName="${project.name}.war">
    <classpath refid="project.classpath"/>
    <service
    javaClassComponents="${webservice.sourceClasses}"
    targetNamespace="${webservice.namespace}"
    serviceName="${webservice.name}"
    serviceURI="${webservice.uri}"
    generateTypes="true"
    expandMethods="false">
    </service>
    </servicegen>
    "Alana" <[email protected]> wrote:
    >
    >
    Hi all!
    I also have the same problem... anything that i can do???
    Thanks!!!!
    "Dan Branley" <[email protected]> wrote:
    Hey,
    Was this problem ever resolved? I'm having the exact same problem as
    Kevin -
    ie, I'm having to put weblogic.jar and webservice.jar on my system classpath.
    thanks,
    Dan
    "Neal Yin" <[email protected]> wrote:
    HI Kevin,
    Please make sure your webservice.jar is the same version as weblogic.jar.
    If
    you still can't get it work, could please send me your EJB? and afull
    stack trace can also be very helpful.
    Thanks
    -Neal
    Can you post or send me personally following things..
    "Kevin Jones" <[email protected]> wrote in message
    news:[email protected]...
    No,
    and I'm not sure why it should. Surely all that's doing is adding
    my
    environment CLASSPATH to the servicegen classpath. I don't have an
    environment classpath set (setting the environment classpath is
    generally regarded as being a bad idea),
    Kevin Jones
    Neal Yin wrote:
    Please check if this works ...
    <path id="class.path">
    <pathelement path="${java.class.path}"/>
    <pathelement location="${WL_HOME}/server/lib/webservices.jar"/>
    <pathelement location="${WL_HOME}/server/lib/weblogic.jar"/>
    </path>
    Thanks
    -Neal
    "Kevin Jones" <[email protected]> wrote in message
    news:[email protected]...
    I'm using the servicegen ant task but I'm having trouble in getting
    it
    to work if I don't have a global classpath environment variable
    set.
    This is from the 'simple' sample with WLS 7.0
    <path id="class.path">
    <pathelement location="${WL_HOME}/server/lib/webservices.jar"/>
    <pathelement location="${WL_HOME}/server/lib/weblogic.jar"/>
    </path>
    <target name="ear" depends="check, build-ejb">
    <delete dir="${build}" />
    <mkdir dir="${build}" />
    <copy todir="${build}" file="${dist}/${ejbc_jar_file}"/>
    <servicegen
    destEar="${APPLICATIONS}/${ear_file}"
    warName="${war_file}"
    contextURI="webservice">
    <classpath refid="class.path"/>
    <service
    ejbJar="${build}/${ejbc_jar_file}"
    targetNamespace="http://www.bea.com/examples/Trader"
    serviceName="TraderService"
    serviceURI="/TraderService"
    generateTypes="True"
    expandMethods="True" >
    <client
    packageName="examples.webservices.complex.statelessSession"
    clientJarName="${client_file}"
    />
    </service>
    </servicegen>
    </target>
    I've tried setting the classpath as a ref, as a string and as nested
    elements. In all cases I get a ClassNotFoundException for
    TopLevelDescriptorMBean.class (which is in weblogic.jar)
    If I set my environment classpath to
    classpath=c:\bea\weblogic700\server\lib\webservices.jar;c:\bea\weblogic700\s
    erver\lib\weblogic.jar
    then the task works fine.
    The task is defined via a taskdef
    Am I missing something obvious, or does the task simply not work
    properly with a user defined classpath?
    Kevin Jones

Maybe you are looking for

  • RFC Connection error duplicate conversation id

    Hello everybody ! I started getting a weird error on my XI RFC Connections, because of this I can't connect to my SLD. When testing the RFC connection "AI_DIRECTORY_JCOSERVER", “Ai_RUNTIME_JCOSERVER”, “LCRSAPRFC” and “SAPSLDAPI” (trans sm59) I get th

  • Updating Requisition No while creating PO via FM-BAPI_PO_CREATE1

    Hi , Our requirement is creating Po via FM BAPI_PO_CREATE1 and we are passing data from other Application through that BAPI. Tracking field of  the Application with SAP is only Requisition No. I want to know in  which field of that BAPI I'll make the

  • Runtime errors in BPM

    Hi all, We have a transformation step that is generating mapping errors at runtime. We do not see alerts generated by default on the alert framework for these errors. Is this expected? Should we be implementing the alert generation specifically insid

  • Why is a color print from CS5 so different from the same image in CS4?

    I have made prints from the same file using CS4 and CS5, and the prints from CS4  are showing what I think is good color.  My monitor is calibrated, and I have always been quite happy with prints from CS4.  When I make prints of the same files using

  • How to find out in which albums a library photo is represented

    Basically my problem is stated in the question, I'm trying to find out in which albums certain library/event photo's are represented. Since I'm moving from albums to events this would be a great help in naming the events. Thanks, Peter