Java.lang.UnsatisfiedLinkError: when called from a jar file

I have a class that calls a custom dll file. If I dont package the class files and set my system PATH to the location of the DLL then the VM is able to find the dll and load it successfully.
However, when I package the class files into a jar file, I get "java.lang.UnsatisfiedLinkError: NetworkAdapters" eventhough the system PATH is set to the correct location.
I have also tried to packaging the dll with the class files but this has not made any difference.
Library is called from Java as follows:
static {
System.loadLibrary("NetworkAdapters");
When packaged the classes files exist in the following sub directories com\instem\hci\adapters
Any help appreciated.

Is it an executable Jar file?
The the DLL needs to sit in the same folders as the Jar itself.
(works for us).

Similar Messages

  • Java.lang.UnsatisfiedLinkError when calling native function

    I got exception as
    java.lang.UnsatisfiedLinkError: no rvjs11 in java.library.path
    Do I need any addtional setting?

    You need to make sure that the native library is in your "dynamic
    library search path". You typically set this using an environment
    variable (e.g., PATH on Windows, LD_LIBRARY_PATH on most Unix variants
    except HP-UX and AIX, SHLIB_PATH on HP-UX, or LIBPATH on AIX).
    Hope this helps,
    Robert
    Eric Shen wrote:
    I got exception as
    java.lang.UnsatisfiedLinkError: no rvjs11 in java.library.path
    Do I need any addtional setting?

  • MulticastSocket Multicast socket receive error: java.lang.RuntimeException: I/O error opening JAR file from file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar

    Hi,
              I need some help.
              Product=weblogic5.1.0
              Revision=(Release Level)=
              Problem Description=
              I am doing cluster of weblogic server, I have no problem to set up the
              cluster and to run servlet and EJB examples.
              However, on my command line for startcluster I got a lot of message as
              followed:
              Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
              error: java.lang.RuntimeException: I/O error opening JAR file from
              file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
              java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
              Compiled Code)
              at
              weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              .java, Compiled Code)
              at
              weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              , Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled Co
              de)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              StreamBase.java, Compiled Code)
              at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
              Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled Co
              de)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              The message freshed about every 20 seconds.
              Another question, I used a iplanet web server as a proxy server with a
              cluster of two weblogic servers pluged in, although I set
              weblogic.properties to round-robin, however, when I run a fibonacci servlet,
              it does not do the round-robin. It always go to one machine for a lot of
              times. Any idea?
              Thank you for your help.
              Tom
              

    May i presume that your cluster is configured on a shared file system?.
              I have seen this problem only if you cluster is configured on different machines
              and if the directory structure is not identical.
              let us know..
              Kumar
              Cameron Purdy wrote:
              > First, update to SP4 (or SP5 if it is out now). Second, follow the cluster
              > instructions on setting up deployments for a cluster. The only
              > implementation that I have used is the single shared location that all the
              > servers load from.
              >
              > --
              >
              > Cameron Purdy
              > http://www.tangosol.com
              >
              > "Tom Gan" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hi,
              > > I need some help.
              > >
              > > Product=weblogic5.1.0
              > > Revision=(Release Level)=
              > > Problem Description=
              > > I am doing cluster of weblogic server, I have no problem to set up the
              > > cluster and to run servlet and EJB examples.
              > > However, on my command line for startcluster I got a lot of message as
              > > followed:
              > > Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket
              > receive
              > > error: java.lang.RuntimeException: I/O error opening JAR file from
              > > file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
              > > java.util.zip.ZipException: error in opening zip file
              > > at java.util.zip.ZipFile.open(Native Method)
              > > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              > > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              > > at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
              > > Compiled Code)
              > > at
              > >
              > weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              > > .java, Compiled Code)
              > > at
              > >
              > weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              > > , Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > > jectInputStreamBase.java, Compiled Co
              > > de)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > > tStreamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > > eamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              > > StreamBase.java, Compiled Code)
              > > at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
              > > Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > > jectInputStreamBase.java, Compiled Co
              > > de)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > > tStreamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > > eamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              > > Code)
              > >
              > > The message freshed about every 20 seconds.
              > >
              > > Another question, I used a iplanet web server as a proxy server with a
              > > cluster of two weblogic servers pluged in, although I set
              > > weblogic.properties to round-robin, however, when I run a fibonacci
              > servlet,
              > > it does not do the round-robin. It always go to one machine for a lot of
              > > times. Any idea?
              > > Thank you for your help.
              > > Tom
              > >
              > >
              > >
              

  • Multicast socket receive error: java.lang.RuntimeException: I/O error opening JAR file

    I received Multicast socket receive error when I tried to restart the weblogic cluster in our pre-prod box.
              The error message I received lkie this:
              Multicast socket receive error: java.lang.RuntimeException: I/O error opening JAR file from file:/vol01/sites/vinlkup/site/versionc/local_classes/VIN/DeliveryTypeLookupEJB.jar
              

    Yuping,
              What release of WLS w/ service pack are you using? Make sure, if you are using a non-shared file system, to have the same absolute paths to your application on your file systems.
              yuping xu wrote:
              > I received Multicast socket receive error when I tried to restart the weblogic cluster in our pre-prod box.
              > The error message I received lkie this:
              > Multicast socket receive error: java.lang.RuntimeException: I/O error opening JAR file from file:/vol01/sites/vinlkup/site/versionc/local_classes/VIN/DeliveryTypeLookupEJB.jar
              

  • Java.lang.RuntimeException : I/O error opening JAR file

              Hi,
              Cluster configuration : 2 NT boxes WLS5.1(SP6). On one m/c weblogic
              is installed on drive C:\ and on another m/c weblogic is installed on drive D:\.
              i.e. all jars are at two place m/c 1 : c:\weblogic\myserver\*.jar
              m/c 2 : d:\weblogic \myserver\*.jar
              When servers startup successfully, error is coming :
              on the console of m/c 1 :
              java.lang.RuntimeException : I/O error opening JAR file from
              file:/d:/weblogic/myserver/eb_arn.jar
              on the console of m/c 2 :
              java.lang.RuntimeException : I/O error opening JAR file from
              file:/c:/weblogic/myserver/eb_arn.jar
              When both the weblgoic servers are installed on two machines and
              on same drive(c:\), this error is not coming.
              i.e. all jars are at two place m/c 1 : c:\weblogic\myserver\*.jar
              m/c 2 : c:\weblogic \myserver\*.jar
              Regards,
              Jitendra Kumar.
              

    Jitendra,
              This looks like a bug. Please approach support.
              - Prasad
              Jitendra Kumar wrote:
              > Hi,
              >
              > I'm deploying as per server property, because all servers have got their own myserver
              > directory and jars under that.
              > primary key class is not a problem at all, because that file is anyway under serverclasses directory.
              >
              > The problem starts when two weblogic servers on two m/c are installed on different drive(one on 'C:\' dirve
              > and another on 'D:\' drive or a unix machine in cluster).
              >
              > Regards,
              > Jitendra Kumar.
              >
              > Prasad Peddada <[email protected]> wrote:
              > >Are you sure that the the primary key class is there in the jar file.
              > >
              > >Are you deploying as per cluster property? Deploy on all the servers as per server property.
              > >
              > >
              > >- Prasad
              > >
              > >Jitendra Kumar wrote:
              > >
              > >> Hi,
              > >>
              > >> I don't have any problem in deploying beans and all servers have their local jar files.
              > >> Today I started solaris server in cluster and that also giving the same error message in console.
              > >> Now 2NT and One Solaris m/c running in cluster.
              > >>
              > >> error message on NT console is :
              > >> **************************************************
              > >> Sat Nov 04 15:43:14 GMT+05:30 2000:<E> <MulticastSocket> Multicast socket receive error: java.lang.R
              > >> untimeException: I/O error opening JAR file from file:/mazaa/weblogic/weblogic/myserver/voter.jar
              > >> <ServerClassLoader><W>: com.cot.eis.vl.eb_voter.VoterPK in not in archive java.util.zip.ZipFile@b902
              > >> 66be
              > >> java.util.zip.ZipException: error in opening zip file
              > >> at java.util.zip.ZipFile.open(Native Method)
              > >> at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              > >> at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              > >> at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java, Compiled Code)
              > >> at weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer.java, Compil
              > >> ed Code)
              > >> at weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java, Compiled Co
              > >> de)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLObjectInputStre
              > >> amBase.java, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputStreamBase.jav
              > >> a, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInputStreamBase.j
              > >> ava, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStreamBase.java,
              > >> Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputStreamBase.jav
              > >> a, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInputStreamBase.ja
              > >> va, Compiled Code)
              > >> at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLObjectInputStre
              > >> amBase.java, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputStreamBase.jav
              > >> a, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInputStreamBase.j
              > >> ava, Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStreamBase.java,
              > >> Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputStreamBase.jav
              > >> a, Compiled Code)
              > >> at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              > >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              > >> Sat Nov 04 15:54:24 GMT+05:30 2000:<E> <MulticastSocket> Multicast socket receive error: java.lang.R
              > >> untimeException: I/O error opening JAR file from file:/mazaa/weblogic/weblogic/myserver/voter.jar
              > >>
              > >> error message on Solaris console is :
              > >> ******************************************
              > >> java.util.zip.ZipException: error in opening zip file
              > >> at java.util.zip.ZipFile.open(Native Method)
              > >> at java.util.zip.ZipFile.open(Compiled Code)
              > >> at java.util.zip.ZipFile.<init>(Compiled Code)
              > >> at java.util.zip.ZipFile.<init>(Compiled Code)
              > >> at weblogic.boot.ServerClassLoader.deploy(Compiled Code)
              > >> at weblogic.cluster.AnnotatedServiceOffer.expandClassPath(Compiled Code)
              > >> at weblogic.cluster.AnnotatedServiceOffer.readObject(Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializab
              > >> le(Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readLeftover(Compile
              > >> d Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(Compi
              > >> led Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObject(Compiled
              > >> Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(Compile
              > >> d Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readArrayList(Compil
              > >> ed Code)
              > >> at weblogic.cluster.StateDump.readObject(Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializab
              > >> le(Compiled Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readLeftover(Compile
              > >> d Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(Compi
              > >> led Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObject(Compiled
              > >> Code)
              > >> at weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(Compile
              > >> d Code)
              > >> at weblogic.cluster.TMSocket.execute(Compiled Code)
              > >> at weblogic.kernel.ExecuteThread.run(Compiled Code)
              > >> Sat Nov 04 15:55:09 GMT+00:00 2000:<E> <MulticastSocket> Multicast socket receiv
              > >> e error: java.lang.RuntimeException: I/O error opening JAR file from file:/C:/we
              > >> blogic/myserver/eb_arn.jar
              > >>
              > >> Regards,
              > >> Jitendra Kumar
              > >>
              > >> Prasad Peddada <[email protected]> wrote:
              > >> >Do you trouble deploying the app also.
              > >> >
              > >> >- Prasad
              > >> >
              > >> >Jitendra Kumar wrote:
              > >> >
              > >> >> Hi,
              > >> >>
              > >> >> Cluster configuration : 2 NT boxes WLS5.1(SP6). On one m/c weblogic
              > >> >> is installed on drive C:\ and on another m/c weblogic is installed on drive D:\.
              > >> >> i.e. all jars are at two place m/c 1 : c:\weblogic\myserver\*.jar
              > >> >> m/c 2 : d:\weblogic \myserver\*.jar
              > >> >> When servers startup successfully, error is coming :
              > >> >>
              > >> >> on the console of m/c 1 :
              > >> >> java.lang.RuntimeException : I/O error opening JAR file from
              > >> >> file:/d:/weblogic/myserver/eb_arn.jar
              > >> >>
              > >> >> on the console of m/c 2 :
              > >> >> java.lang.RuntimeException : I/O error opening JAR file from
              > >> >> file:/c:/weblogic/myserver/eb_arn.jar
              > >> >>
              > >> >> When both the weblgoic servers are installed on two machines and
              > >> >> on same drive(c:\), this error is not coming.
              > >> >> i.e. all jars are at two place m/c 1 : c:\weblogic\myserver\*.jar
              > >> >> m/c 2 : c:\weblogic \myserver\*.jar
              > >> >>
              > >> >> Regards,
              > >> >> Jitendra Kumar.
              > >> >
              > >
              > >--
              > >Cheers
              > >
              > >- Prasad
              > >
              > >
              

  • Java.lang.UnsatisfiedLinkError when loading libaries

    Hi,
    I coded an ejb, in which I want to call funtionality coming from a dll via JNI.
    In order to achieve it I copied the libary 'XXX.dll' to the windows directory system32
    and call in my ejb : System.loadLibary("XXX").
    The following exception occured:
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: no XXX in java.library.path
    Can anybody help me by saying
    1) where to put the .dll and what path to set in calling System.loadLibary(...)
    3) or even where and how to set the java.libary.path variable (Instance Template via configtool?)
    Honour and points are garanteed.
    Jens

    Hi,
    Check This,
    File f = new File("C:");
    System.out.println(f + " \t" + f.exists());
    f = new File(f, "sampleDLL2");
    System.out.println(f + " \t" + f.exists());
    System.load( f.toString() );
    When the library can not be found, you get a java.lang.UnsatisfiedLinkError with the message "no library in java.library.path". To solve this, move the library in one of the directories specified by java.library.path or alter the property so that it points to the directory containing your library. You can print this property with the following code:
    1: System.out.println(System.getProperty("java.library.path"));
    Another possibility when things do not work is when the DLL can be found, but the methods can not. A DLL exports functions according to specific names an calling conventions. When your compiler is not configured the right way your methods may get anther name than they should be. To solve this, you should include the header file generated by javah and configure your compiler the right way.
    Thanks,
    gopal

  • Java.lang.UnsatisfiedLinkError   when trying create a session to a topic.

    I've tried the Oracle Streams messaging example here:
    http://docs.oracle.com/cd/B28359_01/server.111/b28420/aq_demo.htm#i100786
    But when trying to connect using java and oci I'm getting this
    Exception in thread "main" java.lang.UnsatisfiedLinkError: oracle.jms.AQjmsSession.ociinit([JIIZS)J
    This is the very simple code :
    TopicConnectionFactory factory = (TopicConnectionFactory) oracle.jms.AQjmsFactory.getTopicConnectionFactory("localhost","orcl",1521,"oci8");
    TopicConnection conn = factory.createTopicConnection("strmadmin","strmadmin");
    TopicSession sess = conn.createTopicSession(true, Session.CLIENT_ACKNOWLEDGE);
    What do do ?
    I assume this has something to do with wrong dll being used ..
    The server is 11g 11.2.0.1.0 - 64bit Production and java is 1.6 on Win 7

    Is it an executable Jar file?
    The the DLL needs to sit in the same folders as the Jar itself.
    (works for us).

  • Java.lang.UnsatisfiedLinkError: CallExe.call(Ljava/lang/String;)V

    hi,
    I am new in JNI,
    I created call.dll using MS Visual C++.
    I want to call JNI call method in Call class.
    I am working on NetBean, If I called same method using jCreater it works but through netBean it throws following error:
    java.rmi.ServerError: Error occurred in server thread; nested exception is:
    java.lang.UnsatisfiedLinkError: sunil.jdata.source.CallExe.call(Ljava/lang/String;)V
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:333)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    Please give me the solution.

    Please give me the solution.Simple - environment problem. Obviously.
    What makes you think this has anything to do with JNI?

  • Problem parsing XML with schema when extracted from a jar file

    I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
    I get the following exception:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
    This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
    I have output the retrieved XML to a file and compared it with my original source and they are identical.
    I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
    Any suggestions?
    The code is as follows:
      public void open(File input) throws IOException, CSLXMLException {
        InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
          factory.setNamespaceAware(true);
          factory.setValidating(true);
          factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
          factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
          builder = factory.newDocumentBuilder();
          builder.setErrorHandler(new CSLXMLParseHandler());
        } catch (Exception builderException) {
          throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
        Document document = null;
        try {
          document = builder.parse(input);
        } catch (SAXException parseException) {
          throw new CSLXMLException(parseException.toString());
        }

    I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
    Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

  • Java.lang.ClassCastException when calling webservice stub  from oracle DB

    Hello everyone,
    Because i need to get familliar with calling java webservices from an oracle database, i followed the following example
    (http://www.oracle.com/technology/products/jdev/howtos/10g/WS_DBCallout/DBCalloutWS_HowTo.htm),
    which included installing the SOAP client stack to the database (in the sys schema), grant the right permissions to the SYS user, developing a simple Helloworld webservice with jdeveloper 10.1.2, generating a Webservice stub and deploying a static method of this stub to the database.
    All of this worked just fine, but when i want to call the webservice from oracle by invoking the deployed function, i get a java.lang.ClassCastException.
    The complete stacktrace lists as follows:
    v_Return = foutje: java.lang.ClassCastExceptionnulljava.lang.ClassCastException
         at org.apache.soap.rpc.RPCMessage.serializeParams(RPCMessage.java:323)
         at org.apache.soap.rpc.RPCMessage.marshall(RPCMessage.java:305)
         at org.apache.soap.Body.marshall(Body.java:148)
         at org.apache.soap.Envelope.marshall(Envelope.java:203)
         at org.apache.soap.Envelope.marshall(Envelope.java:161)
         at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:664)
         at org.apache.soap.rpc.Call.invoke(Call.java:261)
         at test.HelloWorldServiceStub.sayHello(HelloWorldServiceStub.java:82)
    I debugged the WebServiceStub and noticed that the call.invoke method crashes. This is weird beacuse when i use System.out.println on the parameter is works just fine. so you would think it is a string.
    Moreover, if i invoke the webservice from the endpoint or even when im debugging the stub locally it all works just fine.
    Can someone plzzzzzz help me with this because i spend the whole day looking for an answer and im getting crazy!!!!!
    Thanx al lot guys,
    Kim
    PS or could the problem be in the database instead of the webservice?????????
    Message was edited by:
    user568880
    Message was edited by:
    Kim Zeevaarders

    I think that it's going wrong because i did not install the right SOAP client stack.
    In the HowTo is specified what JAR files are to be loaded in the database (from %JDEV_HOME), but it states that it has only been tested on a Oracle 9.2 database. I'm using Oracle10g. Maybe that's the reason that im getting this classcast exception...
    Can anybody tell me what the right .JAR files are that have to be loaded into database when working with Oracle 10g?
    Many thx in advance!
    Kim

  • Java.lang.OutOfMemoryError when calling invokeMethod from CO

    Hi All,
    We are developing some custom pages using OA. All the pages were working properly utill yestarday and all of of a sudden I started getting java.lang.OutOfMemoryError error in my local Jdeveloper.I have not installed any new software or any upgrade between now and then, and there has been no changes to my application either. I even tried running this page standalone. I uninstalled Jdeveloper and reinstalled it again still the same. When I copy the code from AM into my CO it works fine. What could be causing the issue ?
    java.lang.OutOfMemoryError, msg=null
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:864)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
         at fpi.oracle.apps.xbol.gwo.webui.GWOOrderHeaderCO.processRequest(GWOOrderHeaderCO.java:126)

    Thanks for taking my query.
    Here is the code from fpi.oracle.apps.xbol.gwo.webui.GWOOrderHeaderCO where the exception originated.. this is not just with this CO but in all the CO. This code is exactly the same as in the PO Tutorial. Also I could not locate the option to set the JVM memory parameter in Project setting. I have set the Java heap size -mx512m which I believe is what you wanted me to do.
         OAApplicationModule am = pageContext.getApplicationModule(webBean);
         Serializable[] parameters = { pageContext.getParameter("headerId") };
         boolean rowFound = ((Boolean)am.invokeMethod("init", parameters)).booleanValue();
    Here is the complete stack..
    Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.OutOfMemoryError, msg=null
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:864)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:692)
         at fpi.oracle.apps.xbol.gwo.webui.GWOOrderHeaderCO.processRequest(GWOOrderHeaderCO.java:126)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:518)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:920)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1536)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:363)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:866)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:833)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:575)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:244)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:330)
         at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2121)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1562)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:463)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:384)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.lang.OutOfMemoryError
    Here is the code from fpi.oracle.apps.xbol.gwo.webui.GWOOrderHeaderCO where the exception originated.. this is not just with this CO but in all the CO. This code is exactly the same as in the PO Tutorial.
         OAApplicationModule am = pageContext.getApplicationModule(webBean);
         Serializable[] parameters = { pageContext.getParameter("headerId") };
         boolean rowFound = ((Boolean)am.invokeMethod("init", parameters)).booleanValue();
    Message was edited by:
    Bismi

  • Java.lang.NullPointerException when calling getServletContext

    Hi All,
    When calling getServletContext from my servlet, i'm getting the following exception to my web client:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         javax.servlet.GenericServlet.getServletContext(GenericServlet.java:159)
         amdocs.checklist.UserPage.service(UserPage.java:126)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         amdocs.checklist.LoginFilter.doFilter(LoginFilter.java:65)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.27 logs.
    My code is:
    ServletContext sc = getServletContext();
    RequestDispatcher rd = getServletContext().getRequestDispatcher("/Header");
    rd.include(request, response);
    It couldn't pass the call of getServletContext, Any idea why?
    Thanks.

    I haven't looked at the source yet, but I remember the api specs talking about the init(ServletConfig) method being called by the container.
    The servlet will the set up it's references to objects (eg. the ServletContext) and calls the init() method.
    So, if you override the init(ServletConfig) method the references will never be set up, and you will get null calling getServletContext().
    So always use the init() method for any initialization of servlets.

  • Multicast socket receive error: java.lang.RuntimeException: I/O error opening JAR file from file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar

    Hi,
    I need some help.
    Product=weblogic5.1.0
    Revision=(Release Level)=
    Problem Description=
    I am doing cluster of weblogic server, I have no problem to set up the
    cluster and to run servlet and EJB examples.
    However, on my command line for startcluster I got a lot of message as
    followed:
    Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
    error: java.lang.RuntimeException: I/O error ope
    ning JAR file from
    file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
    at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
    at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
    Compiled Code)
    at
    weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
    .java, Compiled Code)
    at
    weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
    , Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
    jectInputStreamBase.java, Compiled Co
    de)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
    treamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
    tStreamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
    eamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
    treamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
    StreamBase.java, Compiled Code)
    at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
    Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
    jectInputStreamBase.java, Compiled Co
    de)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
    treamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
    tStreamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
    eamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
    treamBase.java, Compiled Code)
    at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
    Code)
    The message freshed about every 20 seconds.
    Another question, I used a iplanet web server as a proxy server with a
    cluster of two weblogic servers pluged in, although I set
    weblogic.properties to round-robin, however, when I run a fibonacci servlet,
    it does not do the round-robin. It always go to one machine for a lot of
    times. Any idea?
    Thank you for your help.
    Tom

    Hi,
    I need some help.
    Product=weblogic5.1.0
    Revision=(Release Level)=
    Problem Description=
    I am doing cluster of weblogic server, I have no problem to set up the
    cluster and to run servlet and EJB examples.
    However, on my command line for startcluster I got a lot of message as
    followed:
    Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
    error: java.lang.RuntimeException: I/O error ope
    ning JAR file from
    file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
    at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
    at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
    Compiled Code)
    at
    weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
    .java, Compiled Code)
    at
    weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
    , Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
    jectInputStreamBase.java, Compiled Co
    de)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
    treamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
    tStreamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
    eamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
    treamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
    StreamBase.java, Compiled Code)
    at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
    Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
    jectInputStreamBase.java, Compiled Co
    de)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
    treamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
    tStreamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
    eamBase.java, Compiled Code)
    at
    weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
    treamBase.java, Compiled Code)
    at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
    Code)
    The message freshed about every 20 seconds.
    Another question, I used a iplanet web server as a proxy server with a
    cluster of two weblogic servers pluged in, although I set
    weblogic.properties to round-robin, however, when I run a fibonacci servlet,
    it does not do the round-robin. It always go to one machine for a lot of
    times. Any idea?
    Thank you for your help.
    Tom

  • Java.lang.StackOverflowError when calling servlet

    I have written a servlet(Happy) from which is dispatching cerain parameters to bookList.jsp for display
    RequestDispatcher dispatcher = request.getRequestDispatcher("bookList.jsp");
    request.setAttribute("hello",na);
    dispatcher.forward(request, response);
    and in the web.xml if i give the url pattern as
    <url-pattern>/*</url-pattern>
    and try to call the servlet like say the project is J2EE
    http://localhost:8080/J2EE/start
    i get error
    [[Happy]] Servlet.service() for servlet Happy threw exception
    java.lang.StackOverflowError
    why i am getting StackOverflowError exception
    If i give any other thing in url-pattern like /start
    then i dont get any exception and it works and jsp page is displayed
    could anybody please help
    Thanks
    Bhanu

    i am getting the same problem , please tell me if you find solution. my problem is i create a bean and i am accessing in a select and collections tags,
    first i done , by specify the bean in the struts-config.xml and used in the select-collection tag, it is working successfully.
    next i try assign valued to that bean in action class then i am getting these errors,
    javax.servlet.ServletException: Servlet execution threw an exception
    Servlet.service() java.lang.StackOverflowError
    could you please solve my problem.....
    regards,
    ravikumar.m
    [email protected]

  • "java.lang.NoSuchMethodError" when migrating from 1.5 to 2.0

    [ Problem ]
    E:\Adobe2.0\Flash Access Reference Server Implementation\migration>java -cp bin;
    libs\*;libs\1.5\*;libs\2.0\* com.adobe.flashaccess.refimpl.migration.V1_5PolicyC
    onverter all
    Exception in thread "main" java.lang.NoSuchMethodError: com.adobe.schema._1_0.pd
    rl.Permission.getConstraint()Ljava/util/List;
            at com.adobe.flashaccess.sdk.policy.PolicyRightHelper.addToPolicy(Policy
    RightHelper.java:272)
            at com.adobe.flashaccess.sdk.policy.PolicyRightHelper.toPDRL(PolicyRight
    Helper.java:233)
            at com.adobe.flashaccess.sdk.policy.PolicyRightHelper.toASN1(PolicyRight
    Helper.java:97)
            at com.adobe.flashaccess.sdk.policy.Policy.serializePolicy(Policy.java:6
    70)
            at com.adobe.flashaccess.sdk.policy.Policy.getBytes(Policy.java:181)
            at com.adobe.flashaccess.refimpl.migration.AbstractPolicyConverter.write
    PolicyToFile(AbstractPolicyConverter.java:100)
            at com.adobe.flashaccess.refimpl.migration.V1_5PolicyConverter.convertPo
    licies(V1_5PolicyConverter.java:140)
            at com.adobe.flashaccess.refimpl.migration.V1_5PolicyConverter.main(V1_5
    PolicyConverter.java:87)
    [ Solution ]
    The class mentioned in the error message is in rm-pdrl.jar, which should be in your libs/2.0 directory.  There may be a conflict between this jar and something in libs/1.5.  Please try moving libs/2.0 before libs/1.5 in your classpath and see if that resolves the issue.

    hi Arie,
    thanks for the tip ;-), I was using application id which was already use in my htmldb installation. I changed the id in the f105.sql to something which was not used and it went through fine.
    We often run htmldb imports through sqlplus because when running it through web site it too often fails with timeout. When import is done through the web site I believe htmldb does the id modification automatically but in sqlplus that obviously won't happen hence we need to do it manually before running the script. If we don't change it import will fail as the workspace with the id mentioned in the sql script does not exist. Like you said might not be supported ....but it still works fine... :-)
    thanks for your help.
    Nina

Maybe you are looking for

  • Word file from java

    i need to draw an arrow in word file ( i mean want to generate word file dynamically). depending upon particular conditions I want to format the word file I'll have to use JNI... with VB or C++?

  • Can I swap North American power plug on ipod charger for European one??

    Hi there. My sister is taking her 5th Gen iPod to Russia from Canada (we use North American Standards for plug shape and 110 voltage, for US users interest). I am curious if she can purchase (online or in Russia) an adapter for the prong portion (tha

  • About the new "8-core"

    Hi! i'm in the mood of a new mac... my old G4 is to slow to handle the new studio 6. is it worth to buy the new 8-core? will the applications use 8-core? thanks

  • IBooks Library not synching between iPad & Macbook Pro

    I've loaded PDFs into my iPad and Macbook Pro ibook libraries, but they are not synching between the devices. All synching has been turned on in preferences on my Mac, iTunes and iPad. Any suggestions as to how to get both devices listing same ibook

  • Time Machine Deleting Old Backups!!

    Good morning, I recently installed a new hard drive and a clean OS X 10.6.3 in my MacBook Pro (2008). I plugged in my Time Machine back-up drive, and TM started getting rid of my old back-ups! Can anyone advise me on what is happening and how to prev