Jars on classpath within webservice?

Hi. I've created a web service using apache axis. I am having a problem getting my external classes on the classpath of my web service.
import com.mycompany.MyClass
public class MyService{
  static {
    MyClass.initialize();
  public String myServiceMethod(){
}When i deploy on weblogic 9.2 i get:
weblogic.application.ModuleException: [HTTP:101216]Servlet: "AxisServlet" failed to preload on startup in Web application: "mywar.war".
java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at org.apache.ws.java2wsdl.SchemaGenerator.<init>(SchemaGenerator.java:121)
        at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:306)
        at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:339)
        at org.apache.axis2.deployment.DeploymentEngine.populateService(DeploymentEngine.java:340)
        at org.apache.axis2.deployment.DeploymentEngine.loadServicesFromUrl(DeploymentEngine.java:181)
        at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:264)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:74)
        at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:486)
        at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:406)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:276)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:68)
        at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:504)
        at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1698)
        at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1675)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1595)
        at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2734)
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:892)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:336)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
        at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
        at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
        at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:641)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:229)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:565)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:815)
        at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1222)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:433)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeli
verer.java:181)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.
java:12)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:
67)
        at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class Not found : com.mycompany.MyClass
        at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:88)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at com.mycompany.MyService.<clinit>(Unknown Source)
        ... 52 more
Caused by: java.lang.ClassNotFoundException: Class Not found : com.mycompany.MyClass
        at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:84)
        ... 56 more
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:894)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:336)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
        Truncated. see log file for complete stacktrace
java.lang.ClassNotFoundException: Class Not found : com.mycompany.MyClass
        at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:84)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at com.mycompany.MyService.<clinit>(Unknown Source)
        Truncated. see log file for complete stacktraceI believe the error is occurring when Axis loads the service class and the static block is executed. ie - <clinit>.
MyClass lives in a packaged jar - myjar.jar. How do I get myjar.jar on the runtime classpath of MyService?
I've tried placing myjar.jar in the WEB-INF/lib folder of the axis war, as well as packaging it in the .aar of MyService
Thanks!

bump.
anybody have any ideas on this?

Similar Messages

  • Add JARs to classpath within Java

    I've read through a number of different posts on this topic, but can't seem to get my code working.
    I want to write a class that will run embedded Tomcat. For certain reasons, I can't set the
    classpath to Tomcat before my class gets called, so I want to locate the Tomcat JARs, add them
    using a ClassLoader and then call the appropriate classes to setup and run Tomcat. An
    exception is being thrown, so I'm doing something wrong. Any ideas?
    Here's the code I'm trying to add the JARs with:
    String mcatHome = "tomcat/lib"
    try {
         // Scan folder for JARs and build URL array
         File mcatDir = new File(mcatHome);
         File files[] = mcatDir.listFiles(new JarFilter());
         URL jarURLs[] = new URL[files.length];
         for (int i = 0; i < files.length; i++)
              jarURLs[i] = files.toURL();
         // Add list of JARs to class loader
         URLClassLoader ucl = new URLClassLoader(jarURLs);
         // Use loader when loading classes
         Thread.currentThread().setContextClassLoader(ucl);
    catch (Exception ex) {
    then I call the contructor on the class which tries to start Tomcat:
         public void Mcat()
              startTomcat();
         protected void startTomcat()
              Embedded embed = new Embedded();
    When the constructor is invoked, I get:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/catalina/L
    ifecycleException

    jschell, the list of JARs is generated from listing them in the folder. I did print the list out and
    the URLs looked ok. (i.e. file:/....)
    Here a snippet of how the class calling is setup:
    In Runner.java:
    public void Runner()
         //code from original post to load JARs
         Mcat mcat = new Mcat()
    In Mcat.java:
    import org.apache.catalina.*;
    import org.apache.catalina.logger.*;
    import org.apache.catalina.users.*;
    import org.apache.catalina.realm.*;
    import org.apache.catalina.startup.Embedded;
    public class Mcat
        public void Mcat()
            startTomcat();
        protected void startTomcat()
            Embedded embed = new Embedded();
    }Hope this helps

  • Why getResource of jar in classpath returns null?

    When i iterate through the jars in the classpath and try to turn them into URL's via the getResources(), they all return null. What am I doing wrong?
    (NOTE: It does print out the classpath properly when i print that out)
    String classPath = System.getProperty( "java.class.path" );
    String delim = System.getProperty( "path.separator" );
    String[] locations = classPath.split( delim );
    for ( int i = 0; i < locations.length; i++ )
          /* ** It doesn't work with either of these statments: ** */
          //This one tries the full path (e.g. /home/me/test/some.jar)
          //Enumeration en = getClass().getClassLoader().getResources( locations[ i ].substring( locations[ i ] );
          //This one tries to use just the local name of the jar (e.g. test.jar)
          Enumeration en = getClass().getClassLoader().getResources( locations[ i ].substring( locations[ i ].lastIndexOf( '/' ) + 1 ) );
          //This just prints null
          while (  en.hasMoreElements(); ) System.out.println( en.nextElement() );
    }Edited by: 6tr6tr on Dec 4, 2008 5:46 PM
    Edited by: 6tr6tr on Dec 4, 2008 5:47 PM

    What you are doing doesn't make sense. The resource locations within a JAR file are relative to the package directory structure within the JAR file, not to its own absolute location on the disk. And you seem to be expecting to retrieve a JAR file from within a JAR file. This makes no sense either.

  • Including large number of jars in classpath...

    Hello,
    I have an application that relies on over 100 jars and a set of classes - I have been using an IDE to set the classpath so far, which has been fine, but I need to distribute the application to others, and so need to bundle the classes, preferably as a jar. I have tried multiple variations of setting the classpath within the manifest for the jar file (that includes only my source), and have finally resorted to setting the classpath using a batch file and running directly using the classes. Neither method works - the classpath seems to be too long - the best results I've got are with the bat file, but this loads all but the last 8 jars - taking out a few jars adds one or two more, so this seems to confirm a maximum length for the classpath. (FYI, I have previously used the manifest to set the classpath and this has been fine, but in this case I had only two jars.)
    Has anyone come across this problem, and if so, have you managed to find a solution - I've combed through the relevant postings to this forum and have found similar problems but no actual Manifest or bat file example apart from a description of what was done, all of which I've tried, and none of which worked. The option to use the wildcard * in the classpath environment variable doesn't work because I cannot use JDK1.6 - the external libraries need to run on JDK1.5 - I have actually tried this but it is not expanded.
    Aba-Sah

    Another option is to package (or "flatten") all the dependencies into a single JAR. I use the following Groovy script in ANT builds to copy files from many JARs to a single location ...
    <!-- set up a groovy task -->
    <taskdef name="groovy"
              classname="org.codehaus.groovy.ant.Groovy"
         classpathref="compile-cp"/>
    <!-- you'll need to adapt this to your environment -->
    <target name="flattenLibs">
              <mkdir dir="${dist-temp}"/>
              <groovy>
                   import java.io.*;
                   import java.util.zip.*;
                   import java.util.jar.*;
                   def copyBinary(isDir, dfile, is) {
                        def file = new File( dfile )
                        if ( isDir ) {
                             file.mkdirs()
                        else {
                             def preIndex = Math.max( dfile.lastIndexOf( "/" ), dfile.lastIndexOf( "\\" ) )
                             if ( preIndex > 0 )
                                  new File( dfile.substring( 0, preIndex + 1 ) ).mkdirs()
                             def fout = new BufferedOutputStream( new FileOutputStream( file ) )
                             try {
                                  byte[] buffer = new byte[ 1024 ]
                                  int i
                                  while ( ( i = is.read( buffer, 0, buffer.length ) ) > 0 )
                                       fout.write( buffer, 0, i )
                                  fout.close()
                             finally {
                                  fout.close()
                   def destDir = project.getProperty( "dist-temp" )
                   if ( destDir.endsWith( "\\" ) || destDir.endsWith( "/" ) )
                        destDir = destDir.subString( 0, destDir.length() - 1 )
                   // Look at "core-cp"
                   def libs = []
                   project.getReference( "core-cp" ).list().each { pe ->
                        if ( pe.endsWith( ".jar" ) )
                             libs.add( pe )
                   def noisy = "true".equalsIgnoreCase( project.getProperty( "noisy" ) )
                   // Copy:
                   libs.each { lib ->
                        def jfile = new JarFile( new File( lib ) )
                        def e = jfile.entries()
                        while ( e.hasMoreElements() ) {
                             def entry = e.nextElement()
                             def name = entry.getName()
                             if ( noisy )
                                  println "Copying \"${name}\" ..."
                             def is = new BufferedInputStream( jfile.getInputStream( entry ) )
                             try {
                                  copyBinary( entry.isDirectory(), "${destDir}/${name}", is )
                             finally {
                                  is.close()
              </groovy>
         </target>

  • Setting classpath within java application

    Hi
    Sorry if this question has already been asked, I've searched for it but couldn't find it.
    I've written a class (see below) that when given a directory will add all of the jar files to the classpath.
    The classpath is updated to include all of the jar files but if I try to use a class within one of these jar files then an exception is generated stating that the class can't be found.
    Can anyone help me with this problem? I thought that I would only need to update the classpath.
    Thanks,
    Rob
    public class Jar {
         public static void addJarsToClasspath(String root) {
              File f = new File(root);
              if (f.exists()) {
                   File[] jars = f.listFiles(new FilenameFilter(){
                        public boolean accept(File dir, String file) {
                             return ((String)dir.getName()+file).endsWith(".jar");
                   String classpath = System.getProperty("java.class.path");
                   for (int i=0; i<jars.length; i++) {
                             classpath = classpath.concat(":"+root+"/"+jars.getName());
                   System.setProperty("java.class.path",classpath);
                   System.out.println(System.getProperty("java.class.path"));

    You can do this with batch files in Windows NT/2000:
    1) create a batch file called "setcp.bat" containing the following:
    for %%i in (C:\myPath\*.jar) do call appendcp.bat %%i
    2) create another batch file called "appendcp.bat" containing the following:
    set CLASSPATH=%CLASSPATH%;%1
    Now you can run setcp.bat and it will add all JAR files in C:\myPath to your CLASSPATH.
    Jesper

  • [svn:bz-trunk] 18377: Remove WEB-INF/flex/ jars from classpath in qa-manual and qa-regress.

    Revision: 18377
    Revision: 18377
    Author:   [email protected]
    Date:     2010-10-29 12:17:57 -0700 (Fri, 29 Oct 2010)
    Log Message:
    Remove WEB-INF/flex/jars from classpath in qa-manual and qa-regress.  This folder no longer exists as we don't have the webtier compiler.
    checkintests: passed
    Modified Paths:
        blazeds/trunk/qa/apps/qa-manual/build.xml
        blazeds/trunk/qa/apps/qa-regress/build.xml

  • Possible to create a JAR file from within a java app?

    Is it possible to create a jar file from within a java application?
    Can it be done more elegantly than by spawning-off another
    process with the Runtime and exec() portions of the api?
    Thanks
    Scott

    Thanks! I was mislead by the API notes for java.util.jar:
    The JarOutputStream class is used to write the contents
    of a JAR file to any output stream.
    I was looking for a class or method to make jar files.
    Seems this is it ;)
    Thanks
    Scott

  • Got exception with p13n_app.jar and p13n_system.jar into classpath for 9.2

    Hi, Portal guru:
    I installed wls9.2&portal9.2, and put p13n_app.jar and p13n_system.jar into classpath from startWeblogic.cmd.
    then looks portalApp can not be loaded due to the following exception:
    java.lang.Error: Clonable is not clonable: java.lang.CloneNotSupportedException: com.bea.p13n.expression.operator.c
    omparative.Equals: 4138928
    com.bea.content.expression.PropertyRef: 4138900
    java.lang.String
    cm_nodeName
    java.lang.String
    CmxControlUniqueKeysFolder
    : com.bea.content.expression.PropertyRef
    at com.bea.content.expression.Search.clone(Search.java:568)
    at com.bea.content.manager.internal.SearchOpsImpl.createSearchForRepo(SearchOpsImpl.java:376)
    at com.bea.content.manager.internal.SearchOpsImpl.searchRepository(SearchOpsImpl.java:203)
    at com.bea.content.manager.internal.SearchOpsImpl.search(SearchOpsImpl.java:159)
    any know what is the problem?
    Thanks in advance.

    I don't think it's supported to have app-scoped class in the system
    classpath. I'm surprised your 814 app worked that way.
    It might be that changes in 9.2 have caused some of the classes the
    system classloader is hitting to now try to load other classes that are
    only available in an application classloader, which the system
    classloader cannot access.
    http://e-docs.bea.com/wls/docs90/programming/classloading.html has
    information about the classloader hierarchy in WLS/WLP.
    One way to have a system-classloader class access an
    appliation-classloader is via the
    Thread.currentThread().getContextClassLoader(), and then either use
    reflection or have the class implement an interface available in the
    system classloader. This allows code at the system classpath level to
    access implementation classes loaded up as part of an application,
    rather than relying upon the built-in classloading which can't see
    classes in children classloaders. However, this would entail having a
    system classpath jar and an application jar, which is why WLP has
    p13n_system.jar and p13n_app.jar.
    Greg

  • Ears, wars, support jars, and CLASSPATH

    I am trying to migrate an application from WLS 5.1 to 6.1. There are 25
    EJB jars with an equal number of support jars, most of which are referenced
    by multiple EJBs. There are also a large number of jsps, and html pages.
    I have tried packaging an ear that contains the 25 ejb jars, a war file
    containing the web pages. I have attempted to include the support jars in
    the ear as well.
    In all attempts, the only way I get class references sastisfied is to
    include all the jars on the system CLASSPATH. But this defeats the purpose
    of packaging, since none of the components referenced in the system
    CLASSPATH will be re-deployable.
    The online documents refer to separate class loaders and classpaths for the
    war and ejbs, but no detail as to how classes are found by the loaders.
    Unless I put all the jars into the CLASSPATH, jsp pages cannot reference the
    EJBs, and EJBs are unable to reference other EJBs.

    Thanks,
    Now if I could just get Webgain Visual Cafe to allow me to include the
    Classpath entries in the generated manifests for the EJB jars.
    "Gregory Gerard" <[email protected]> wrote in message
    news:3ba24da1$[email protected]..
    You need to mangle all the Manifest files within the EAR and EJB-JARs and
    WAR to get the right thing to happen. Check out this PDF on Sun's site:
    http://java.sun.com/j2ee/j2ee-1_3-pfd4-spec.pdf
    section 8.1.1.2
    I don't entirely understand all the restrictions and formatting -- Ihaven't
    found an example ear file out there that implements a non-trivial case.
    greg
    "Carl Lawstuen" <[email protected]> wrote in message
    news:3ba21d8e$[email protected]..
    I am trying to migrate an application from WLS 5.1 to 6.1. There are
    25
    EJB jars with an equal number of support jars, most of which arereferenced
    by multiple EJBs. There are also a large number of jsps, and htmlpages.
    I have tried packaging an ear that contains the 25 ejb jars, a war file
    containing the web pages. I have attempted to include the support jarsin
    the ear as well.
    In all attempts, the only way I get class references sastisfied is to
    include all the jars on the system CLASSPATH. But this defeats thepurpose
    of packaging, since none of the components referenced in the system
    CLASSPATH will be re-deployable.
    The online documents refer to separate class loaders and classpaths forthe
    war and ejbs, but no detail as to how classes are found by the loaders.
    Unless I put all the jars into the CLASSPATH, jsp pages cannot referencethe
    EJBs, and EJBs are unable to reference other EJBs.

  • Putting Jar in ClassPath/Loading JDBC Driver on Linux

    Hi,
         I have got this to work on Windows � but then I simply put the Connector-J Jar into the �lib� directory of my Java installation. On this Linux machine I do not have the privileges to the �lib� directory � so I need to add the Jar to the class path � but it is not seeming to get added.
         I would appreciate any suggestions. I have copied the Connector-J Jar file to the Current working directory and I have tried
    java -classpath './mysql-connector-java-5.1.6-bin.jar' -Xmx512M -jar ProcessBigDump_fat.jar
    java -cp mysql-connector-java-5.1.6-bin.jar -Xmx512M -jar ProcessBigDump_fat.jar
    Thank you for any ideas.
    O.O.

    When you use "-jar" any user settings of the classpath are ignored. Everything has to be specified within the jar archive itself.
    Jars have a "manifest" which lets you do this. ProcessBigDump_fat.jar will already have a manifest: it has to in order to specify the main class. There will be a line like:
    Main-Class: myapp.Main(Assuming the class with the static main() method was Main and it was part of the myapp package.)
    What you have to do is add another line something like:
    Class-Path: mysql-connector-java-5.1.6-bin.jarwhich will use the mysql jar (located in the same place as your jar) as part of the classpath.
    Details in Sun's Tutorial.

  • OC4J - Adding jars to classpath

    Hi,
    Ive tried adding a new jar to oc4js classpath. Our application depends on this jar.
    I couldnt.
    Ive tried adding the jar as a 'library-path' tag within the server.xml. Then added it to the command line running oc4j ( -cp = .... ). It didnt do the trick.
    Ive only made some progress when putting it straight into oc4js lib directory.
    Im confused.
    1. What does the 'library-path' tab enable?
    2. Whats the difference between using it and supplying jars to the oc4js runtime classpath ( -cp ).
    3. What is the recommended way, to simply add a jar upon my application depends of?
    Any help would be apreceated,
    Yuval.

    HI Yuval,
    To include any Jar file in App server class path, you only have to copy the file in J2EE home\Lib\ folder. I also tried passing classpath to OC4J bUt to no use.
    But its working fine.
    Amit

  • No utl_dbws.jar in classpath!...no really...

    I am trying to complete the this user guide http://www.oracle.com/technology/sample_code/tech/java/jsp/callout_users_guide.htm
    and all it's fine until this
    C:\Documents and Settings\florinp\My Documents\wsdl>jpub -u infows/infows@oradev
    -sysuser sys/sinoptix -proxywsdl=TemperatureService.wsdl -endpoint=http://servi
    ces.xmethods.net:80/soap/servlet/rpcrouter -proxyopts=soap,tabfun -dir=weather -
    plsqlpackage=soap_ws_extern
    oracle.jpub.JPubException: Error: Cannot run the WebServices assembler for the g
    iven wsdl file. Please make sure that sqlj/lib/utl_dbws.jar appear in the classp
    ath.
    at oracle.jpub.genproxy.GenProxy.compileWSDL(GenProxy.java:1236)
    at oracle.jpub.genproxy.GenProxy.generateProxy(GenProxy.java:141)
    at oracle.jpub.Doit.main(Doit.java:331)
    at oracle.jpub.Doit.main(Doit.java:52)
    at oracle.jpub.publish.Main.main(Main.java:9)
    at oracle.jpub.Main.main(Main.java:6)
    J2T-106, ERROR: Sorry, unable to continue due to oracle.jpub.JPubException: Erro
    r: Cannot run the WebServices assembler for the given wsdl file. Please make sur
    e that sqlj/lib/utl_dbws.jar appear in the classpath.
    C:\Documents and Settings\florinp\My Documents\wsdl>echo %CLASSPATH%
    C:\bin\sqlj\lib\translator.jar;C:\bin\sqlj\lib\runtime12.jar;C:\bin\ORA9i\jdbc\l
    ib\classes12.jar;C:\bin\sqlj\lib\utl_dbws.jar;
    I am using a 9i database...
    what kind of error is this?

    Asuka Yuki wrote:
    Hi Joe,
    Thank you for your prompt reply. my code is for server side.
    The driverManager is actually for session bean to connect to Oracle database server.
    Hope to hear from you soon. Thousand thanks in advance.
    Rgds,
    AsukaHi. This is odd. Please show me the classpath the server startup script prints out
    when it starts. (both in the successful mode and in the failing mode).
    Would you also please try changing the bean code to do this:
    java.sql.Driver d = (java.sql.Driver) Class.forName("weblogic.jdbc.jts.Driver").newInstance();
    return d.connect("jdbc:weblogic:jts:myPoolName", null);
    Thanks,
    Joe
    >
    >
    Joe Weinstein <[email protected]> wrote:
    yuki wrote:
    Hi,
    I am currently maintaining Weblogic 5.1 server connecting to oracle using weblogic jts driver without weblogicaux.jar in my classpath and it is working fine. But now after I have appended weblogicaux.jar to my classpath. The console starts to print out weblogic.jdbc.jts.driver and no suitable driver exception. I have to add weblogicaux.jar to my classpath, please advise me. Thank you in advance for any advice.
    my code for getting connection is as below
    Class.forName("weblogic.jdbc.jts.Driver").newInstance();
    return DriverManager.getConnection("jdbc:weblogic:jts:myPoolName");Hi. Is this in serverside code, or in an external client? This will not
    work in an external client.
    Joe
    Rgds,
    Asuka

  • Run *jar with other jars in classpath...

    Hey,
    I am writing a little tool in Java and I exported it into a jar file. My tool uses a jar from somebody else. A second jar so to say...!
    My Jar's path is: ~/Desktop/project/dist/lib/MyTool.jar
    The other jar is located in: ~/Desktop/project/lib/help.jar
    I call the java vm from: ~/desktop/project/exe/
    with:
    java -cp ../lib/help.jar -jar ../dist/lib/MyTool.jar
    Now the tool starts running and everything works fine up to the moment when it is supposed to use one of the classes from the help.jar.
    Then I get a java.lang.NoClassDefFoundError.
    What am I doing wrong here?
    I tried to copy help.jar into the /exe/ dir. --> Did not work!
    I tried to copy all of the file into one folder and start the tool from there. --> didn't work.
    It would be great if somebody could point my in the right direction on how to solve my problem.
    THX
    Martin

    Hey,
    I am writing a little tool in Java and I exported it
    into a jar file. My tool uses a jar from somebody
    else. A second jar so to say...!
    My Jar's path is:
    ~/Desktop/project/dist/lib/MyTool.jar
    The other jar is located in:
    ~/Desktop/project/lib/help.jar
    I call the java vm from: ~/desktop/project/exe/
    with:
    java -cp ../lib/help.jar -jar
    -jar ../dist/lib/MyTool.jar
    Now the tool starts running and everything works fine
    up to the moment when it is supposed to use one of the
    classes from the help.jar.
    Then I get a java.lang.NoClassDefFoundError.
    What am I doing wrong here?
    I tried to copy help.jar into the /exe/ dir. --> Did
    not work!
    I tried to copy all of the file into one folder and
    start the tool from there. --> didn't work.
    It would be great if somebody could point my in the
    right direction on how to solve my problem.The classpath argument is ignored when you are running a jar using java -jar some.jar. You have to specify the class path from within the Manifest.
    Basic JAR tutorial:
    http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html
    Tutorial about the extension mechanism:
    http://java.sun.com/products/jdk/1.2/docs/guide/extensions/spec.html

  • Temporary remove a jar from classpath

    Hi,
    I need to solve the issue where i have to use two versions of a jar within one application, due to incompatibility between the versions.
    My idea was to temporary change the classpath:
    I can add jars to the path during runtime, but can i remove them again as well?
    Such as URLClassLoader..removeURL(URL url) would do (if this would exist) .. ?
    Any hints?:-) or other ideas?
    Regards,
    Andreas

    Hi,
    You can reload or remove jar during runtime, it is possible using ClassLoader's. You can have n versions of jar at the same time using version and caching mechanism. But the problem would be you need to load and maintain jar by yourself, using your own class loaders which extend base ClassLoader.

  • Jar Files in a Jar File - Classpath Error

    Hi,
    I created a jar file that will have all the class files of the application. In the manifest file class path, I have the jar files the application is dependent on. The dependent jar files were kept outside of the application jar file. I was able to execute the main file in the application jar file. Then I created another jar file that holds all the dependent jar files the application is dependent on along with the application jar file into one super jar file. configured the main class attribute of the super jar file to that in the application jar file. When I try to execute it, I'm getting an error saying Class Not Found. Can someone guide me in setting the classpath for this super jar file in its manifest file.
    Presently my manifest file classpath variable in the super jar file is set as App.jar Depend1.jar Depend2.jar
    Thanks,
    E H

    Java's standard class loaders do not support jar files inside of other jar files, and will give the error you see.
    You can write your own customized class loader, use a 3rd-party solution (onejar at sourceforge is one), or remove the interior jars.

Maybe you are looking for