Classpath Confusion

To start I'm just going to give the hierarchy where my files are...
java
  |
bin
  |
src
  |--------------------|
algorithm           guiinterface
  |
rsa
  |
storageI am trying to compile the java file in the 'guiinterface' folder (as package 'guiinterface').
It contains the following code to call classes in the other packages (or subpackages):
import algorithm.Decryption;
import algorithm.Encryption;
import algorithm.IndicatedProcess;
import algorithm.KeyGenerator;
import algorithm.rsa.BadSizeException;
import algorithm.rsa.WrongKeyException;I've managed to compile everything now apart from the guiinterface class as I cannot get my head round what the classpath should be when compiling this. Does anyone here have an idea?
I thought it might be:
javac -classpath "../." src /guiinterface/*.java
But this still comes up with errors as it cannot find the classes. Help!!!

/java/bin/src> javac -classpath . guiinterface/*.java

Similar Messages

  • R12, Environment Variables on Windows, and OBIEE

    Dear Experts,
    I've managed to install R12 on Windows.
    Now, in the global environment variable, Path, the user Oracle has a number of directories in its default PATH, starting with the Oracle apps middle tier.
    C:\oapps\apps\tech_st\10.1.2\bin;     
    C:\oapps\apps\tech_st\10.1.2\jdk\jre\bin\classic;     
    C:\oapps\apps\tech_st\10.1.2\jdk\jre\bin;
    C:\oapps\apps\tech_st\10.1.2\jlib;     
    C:\oapps\apps\tech_st\10.1.3\bin;     
    C:\oapps\db\tech_st\11.1.0\bin;     
    C:\Windows\system32;     
    C:\Windows;     
    I notice that there are .cmd scripts that set the Path.
    This script sets the path to look in: c:\oapps\db
    cd C:\oapps\db\tech_st\11.1.0
    VIS_black.cmd
    echo %PATH%
    C:\oapps\db\tech_st\11.1.0\perl\5.8.3\bin\MSWin32-x86-multithread\;
    C:\oapps\db\tech_st\11.1.0\bin;
    This script sets the path to look in: c:\oapps\apps
    set PATH=""
    cd c:\oapps\apps\apps_st\appl
    VIS_black.cmd
    echo %PATH%
    C:\oapps\apps\apps_st\appl\au\12.0.0\bin;
    I'd like to install OBIEE on the same server. Obviously, I don't want any path conflicts. And, OBIEE uses a different version of java.
    1)
    Do all these Apps directories need to remain in the global PATH environment variable? Or, can the directories be removed from the path, and the scripts can be relied on to set the appropriate variables?
    Thanks a lot!

    if you want global settings (always present, even after reboot), you have to edit the autoexec.bat file, e..g
    SET CLASSPATH=c:\myclasses
    you can set environment variables temporarility in a DOS shell using the same command.
    if possible, you should avoid the CLASSPATH environment variable, and use the -cp or -classpath option for java and javac. This helps a lot to solve classpath confusions.

  • Static variable not static

    Hello
    I've got a little problem.
    I'm writing a Java program and I'm using five variables, all of them static Strings.
    However, at runtime, only four of them are seen as static, the other one is non-static.
    Can someone please explain why?
    Thank you
    later edit
    Actually this is an open-source project and I'm trying to modify a class. Is it somehow possible that they ( as in the authors of the code ) 'locked' the classes so that nobody else could modify them ? Every time I'm trying to add a method or a variable, I get a java.lang.NoSuchFieldError or java.lang.NoSuchMethodError. If this is possible, how is this done?
    Edited by: Nenea_Zap on May 22, 2010 11:02 AM

    OK, I tried it using the all-platforms JMF zip.
    I compiled successfully given the code you pointed to, unmodified.
    Then I added this to the class you mentioned:
    public int phony_number = 15;and was still able to compile successfully.
    The only issue in both cases was that the compiler complained about raw types (non-use of generics).
    I'd suggest creating a new project area, download the code clean, then confirm that you can compile it.
    Then clean the code out -- delete all class files and any jar files that are created as part of building -- make your modification, and compile again.
    If there's a problem post the compiler errors.
    My hunch is that you were compiling, with old version of class files in the classpath, confusing the compiler.

  • Confused about CLASSPATH and how java handles import statements...

    Hello,
    I must admit I don't get it. I read the articles about setting CLASSPATH etc. but I still wonder:
    If you use an import statement, what does the compiler do? I.e. where does it look for the specified classes? I find it confusing because I see in different locations different .jar files:
    C:\jdk1.3.1_03\lib\dt.jar
    C:\jdk1.3.1_03\lib\htmlconvertor.jar
    C:\jdk1.3.1_03\lib\tools.jar
    and also
    C:\jdk1.3.1_03\jre\lib\i18n.jar
    C:\jdk1.3.1_03\jre\lib\rt.jar
    C:\jdk1.3.1_03\jre\lib\jaws.jar
    C:\jdk1.3.1_03\jre\lib\sunrassign.jar
    Can someone explain me what the purpose is of these files?
    And why do I have the same contents in
    C:\Program Files\JavaSoft\JRE\1.3.1_03\lib
    and in
    C:\jdk1.3.1_03\jre\lib
    Why is that?
    Thanks for answering my questions!
    -mike

    Thanx for the answers, but I still wonder, everyone
    here says I need to set the classpath, but I don't.Probably because your classes are already in the class path. The compiler/jvm also look for classes by themselves not just in jar files, when just a directory is supplied in the class path. And a period (".") is a valid directory.
    Programs importing different classes compile with no
    problem. So what's up with that?
    Presumably you are referring to your own code - because they are in the class path.
    Second, I still don't understand why the runtime needs
    the .jar files. The runtime uses classes, like String, that have to come from somewhere.
    This would also mean that end-users
    need to set the classpath to the .jar files in their
    JRE directory to be able to run programs that import
    classes from these .jars. But this is not true, right?No it is true. The end-users will have to set the class path. There are variations on this which make it seem like no class path is set. For instance applets in a browser are java but the end-user does not need to set a class path. That is because the browser knows how to download classes/jars and how to set it up so it uses them. (Actually it uses a class loader, but that is probably more information that you need.)
    Because if I make some nice classes myself and import
    them, how can I expect my end-user to install these
    classes and make a classpath for them?That would be between you and you end-user.
    First installation is not part of java. For installation you will have to find something outside of java to accomplish the goal.
    Additionally how the class path gets set is OS specific. Java does not deal with that. You will also have to find some way to deal with this (most likely part of the installation.)
    There are also variations on this. For example the browser example I gave above. Or using the ext directory. Or creating an executable jar. Or simply setting the class path.
    In my understanding it should only be needed in the JDK, not
    in the JRE. True or am I mistaken?Mistaken. The class path is needed in the JRE as well. You will need to set it.

  • Classpath, weblogic.class.path, server's class path, javaclasspath, serverclasspath ?? confused

    When I type t3config , I see a couple of class paths and I'm confused which
    one is which and
    what are the diffrences between them, there is classpath, javaclasspath,
    serverclasspath, weblogic.class.path
    and JVM class path, Server's class path on the weblogic console window.
    any clearification is appreciated.
    thanks,
    CLASSPATH Prefix
    CLASSPATH
    JAVA_HOME
    WEBLOGIC_LICENSEDIR
    WEBLOGIC_HOME
    system properties
    weblogic.class.path
    INITIAL HEAP
    MAX HEAP
    SERVERCLASSPATH

    Why would you do that - same class in both class paths? Don't.
    Don't put any application classes in the system
    classpath (JAVACLASSPATH).
    Mike
    Dimitri Rakitine <[email protected]> wrote:
    http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_deployover.html#1056256
    Tony Lu <[email protected]> wrote:
    Can someone tell me how does weblogic use the weblogic.class.path? what's
    the relation between weblogic.class.path and systemclasspth ? if I have 2
    different classes ( same name but different ) on bothpath, which one would
    be loaded ? the one in classpath or the one in weblogic.class.path?
    Dimitri

  • I'm confused about classpath

    Please can anyody explain it to me? I have WindowsXP and in my folder i have some program in jar and classes12.zip (oracle jdc classes for version 8i). I try to load the driver ( Class.forName("oracle.jdbc.driver.OracleDriver") ). When I run it via "java -jar someprogram.jar" it throws ClassNotFoundException, when i try "java -classpath classes12.zip -jar someprogram.jar" it is same. But whe I copy classes12.zip to %JREHOME%/lib/ext/ it works. Can anyody explain to me how this mechanism of classloading (locations) works... in books I cannot find anything :( Thx

    The keyword to google for is Extension Mechanism:
    http://java.sun.com/j2se/1.4.2/docs/guide/extensions/spec.html

  • Error Configuration File bc4j.xcfg is not found in the classpath

    I am new to JDeveloper and ADF, and am suffering through the steep learning curve. This story may prove useful to someone, someday.
    I just finished resolving a “bc4j.xcfg is not found in the classpath” error and it added another level of understanding to how things are glued together.
    There is a back story. I had made a first pass at creating a test application. When I was done I started “enhancing” the application. One of the changes was to add a column to a view in the database. Try as I might I could not get that change propagated to the business component. This is still on my to-figure-out list. In frustration I dropped the model and recreated it from the database tables and views. Testing it with the “AppModule” in the model project I could see the view with the new column. However, when I went to run one of my old jspx pages, I now got the dreaded “bc4j.xcfg is not found in the classpath” – and this was for a page that was not using my updated view. As the military expression goes, “Whiskey Tango Foxtrot”.
    It is now working again, and here is what I found.
    I noticed in the error message that it could not find “/cloudapp1/common/bc4j.xcfg”. When I searched for the file I found it in /cloudapp1/model/common/bc4j.xcfg. I went to the project properties for the model project and on the “Project Source Paths” node I saw at the bottom of the page Default Package: cloudapp1.model. Ah Ha! That is where the /cloudapp1/model structure came from. Then I remembered that the first time through I had changed the default package to just cloudapp1. Part of my experimenting with the product. When I quickly rebuilt the model project I did not do that.
    Next I found the DataBindings.cpx that one note alluded to. It is in the ViewController project. There I found an “OC4JDataControl” section. In there was and entry Package=”cloudapp1”. This was the original package name. When I rebuilt the model, this was not updated. Anyway, I changed it to Package=”cloudapp1.model”. [ Insight:  When you first build an app it can make some good guesses about what is needed, but when you start adding and dropping projects it is much harder to guess how they are glued together.]
    Raising a cup of coffee in triumph I re-ran the test page.
    Dang! Still a bc4j.xcfg not found in the classpath – but this time the path mentioned matched the path where I knew the file to be.
    I am nothing if not stubborn. I knew the problem just had to be in the ViewController project, because the AppModule in the model project worked. So, I started going through all of the project properties. I finally came across something called “Dependencies” that had big ugly red circles with an x in them. Ah ha. This is what tells the ViewController what other projects (like the business model project) this ViewController is dependent on. Although the editing process it not obvious I eventually pointed it to the new model project. [Deepening insight.]
    When I re-ran the test page it worked! Coffee finished. Story with a happy ending.
    Summary:
    1.     Make sure the package name in the ViewController DataBindings.cpx matches the one in your model project.
    2.     Make sure the ViewController Dependencies entry points to the model project.

    Thought I'd add a little bit more to this post I found helpful.
    I'm creating an application which uses other application ViewController projects deployed as library .jar files. If your .jar ViewController project deployment profiles don't have your Model project as a dependency, you will get the .bc4j error as well.
    This can be confusing when the ViewController pages function correctly when run within their own application context, but somehow lose their bc4j when deployed as a .jar.
    Hope that helps someone down the road.

  • How to setup resources in a WS project to be loaded from classpath?

    When I came in here to write this note, I saw the recent note titled "Placement of resources in WS project and runtime access", which is very similar to what I needed to know, but it isn't quite the same thing.
    I'm trying to put together a WebLogic WS project where the operations call out to a bean in a Spring context. I think I would use something like "ContextSingletonBeanFactoryLocator.getInstance("classpath*:applicationContext.xml")" in the operation.
    What I'm a little confused about is where I would put the Spring context file in my application. In a "plain" webapp, I would just put it into WEB-INF/classes, but that seems like a "protected" directory in Workshop.
    What is the best way to set this up?

    Ok, I guess I should have been clearer. When I said that "WEB-INF/classes" appears to be a "protected" directory in Workshop, I meant that I can't even see that directory when viewing the project in Workshop. The only way I know it's there (besides knowing it should be there) is when I tried to create that directory in the project, and seeing in the file browser that it's already there.

  • Unexpected element name - confusion of types in client

    I have a web service definition that performs four operations:
    - String getTitle(long) - returns a title for a single asset
    - StringArrayType) getTitles(LongArrayType) - returns an ordered list of titles matching input list
    - AssetSummaryType getSummary(long) - Returns a complex type, summary information of an asset
    - AssetSummaryArrayType getSummaries(LongArrayType) - Returns an array of complex types
    Based on the WSDL (included at the bottom of this posting) I then generate the service
    endpoint using wscompile and -f:wsi option (JDK 1.4.2-05 and JWSDP-1.4).
    This is built into a raw war file and then cooked using wsdeploy.
    On the client side I create stubs using wscompile and -f:wsi and compile
    the resultant code. My client invokes each of the operations in turn, having been
    provided the relevant 'longs' as input.
    The service is deployed in JBoss-3.2.2 and the client is then executed from a separate JVM.
    I then see the following client error:
    java.rmi.RemoteException: Runtime exception; nested exception is:
    unexpected element name: expected={http://example.com/myAssetWebSvc}Str
    ingElement, actual={http://example.com/MyAssetWebSvc}AssetSummaryElement
    at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(
    StreamingSender.java:318)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300
    at example.com.wsclient.asset.AssetService_Stub.getTitle(AssetService_St
    ub.java:175)
    at example.com.wsclient.asset.AssetClient.testAssetTitleRetrieval(AssetC
    lient.java:82)
    at example.com.wsclient.asset.AssetClient.main(AssetClient.java:51)
    Caused by: unexpected element name: expected={http://example.com/MyAssetWebSvc}
    StringElement, actual={http://example.com/MyAssetWebSvc}AssetSummaryElement
    at com.sun.xml.rpc.encoding.literal.LiteralSimpleTypeSerializer.deserial
    ize(LiteralSimpleTypeSerializer.java:106)
    at example.com.wsclient.asset.AssetService_Stub._deserialize_getTitle(As
    setService_Stub.java:318)
    at example.com.wsclient.asset.AssetService_Stub._readFirstBodyElement(As
    setService_Stub.java:276)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:215
    ... 3 more
    If I deploy the same service with only the first two operations defined within wsdl,
    the error is not seen.
    I have also tried compilation on JWSDP 1.3 and JDK 1.4.1-03 and in this case the same error
    occurs but the other way around. The two 'title' operations work but the summary
    operations fail with the actual element encountered being a StringElement or StringArrayElement
    and the expected an AssetSummaryElement or AssetSummaryArrayElement.
    Further, if I change the name of the StringElement to for example 'MyStringElement', this is
    reported as the actual - i.e. there is no confusion with a standard type at play here.
    I also use handlers, one on the server side to inspect security information and one on the
    client to insert relevant details and look for returned errors within the header.
    Is this a known problem within JWSDP 1.3 and/or 1.4? Are there any workarounds.
    My wsdl is provided below along with the wscompile options and the matching configuration
    files used.
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="MyAssetService" targetNamespace="http://example.com/MyAssetWebSvc"
         xmlns:tns="http://example.com/MyAssetWebSvc"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <wsdl:types>
    <xsd:schema targetNamespace="http://example.com/MyAssetWebSvc"
              xmlns:tns="http://example.com/MyAssetWebSvc"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:complexType name="AssetSummaryType">
    <xsd:all>
    <xsd:element name="createdBy" type="xsd:string" />
    <xsd:element name="createdDate" type="xsd:dateTime" />
    <xsd:element name="description" type="xsd:string" />
    <xsd:element name="fileSize" type="xsd:long" />
    <xsd:element name="id" type="xsd:long" />
    <xsd:element name="modifiedBy" type="xsd:string" />
    <xsd:element name="modifiedDate" type="xsd:dateTime" />
    <xsd:element name="organisation" type="xsd:string" />
    <xsd:element name="owner" type="xsd:string" />
    <xsd:element name="title" type="xsd:string" />
    <xsd:element name="type" type="xsd:string" />
    <xsd:element name="version" type="xsd:long" />
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="ExceptionType">
    <xsd:all>
    <xsd:element name="rootCause" type="xsd:string" nillable="true" />
    </xsd:all>
    </xsd:complexType>
    <xsd:complexType name="LongArrayType">
         <xsd:sequence>
              <xsd:element name="LongItem" type="xsd:long" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="AssetSummaryArrayType">
         <xsd:sequence>
              <xsd:element name="AssetSummaryItem" type="tns:AssetSummaryType" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="StringArrayType">
         <xsd:sequence>
              <xsd:element name="StringItem" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
         </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="CredentialsType">
    <xsd:all>
    <xsd:element name="principal" type="xsd:string" />
    <xsd:element name="password" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
         <xsd:element name="LongElement" type="xsd:long"/>
    <xsd:element name="StringElement" type="xsd:string"/>
    <xsd:element name="LongArrayElement" type="tns:LongArrayType"/>
    <xsd:element name="StringArrayElement" type="tns:StringArrayType"/>
    <xsd:element name="AssetSummaryElement" type="tns:AssetSummaryType"/>
    <xsd:element name="AssetSummaryArrayElement" type="tns:AssetSummaryArrayType"/>
         <xsd:element name="CredentialsElement" type="tns:CredentialsType"/>
         <xsd:element name="ExceptionElement" type="tns:ExceptionType"/>
    </xsd:schema>
    </wsdl:types>
    <wsdl:message name="getSummaryMessage">
    <wsdl:part name="resourceId" element="tns:LongElement" />
    </wsdl:message>
    <wsdl:message name="getSummaryResponse">
    <wsdl:part name="assetSummary" element="tns:AssetSummaryElement" />
    </wsdl:message>
    <wsdl:message name="assetException">
    <wsdl:part name="exception" element="tns:ExceptionElement" />
    </wsdl:message>
    <wsdl:message name="getTitle">
    <wsdl:part name="resourceId" element="tns:LongElement" />
    </wsdl:message>
    <wsdl:message name="getTitleResponse">
    <wsdl:part name="assetTitle" element="tns:StringElement" />
    </wsdl:message>
    <wsdl:message name="getSummaries">
    <wsdl:part name="resourceIdList" element="tns:LongArrayElement" />
    </wsdl:message>
    <wsdl:message name="getSummariesResponse">
    <wsdl:part name="assetSummaryList" element="tns:AssetSummaryArrayElement" />
    </wsdl:message>
    <wsdl:message name="getTitles">
    <wsdl:part name="resourceIdList" element="tns:LongArrayElement" />
    </wsdl:message>
    <wsdl:message name="getTitlesResponse">
    <wsdl:part name="assetTitleList" element="tns:StringArrayElement" />
    </wsdl:message>
    <wsdl:message name="securityHeader">
    <wsdl:part name="credentials" element="tns:CredentialsElement" />
    </wsdl:message>
    <wsdl:portType name="AssetService">
    <wsdl:operation name="getSummary" parameterOrder="resourceId">
    <wsdl:input message="tns:getSummaryMessage" />
    <wsdl:output message="tns:getSummaryResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    <wsdl:operation name="getTitle" parameterOrder="resourceId">
    <wsdl:input message="tns:getTitle" />
    <wsdl:output message="tns:getTitleResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    <wsdl:operation name="getSummaries" parameterOrder="resourceIdList">
    <wsdl:input message="tns:getSummaries" />
    <wsdl:output message="tns:getSummariesResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    <wsdl:operation name="getTitles" parameterOrder="resourceIdList">
    <wsdl:input message="tns:getTitles" />
    <wsdl:output message="tns:getTitlesResponse" />
    <wsdl:fault name="AssetException" message="tns:assetException" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="AssetServiceBinding" type="tns:AssetService">
    <wsdl:operation name="getSummary">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal" actor="security"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <wsdl:operation name="getTitle">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <wsdl:operation name="getSummaries">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <wsdl:operation name="getTitles">
    <wsdl:input>
    <soap:header required="true" message="tns:securityHeader" part="credentials" use="literal"/>
    <soap:body use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"/>
    </wsdl:output>
    <wsdl:fault name="AssetException">
    <soap:fault name="AssetException" use="literal"/>
    </wsdl:fault>
    <soap:operation soapAction="" />
    </wsdl:operation>
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    </wsdl:binding>
    <wsdl:service name="MyAssetService">
    <wsdl:port name="AssetServicePort" binding="tns:AssetServiceBinding">
    <soap:address location="http://localhost:9090/MyAssetWebSvc/asset" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Here is the wscompile for the server - this is within an ant script that substitutes the variables specified:
    wscompile -keep -d ${path.classes} -s ${src.autojava} -import -model model.gz -f:wsi -f:documentliteral server-config.xml
    and this is the server config:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="file:///C:temp/MyAssetService_wsi.wsdl" packageName="example.com.wsserver.asset.wrapper">
    <handlerChains>
    <chain runAt="server">
    <handler className="example.com.wsserver.security.SecurityServerHandler">
    <property name="name" value="SecurityServerHandler"/>
    </handler>
    </chain>
    </handlerChains>
    </wsdl>
    </configuration>
    On the client side, here is the wscompile, again with ant variable substitution:
    wscompile -gen:client -keep -d ${path.build.wsclient.class} -s ${path.build.wsclient.autojava} -classpath ${path.build.wsclient.class} -f:wsi -f:documentliteral client-config.xml
    And here is the client config:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
    <wsdl location="file:///C:/temp/MyAssetService_wsi.wsdl" packageName="example.com.wsclient.asset">
    <handlerChains>
    <chain runAt="client">
    <handler className="example.com.wsclient.security.SecurityClientHandler">
    <property name="name" value="SecurityClientHandler"/>
    </handler>
    </chain>
    </handlerChains>
    </wsdl>
    </configuration>
    Note that I generate slightly different packages on client and server side. The server includes a 'wrapper' path on the package name - purely because the
    generated code wrappers an existent api that I am making available as a web service. This is not needed to be seen
    on the client side - i.e. the service appears as is without the wrapper.
    I have tried omitting the documentliteral from the wscompiles and this seems to have no effect.
    Any help gratefully received.
    Best regards
    Lawrence

    Thanks for the prompting. I was convinced that the error was occurring client side as I could see no activity on the server. However having captured the soap request and responses its evident that this is not the case (which I'm a little confused on based on my original tests, but the error makes more sense in this context).
    The request is below:
    <env:Envelope xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://example.com/myAssetWebSvc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <env:Header>
    <ns1:mmsSecurity env:actor="security" env:mustUnderstand="1" xmlns:ns1="http://example.com/myAssetWebSvc">
    <principal>example.user</principal>
    <password>mypassword</password>
    </ns1:mmsSecurity>
    </env:Header>
    <env:Body>
    <ns0:LongElement>166333</ns0:LongElement>
    </env:Body>
    </env:Envelope>
    I can see from the body that the signature is not unique - its the same as that of the Summary operation. In this case, the server side is performing the summary (rather than the title that I had intended) and returning that response. This gives rise to the deserialisation error on the client side for the response.
    Presumably I need to move to the wrapped document literal style so that the request is uniquely identified on the server side.
    To me this was not an obvious gotcha, Could the parser (wscompile) be enhanced to trap identical request message definitions within a single service/endpoint definition (i.e. WSDL)? If so where should I post the request?

  • Runtime classpath issue -- NoClassDefFoundError

    Hi,
    It shames me to post such a common, everyday problem, but I cannot figure this one out.
    I have a class in the package service: service.SynchImage. I have a class in another package as well: vigra.matlab.LOTFClient. In LOTFClient, I am importing service.SynchImage and trying to instantiate it.
    All my source code compiles successfully.
    When I try to run my program, I get a NoClassDefFoundError telling me it cannot find service/SynchImage.
    This is how I am trying to use service.SynchImage (from LOTFClient):
    package vigra.matlab;
    import service.SynchImage;
    public final class LOTFClient implements Runnable {
        private static byte[] in;
        public void run() {
            try {
                if (imAq == null) { //imAq is not relevant
                    throw new Exception("Proxy to LOTFVigra is invalid");
                } else {
                    System.out.println("Connection to LOTFVigra service successful");
                    in = imAq.acquireImage();
                    SynchImage si = new SynchImage(in, 640, 480);
            } catch (Exception e) {
                System.err.println(e.getMessage());
    }Again, this DOES compile successfully. Here is how I am running this class:
    package vigra.matlab;
    public class LOTFDriver {
         public static void main(String[] args) {
              LOTFClient client = new LOTFClient();
              Thread thread = new Thread(client);
              thread.start();
    }Alrighty. I'm using an Ant build script to compile all this. In my build script, I set the classpath to the appropriate directories, as follows:
         <!-- Define the Java classpath -->
         <path id="classpath">
              <pathelement location="${CATALINA_HOME}/webapps/kdb/WEB-INF/classes" />
              <pathelement location="/u/dgresh/Ice-3.1.0/lib/Ice.jar" />
         </path>
         <!-- Compile the Java code -->
         <target name="compile" depends="init">
              <javac srcdir="${src}" destdir="${build}">
                   <classpath refid="classpath" />
              </javac>
         </target>When I browse to $CATALINA_HOME/webapps/kdb/WEB-INF/classes I see the "service" package there. When I browse inside the package, I see "SynchImage.class" there. I found a duplicate "service" package that did not contain the SynchImage.class file and deleted it, but I still get the error.
    Is there anything else I should be checking for? What on earth am I missing? It must be something incredibly obvious, but what is it?
    Oh, here is SynchImage, if it matters:
    package service;
    import java.awt.image.BufferedImage;
    public class SynchImage {
         private static byte[] input;
         private static int width;
         private static int height;
         public SynchImage(byte[] input, int width, int height) {
              this.input = input;
              this.width = width;
              this.height = height;
              ImageProcessor.createAndSaveImage(input, width, height);
         public static BufferedImage fetchImage() {
              return ImageProcessor.createImage(input, width, height);
    }Thanks

    Okay, I'm now very confused.
    In $CATALINA_HOME/webapps/kdb/WEB-INF/classes I was building my project to "LOTFVigra/$project", and the service package to "classes".
    If I don't build it to LOTFVigra/vigra/matlab/*.class and simply build it to CATALINA_HOME/webapps/kdb/WEB-INF/classes/vigra/matlab/*.class, it will run. Why on earth would this occur?

  • JDK upgrade confusion

    I had up-to-date JRE and an older JDK5 and wanted to get latest JDK.
    I installed jdk-1_5_0_08-nb-5_0-win-ml.exe. There is now two JDK directories JDK1.5.0_0[18] , jre1.5.0 and jre1.5.0_0[12468].
    But the environment variables did not get changed.
    CLASSPATH=.;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip
    javabin=C:\Program Files\Java\jdk1.5.0_01\bin
    JAVA_HOME=C:\PROGRA~1\Java\jdk1.5.0_01
    QTJAVA=C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip
    I was expecting one of the updates to correct the environment variables. Or at least a document that explains what needs to be done. I am confused by the JRE vs JDK and what should point to which.
    Can anyone clarify this or point to a doc that does?

    Java installs do not create or update MS's environment variables - do that manually, as explained in the Java Installation Instructions.
    And note that your installed the Netbeans - Java combination package,
    jdk-1_5_0_08-nb-5_0-win-ml.exe
    Uninstall all but the most recent JDK and JRE version, and point the variables to them.

  • Classpath setting

    Hello techies,
    I had installed jdk-1_5_0-rc-windows-i586 in my system.
    I am having windows2000servicepack4.
    I had also installed mysql. I had also installed mysql-connector-java-3.1.8a.zip . I had extracted this zip file.
    It is having 6 JAR files. In the lib folder, i am having the follwoing 4 jar files.
    C:\mySql\mysql-connector-java-3.1.8\lib\aspectjrt.jar
    C:\mySql\mysql-connector-java-3.1.8\lib\aspectjtools.jar
    C:\mySql\mysql-connector-java-3.1.8\lib\jdbc2_0-stdext.jar
    C:\mySql\mysql-connector-java-3.1.8\lib\jta-spec1_0_1.jar
    The remaining 2 jar file are
    C:\mySql\mysql-connector-java-3.1.8\mysql-connector-java-3.1.8-bin.jar
    C:\mySql\mysql-connector-java-3.1.8\mysql-connector-java-3.1.8-bin-g.jar
    I had installed java in
    c:\program files\java
    Mysql in c:\mysql\
    Now i have to set up the classpath.
    I had gone to MyComputer>Properties>Advanced>
    Now i had created two variables claspath n path
    classpath: C:\Program Files\Java\jre1.5.0\lib;.;
    path
    C:\Program Files\Java\jdk1.5.0\bin;.;C:\mySql\mysql-connector-java-3.1.8a.zip;.;
    Now iam able to excute java programs successfully. When i try to connect to mysql through jdbc connection.
    It is showing Class Not Found Exception.
    Does i need to specify those 6 jar file in the classpath (or) i just need to specify in the zip file in the path.
    Can i excute servlet programs by using jdk-1_5_0-rc-windows-i586 without mentioning the servlets jar files in the classpath.
    If not what r the jar files i need to mention in the classpath.
    Does jdk 1.5.0 supports servlets.
    iam always having confusion b/w classpath and path
    Does i need to change the classpath for mysql jdbc connection??
    If so can anybody adjust my classpath n path.
    I will be very thankfull if any body replies
    thanks(inadvance),
    ramu

    That said, you shouldn't have a CLASSPATH environment variable anyway. You do need the PATH, but your classpath should be specified in other ways.
    If you create a project in an IDE, you configure projects in that IDE which involves adding jars and directories to its "libraries" or such, which in effect make up the classpath.
    Or if you use the JDK command-line tools (javac and java), you specify the classpath on the commandline:
    javac -classpath (classpath here) ...
    (same command-line option for the java command-line executable)
    Please follow all the documentation and tutorials on this site...

  • Jars and classpath

    Hi All,
    I have a command line program which access database and somehow connects to a servlet running in Tomcat.
    Originally, the root directory has 2 sub-directories: the classes and the lib. The classes directory contains config files, like database name, port no... The lib dir contains all the jar files needed by my program to run.
    Honestly, it run using: java -cp /path/to/dir/jar1.jar;/path/to/dir/jar2.jar,....
    But the program uses many jar files, more or less 20 jar files, and many config files. And Its not convenient to run the program using the command above.
    So, I made a manifest file, manifest.mnf, and saved it under the classes dir:
    Manifest-Version: 1.0
    Main-Class: ManualSend
    Class-Path: ..\lib\bsiclient.jar
    ..\lib\msh.jar
    ..\classes\dbojects.properties
    ..\classes\config.xml
    ..\classes\jndi.properties
    ..\classes\log4j.properties
    ..\classes\msh_client.properties.xml
    ..\classes\sql.properties
    ..\lib\activation.jar
    ..\lib\avalon-framework-4.1.4.jar
    ..\lib\batik.jar
    ..\lib\bsi.jar
    ..\lib\bcmail-jdk13-115.jar
    ..\lib\commons-beanutils.jar
    ..\lib\commons-codec-1.2.jar
    ..\lib\commons-collections-3.1.jar
    ..\lib\commons-logging.jar
    ..\lib\commons-configuration-1.0.jar
    ..\lib\commons-digester.jar
    ..\lib\commons-lang-2.0.jar
    ..\lib\cos.jar lib\dom.jar
    ....etc.
    The ManualSend class is in bsiclient.jar. It used the default package.
    I run it in classes dir: jar -cvfm test.jar
    java -jar test.jar
    I got an error, saying:
    Error in building: \classes\test.jar!\msh_client.properties.xml (The filename, directory name, or volume label sntax is incorrect).
    I can't figure it out, so for the meantime, i just changed the '..\classes\' part of my manifest to '.\'
    I'm not happy with that. I want it to run from my root directory, using /lib and /classes subdirectories.
    Is there a way to do that? Really i'm confused with these classpath thing.
    Please, any comments, opinions, suggestions.... even violent reactions are greatly appreciated. I haven't received any feedbacks with any of my previous post in all of forums.
    Thanks,

    thanks Peter,
    I've attempted that approach before. But as i've said my program needs a lot of jar files, plus a number of config files. If i write them on one single Class-Path line, i got an error saying 'commands too long lines', or something like that.
    The manifest works fine. I am able to run the program using that manifest. But I'm not happy with that. Actually the program was based on a Tomcat webapp. I am actually doing a command-line version of it.
    So it Tomcat WEB-INF, classes and lib directories were separated. I am looking for a way to use these 2 separate directories. What I would like to find out is how to run my program, outside of the WEB-INF classes and lib directories, and at the same time could access all the jars and config files in them.
    As of the moment I had no luck of doing that. I had to run the program inside classes folder, and make a copy of lib folder inside the classes folder.
    Do you have any more suggestions, opinions? Please.

  • WEB-INF/classes not in classpath issue - bug or specification?

    I've noticed BC4J expects some of its configuration files to be present in the standard classpath or the application.
    However, when running web-apps, the WEB-INF/classes are used for loading classes by the JVM, but they are not in the classpath literaly which causes BC4J not to find its metadata files - this has caused many people to be confused because they believed (like me) that the /classes folder is just another part of the classpath.
    But someone has to solve this! After all, if I have a million web-apps, I (as a BC4J user) do not want to include a million JAR files in the classpath. I want to put the JAR in the classes directory and have BC4J find it automatically since its part of the web-app's classes, jars/zips and such.
    The question is, is this a BC4J issue (not finding the files) or a Java Specification issue? and if this is a mere BC4J issue, why won't Oracle provide a small patch for BC4J (simply release an updated JAR/ZIP file)? Or instead, put it in BC4J release notes (unless its already there and I've missed it..) so that customers won't have to spend/waste valuable time trying to understand.
    Regards to all,
    Arik Kfir.

    Originally posted by Arik Kfir ([email protected]):
    I've noticed BC4J expects some of its configuration files to be present in the standard classpath or the application.
    However, when running web-apps, the WEB-INF/classes are used for loading classes by the JVM, but they are not in the classpath literaly which causes BC4J not to find its metadata files - this has caused many people to be confused because they believed (like me) that the /classes folder is just another part of the classpath.
    But someone has to solve this! After all, if I have a million web-apps, I (as a BC4J user) do not want to include a million JAR files in the classpath. I want to put the JAR in the classes directory and have BC4J find it automatically since its part of the web-app's classes, jars/zips and such.
    ===========================================
    If I understand you correctly, it sounds like you need to put the bc4j .jar files in the /j2ee/home/lib directory...by placing a jar file there, it becomes available to all web applications running inside OC4J...
    does that solve your problem?
    regards,
    Mike Conway
    UNC Chapel Hill

  • Javac problem due to a wrong classpath - WHY?

    Hi,
    this is the initial part of my classpath:
    luca@linux:~> echo $classpath
    :/java/jdk/jre/lib/rt.jar:/java/jikes/rvm/2.3.0.1/rvm.classes:
    As you can see the first entry is the rt.jar, while the second is a wrong path that leads to a directory tree where there are both classes and sources. In particular, under rvm.classes there is a structure similar to the java one, with the java directory, java/lang, etc.
    With this (wrong) classpath, when I try to compile an application, the compiler stops due to problems compiling java.lang.Thread under rvm.classes. I've solved the problem inserting the right classpath in the second entry, but I'd like to know why the compiler asks me to compile Thread since it should be already available from rt.jar (which is the first entry).
    Thanks,
    Luca

    You don't need to put rt.jar in the classpath, the compiler will automatically look there for classes. So perhaps you are confusing the compiler by putting it there. Take it out.

Maybe you are looking for

  • How can I recover the Macintosh HD icon on my mac?

    I heard that I was supposed to have the Macintosh HD icon on my desktop, however, it is not there and I tried to search for it with Finder and Spotlight and it is nowhere to be found. Does anyone know what happened exactly and how I can get it to sho

  • Why is it taking so long to download a TV show to my Video iPod

    I recently purchased a video iPod and am downloading my first tv show. It's an hour long show and it's been downloanding for close to an hour. Should it take this long?

  • Unable to print pdf. IO Error

    Good afternoon all, I have a win7 computer with adobe pro XI; that will not print this pdf. It prints other pdf's just fine, but when I print this particular file I get: ERROR: ioerror OFFENDING COMMAND: image STACK: \image -mark- -savelevel- any hel

  • Hi! Who knows how to activate automatic Geotagging?

    ... I want to continue using the automatic geotagging function, you know the data you can read out via IPhone Tracker. I want to update to a new version but i heard it´s not working anymore in 4.3. Do you know how to activate that Function? I know it

  • Movies take forever to load

    I just bought an apple tv two days ago and a new router today as mine was about 6 years old. My apple tv has no problem picking up the songs in my itunes, but takes forever to load movies from itunes. all the movies are digital copies as well. any re