MySql driver not found in WEB-INF/lib

Hello
This topic is very often met on this forum but there are no
suitable answers for the problem I have. I am creating
a Jsf application and I have setup a connection pool using
the MySql jar. I want to supply the jar with the war and I keep
it in WEB-INF/lib directory but I still get ClassNotFoundException.
I am running this on a Debian machine with Sun JVM 1.5,
Tomcat 5.0, Mysql 4.1, Connector/J - nightly build from
20060403 (since the stable version has bugs with Charset).
Here are the confings. If I missed some of them, pleaste tell
me.
War task in build.xml
    <target name="war" depends="build">
      <mkdir dir="${build.dir}"/>
      <war
        basedir="${webroot.dir}"
        warfile="${build.dir}/${project.distname}.war"
        webxml="${webinf.dir}/web.xml">
        <metainf dir="${meta.dir}">
          <include name="context.xml"/>
        </metainf>
        <exclude name="WEB-INF/${build.dir}/**"/>
        <exclude name="WEB-INF/src/**"/>
        <exclude name="WEB-INF/web.xml"/>
      </war>
    </target>
context.xml
<Context  path="/jsfblog" docBase="jsfblog.war" reloadable="false" crossContext="true" useNaming="true">
  <Resource name="jdbc/jsfblog" auth="Container" type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/jsfblog">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost/jsfblog</value>
    </parameter>
    <parameter>
      <name>driverClassName</name><value>com.mysql.jdbc.Driver</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>blog</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>blog</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>3000</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>100</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>10</value>
    </parameter>
  </ResourceParams>
</Context>
hibernate.cfg.xml
<hibernate-configuration>
    <session-factory>
        <property name="connection.datasource">java:comp/env/jdbc/jsfblog</property>
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="current_session_context_class">thread</property>
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
        <property name="show_sql">true</property>
        <mapping resource="......"/>
    </session-factory>
</hibernate-configuration>
web.xml
I am not sure if I really need this.
<web-app>
  <!-- Connection pool configuration  -->
  <resource-ref>
    <description>JSF Blog Database</description>
    <res-ref-name>jdbc/jsfblog</res-ref-name>
    <res-ref-type>javax.sql.DataSource</res-ref-type>
    <res-auth>Container</res-auth>
  </resource-ref>
  <!--  jsf and facelets declarations  -->
jsfblog.policy
Not all the rules apply at the same time. I also tried to
setup the mysql jar in ${catalina.home}/common/lib
directory and it was loaded but I need to make it work
in WEB-INF/lib location.
grant
     permission java.io.FilePermission "${catalina.home}/webapps/jsfblog/WEB-INF/lib/mysql-connector-java-3.1.12-bin.jar", "read";
     permission java.io.FilePermission "${catalina.home}/webapps/jsfblog/WEB-INF/lib/mysql-connector-java-3.1-nightly-20060403-bin.jar", "read";
     permission java.net.SocketPermission "localhost:3306", "connect,resolve";
grant codeBase "jar:file:${catalina.home}/webapps/jsfblog/WEB-INF/lib/hibernate3.jar!/-" {
     permission java.lang.RuntimePermission "accessDeclaredMembers";
     permission java.util.PropertyPermission "*", "read,write";
     permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
grant codeBase "jar:file:${catalina.home}/webapps/jsfblog/WEB-INF/lib/mysql-connector-java-3.1-nightly-20060403-bin.jar!/-"
     permission java.net.SocketPermission "localhost:3306", "connect,resolve";
     permission java.lang.RuntimePermission "accessDeclaredMembers";
     permission java.util.PropertyPermission "*", "read,write";
     permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
Project layout
|-- build
|   `-- jsfblog.war
|-- build.xml
|-- conf
|   `-- 99jsfblog.policy
|-- deploy
|   `-- jsfblog.war
|-- doc
|   |-- WEB-INF
|   |   |-- classes
|   |   |   |-- beans
|   |   |   |   `-- CategoryBean.class
|   |   |   |-- blog
|   |   |   |   |-- Category.class
|   |   |   |   |-- Category.hbm.xml
|   |   |   |   |-- Comment.class
|   |   |   |   |-- Comment.hbm.xml
|   |   |   |   |-- Post.class
|   |   |   |   `-- Post.hbm.xml
|   |   |   |-- hibernate.cfg.xml
|   |   |   |-- log4j.properties
|   |   |   `-- util
|   |   |       |-- HibernateSessionFactory.class
|   |   |       |-- HibernateUtil.class
|   |   |       `-- Service.class
|   |   |-- faces-config.xml
|   |   |-- lib
|   |   |   |-- antlr-2.7.5.jar
|   |   |   |-- asm-attrs.jar
|   |   |   |-- asm.jar
|   |   |   |-- cglib-2.1.3.jar
|   |   |   |-- common-annotations.jar
|   |   |   |-- commons-beanutils.jar
|   |   |   |-- commons-collections-2.1.1.jar
|   |   |   |-- commons-digester.jar
|   |   |   |-- commons-lang.jar
|   |   |   |-- commons-logging-1.0.4.jar
|   |   |   |-- commons-validator.jar
|   |   |   |-- dom4j-1.6.1.jar
|   |   |   |-- el-api.jar
|   |   |   |-- el-ri.jar
|   |   |   |-- hibernate3.jar
|   |   |   |-- jsf-api.jar
|   |   |   |-- jsf-facelets.jar
|   |   |   |-- jsf-impl.jar
|   |   |   |-- jsf-tlds.jar
|   |   |   |-- jstl.jar
|   |   |   |-- jta.jar
|   |   |   |-- log4j-1.2.11.jar
|   |   |   |-- mysql-connector-java-3.1-nightly-20060403-bin.jar
|   |   |   `-- standard.jar
|   |   `-- web.xml
|   |-- admin
|   |   |-- admintemplate.xhtml
|   |   |-- category.xhtml
|   |   |-- index.xhtml
|   |   `-- skeleton.xhtml
|   |-- index.jsp
|   `-- layout.css
|-- lib
|   `-- servlet.jar
|-- meta
|   `-- context.xml
`-- src
    |-- beans
    |   `-- CategoryBean.java
    |-- blog
    |   |-- Category.hbm.xml
    |   |-- Category.java
    |   |-- Comment.hbm.xml
    |   |-- Comment.java
    |   |-- Post.hbm.xml
    |   `-- Post.java
    |-- hibernate.cfg.xml
    |-- log4j.properties
    `-- util
        `-- HibernateUtil.javaAnd, finally, the error message:
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
     at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854)
     at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:164)
     at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:760)
     ... 60 moreI don't really understand how I can setup the CLASSPATH in this
context. So there should be something else. Does anyone have an
idea?
Thanks.
Igor

This is what I achived using the <metainf> tags from
war task in build.xml. Look at the first code
listing. The
magic code is:
<metainf dir="${meta.dir}">
<include name="context.xml"/>
</metainf>where ${meta.dir} is defined as ./meta and there
resides
the context.xml file (look at the project layout).Very good, thanks.
Any guesses why Tomcat is not loading mysql jar from
WEB-INF/lib directory?No. 8(
My understanding is that JARs in the WEB-INF/lib are visible only to your web app. Those in /common/lib are visible to all apps and the container. Those in /server/lib are visible only to the container and no apps. It SHOULD work from WEB-INF/lib. I've done it that way, but it was an older version of Tomcat.
Checked the Tomcat docs. They say to put it in /common/lib, but they don't explicitly forbid it in WEB-INF/lib.
I'll try a simpler example.
%

Similar Messages

  • JAR Files not found from /WEB-INF/lib

    It appears that weblogic server (6.1 SP2 I believe) is not finding all
    the jar files in the /WEB-INF/lib directory. Some, but not all. I am
    not using a WAR file, the dirctories are right on the disk. I start
    out with the following jar files in my WEB-INF/lib directory:
    Volume in drive C has no label.
    Volume Serial Number is 641F-B7A0
    Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\li
    b
    02/13/2002 11:34a <DIR> .
    02/13/2002 11:34a <DIR> ..
    01/25/2002 09:44a 45,386 activation-1.0.1.jar
    01/07/2002 04:49p 1,124,276 classes12.jar
    01/25/2002 09:44a 379,658 ecs-1.4.1.jar
    01/25/2002 09:44a 175,666 hsql.jar
    01/25/2002 09:44a 76,964 httpunit.jar
    01/25/2002 09:44a 236,041 idb.jar
    01/25/2002 09:44a 29,937 jakarta-regexp-1.3-dev.jar
    01/25/2002 09:44a 84,854 jdbc-se2.0.jar
    01/25/2002 09:44a 6,727 jdbc2_0-stdext.jar
    01/25/2002 09:44a 98,496 jndi-1.2.1.jar
    01/25/2002 09:44a 17,619 jta1.0.1.jar
    01/25/2002 09:44a 97,382 junit-3.2.jar
    01/25/2002 09:44a 152,037 log4j-1.1.jar
    01/25/2002 09:44a 280,984 mail-1.2.jar
    01/25/2002 09:44a 109,927 mm.mysql-2.0.4.jar
    01/25/2002 09:44a 76,734 oro.jar
    01/25/2002 09:44a 194,500 postgresql.jar
    01/25/2002 09:44a 4,041 README.txt
    01/25/2002 09:44a 208,635 sapdbc.jar
    02/13/2002 11:21a 216,879 STT.jar
    02/08/2002 12:15p 707,897 turbine-2.2b1.jar
    01/25/2002 09:44a 369,494 velocity-1.2-dev.jar
    01/25/2002 09:44a 31,326 village-1.5.1.jar
    01/25/2002 09:44a 436,094 xalan-1.2.1.jar
    01/25/2002 09:44a 840,704 xerces-1.3.0.jar
    01/25/2002 09:44a 47,926 xmlrpc.jar
    26 File(s) 6,050,184 bytes
    2 Dir(s) 29,539,246,080 bytes free
    When I run the server, only these files are put in the tmp_war
    directory:
    Volume in drive C has no label.
    Volume Serial Number is 641F-B7A0
    Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\_t
    mp_war_myserver_myserver_garyapp\WEB-INF\lib
    02/15/2002 12:31p <DIR> .
    02/15/2002 12:31p <DIR> ..
    02/15/2002 12:31p 1,124,276 classes1263855.jar
    02/15/2002 12:31p 175,666 hsql63856.jar
    02/15/2002 12:31p 76,964 httpunit63857.jar
    02/15/2002 12:31p 236,041 idb63858.jar
    02/15/2002 12:31p 6,727 jdbc2_0-stdext63859.jar
    02/15/2002 12:31p 76,734 oro63860.jar
    02/15/2002 12:31p 194,500 postgresql63861.jar
    02/15/2002 12:31p 208,635 sapdbc63862.jar
    02/15/2002 12:31p 216,879 STT63863.jar
    02/15/2002 12:31p 47,926 xmlrpc63864.jar
    10 File(s) 2,364,348 bytes
    2 Dir(s) 29,539,078,144 bytes free
    It's not only that the files don't show up, of course: if I run the
    system and it makes references to the files, I get a
    ClassNotFoundException:
    <Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
    <[WebAppServletContext(7243997,gar
    yapp,/garyapp)] Error loading servlet: "garyapp"
    java.lang.ClassNotFoundException: org.apache.turbine.Turbine
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
    areClassLoader.java:65)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
    areClassLoader.java:43)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:583)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    <Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
    <[WebAppServletContext(7243997,gar
    yapp,/garyapp)] Servlet failed with ServletException
    javax.servlet.ServletException: Servlet class:
    'org.apache.turbine.Turbine' coul
    d not be loaded - the requested class wasn't found in the classpath:
    'C:\bea\wl
    server6.1\config\mydomain\applications\garyapp;C:\bea\wlserver6.1\.\config\mydom
    ain\applications\garyapp\WEB-INF\classes;C:\bea\wlserver6.1\.\config\mydomain\ap
    plications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\classe
    s1263855.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_
    tmp_war_myserver_myserver_garyapp\WEB-INF\lib\hsql63856.jar;C:\bea\wlserver6.1\.
    \config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp
    \WEB-INF\lib\httpunit63857.jar;C:\bea\wlserver6.1\.\config\mydomain\applications
    \garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\idb63858.jar;C:\
    bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver
    myservergaryapp\WEB-INF\lib\jdbc2_0-stdext63859.jar;C:\bea\wlserver6.1\.\confi
    g\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-I
    NF\lib\oro63860.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WE
    B-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\postgresql63861.jar;C:\bea\
    wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_mys
    erver_garyapp\WEB-INF\lib\sapdbc63862.jar;C:\bea\wlserver6.1\.\config\mydomain\a
    pplications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\STT63
    863.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_w
    ar_myserver_myserver_garyapp\WEB-INF\lib\xmlrpc63864.jar'
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:594)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >

    Please open a case with support on this issue.
    Thanks,
    Michael
    Gary Bisaga wrote:
    It appears that weblogic server (6.1 SP2 I believe) is not finding all
    the jar files in the /WEB-INF/lib directory. Some, but not all. I am
    not using a WAR file, the dirctories are right on the disk. I start
    out with the following jar files in my WEB-INF/lib directory:
    Volume in drive C has no label.
    Volume Serial Number is 641F-B7A0
    Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\li
    b
    02/13/2002 11:34a <DIR> .
    02/13/2002 11:34a <DIR> ..
    01/25/2002 09:44a 45,386 activation-1.0.1.jar
    01/07/2002 04:49p 1,124,276 classes12.jar
    01/25/2002 09:44a 379,658 ecs-1.4.1.jar
    01/25/2002 09:44a 175,666 hsql.jar
    01/25/2002 09:44a 76,964 httpunit.jar
    01/25/2002 09:44a 236,041 idb.jar
    01/25/2002 09:44a 29,937 jakarta-regexp-1.3-dev.jar
    01/25/2002 09:44a 84,854 jdbc-se2.0.jar
    01/25/2002 09:44a 6,727 jdbc2_0-stdext.jar
    01/25/2002 09:44a 98,496 jndi-1.2.1.jar
    01/25/2002 09:44a 17,619 jta1.0.1.jar
    01/25/2002 09:44a 97,382 junit-3.2.jar
    01/25/2002 09:44a 152,037 log4j-1.1.jar
    01/25/2002 09:44a 280,984 mail-1.2.jar
    01/25/2002 09:44a 109,927 mm.mysql-2.0.4.jar
    01/25/2002 09:44a 76,734 oro.jar
    01/25/2002 09:44a 194,500 postgresql.jar
    01/25/2002 09:44a 4,041 README.txt
    01/25/2002 09:44a 208,635 sapdbc.jar
    02/13/2002 11:21a 216,879 STT.jar
    02/08/2002 12:15p 707,897 turbine-2.2b1.jar
    01/25/2002 09:44a 369,494 velocity-1.2-dev.jar
    01/25/2002 09:44a 31,326 village-1.5.1.jar
    01/25/2002 09:44a 436,094 xalan-1.2.1.jar
    01/25/2002 09:44a 840,704 xerces-1.3.0.jar
    01/25/2002 09:44a 47,926 xmlrpc.jar
    26 File(s) 6,050,184 bytes
    2 Dir(s) 29,539,246,080 bytes free
    When I run the server, only these files are put in the tmp_war
    directory:
    Volume in drive C has no label.
    Volume Serial Number is 641F-B7A0
    Directory of C:\bea\wlserver6.1\config\mydomain\applications\garyapp\WEB-INF\_t
    mp_war_myserver_myserver_garyapp\WEB-INF\lib
    02/15/2002 12:31p <DIR> .
    02/15/2002 12:31p <DIR> ..
    02/15/2002 12:31p 1,124,276 classes1263855.jar
    02/15/2002 12:31p 175,666 hsql63856.jar
    02/15/2002 12:31p 76,964 httpunit63857.jar
    02/15/2002 12:31p 236,041 idb63858.jar
    02/15/2002 12:31p 6,727 jdbc2_0-stdext63859.jar
    02/15/2002 12:31p 76,734 oro63860.jar
    02/15/2002 12:31p 194,500 postgresql63861.jar
    02/15/2002 12:31p 208,635 sapdbc63862.jar
    02/15/2002 12:31p 216,879 STT63863.jar
    02/15/2002 12:31p 47,926 xmlrpc63864.jar
    10 File(s) 2,364,348 bytes
    2 Dir(s) 29,539,078,144 bytes free
    It's not only that the files don't show up, of course: if I run the
    system and it makes references to the files, I get a
    ClassNotFoundException:
    <Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
    <[WebAppServletContext(7243997,gar
    yapp,/garyapp)] Error loading servlet: "garyapp"
    java.lang.ClassNotFoundException: org.apache.turbine.Turbine
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
    Loader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
    areClassLoader.java:65)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
    areClassLoader.java:43)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:583)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    <Feb 15, 2002 12:32:39 PM EST> <Error> <HTTP>
    <[WebAppServletContext(7243997,gar
    yapp,/garyapp)] Servlet failed with ServletException
    javax.servlet.ServletException: Servlet class:
    'org.apache.turbine.Turbine' coul
    d not be loaded - the requested class wasn't found in the classpath:
    'C:\bea\wl
    server6.1\config\mydomain\applications\garyapp;C:\bea\wlserver6.1\.\config\mydom
    ain\applications\garyapp\WEB-INF\classes;C:\bea\wlserver6.1\.\config\mydomain\ap
    plications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\classe
    s1263855.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_
    tmp_war_myserver_myserver_garyapp\WEB-INF\lib\hsql63856.jar;C:\bea\wlserver6.1\.
    \config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp
    \WEB-INF\lib\httpunit63857.jar;C:\bea\wlserver6.1\.\config\mydomain\applications
    \garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\idb63858.jar;C:\
    bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver
    myservergaryapp\WEB-INF\lib\jdbc2_0-stdext63859.jar;C:\bea\wlserver6.1\.\confi
    g\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-I
    NF\lib\oro63860.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WE
    B-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\postgresql63861.jar;C:\bea\
    wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_war_myserver_mys
    erver_garyapp\WEB-INF\lib\sapdbc63862.jar;C:\bea\wlserver6.1\.\config\mydomain\a
    pplications\garyapp\WEB-INF\_tmp_war_myserver_myserver_garyapp\WEB-INF\lib\STT63
    863.jar;C:\bea\wlserver6.1\.\config\mydomain\applications\garyapp\WEB-INF\_tmp_w
    ar_myserver_myserver_garyapp\WEB-INF\lib\xmlrpc63864.jar'
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
    mpl.java:594)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
    java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Driver class 'org.gjt.mm.mysql.Driver' not Found JSP

    OS ->Windows XP Pro
    Tomcat version ->4.0.1
    jdk version -> 1.3.1
    database -> mysql
    Classpath = .;C:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;C:\jakarta-tomcat-4.0.1\common\lib\mm.mysql.jdbc-1.2c\mysql_uncomp.jar;
    I am trying to run a function in a javabean to startup up a connection to a database. Code as follows...
    public void connect() throws ClassNotFoundException,
    SQLException,
    Exception {
    try {
    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    con = DriverManager.getConnection(
    "jdbc:mysql://localhost/Wrox ?user=root&password=lunchbox ");
    } catch (ClassNotFoundException cnfe) {
    error = "ClassNotFoundException: Could not locate DB driver.";
    throw new ClassNotFoundException(error);
    } catch (SQLException cnfe) {
    error = "SQLException: Could not connect to database.";
    throw new SQLException(error);
    } catch (Exception e) {
    error = "Exception: An unknown error occurred while connecting " +
    "to database.";
    throw new Exception(error);
    I call it from my jsp page code as follows.. connect in bold
    <%@ page language="java"
    import="java.sql.*, java.io.*, java.util.*, com.wrox.databases.*"
    errorPage="error.jsp" %>
    <jsp:useBean id="book" class="com.wrox.databases.Books" />
    <html>
    <head>
    <title> Wrox Press Ltd. </title>
    </head>
    <body>
    <h1> Wrox Press Ltd.</h1>
    <h2> List of Books </h2>
    <b>Add More Books</b>
    <form action="delete.jsp" method="post">
    <table border="1">
    <tr>
    <td><b>ID:</b></td>
    <td><B>Title:</b></td>
    <td><B>Price:</b></td>
    </tr>
    <%
    book.connect();
    ResultSet rs = book.viewBooks();
    while (rs.next()) {
    %>
    <tr>
    <td>
    <input type="checkbox" name="pkey"
    value="<%= rs.getString("Title_ID") %>" />
    </td>
    <td><%= rs.getString("Title") %></td>
    <td><%= rs.getString("Price") %></td>
    </tr>
    <%
    %>
    </table>
    Check books for deletion.<BR>
    <input type="submit" value="Delete All Checked Books">
    </form>
    <% book.disconnect(); %>
    </body>
    </html>
    The name of the bean is correct and so is the package it is stored under. I tried it in the bean and got "ClassNotFoundException" Could not locate DB driver". I tried it with DBtags and got
    Driver class 'org.gjt.mm.mysql.Driver' not Found
    any help would be really appreciated.

    When using any 3rd party library with tomcat. the jar file of that library has to be put in the WEB-INF/lib directory of your application. Then only tomcat will find it.
    So the my-sql driver would have come in a jar file. just put that jar file in the WEB-INF/lib directory.
    After that things should work. If they don't please post again.
    hope this helps.
    regards,
    Abhishek.

  • Class not found in web-inf/classes folder of war file within ear file

    Hi all,
              I am using Weblogic 8.1 sp4. I have a war file within an ear file. I am trying to deploy the war file with a few classes within its web-inf/classes folder, however when the classes are in that folder I consistently get a class not found exception when trying to instantiate them. If I package the classes in a jar file and then put that jar file within the web-inf/lib folder of the war, the classes are also not found.
              If I put these two classes in the app-inf/classes folder of the ear file, everything works as expected and the classes are found.
              Any ideas of why this is happening. This seems to be a very simple thing that should work, but appears to not be working at all.
              thanks in advance for any suggestions or ideas.

    Hi,
              This is a known limitation/issue with WL. There is also no way around this.
              Regards,
              LG

  • Web application can not find apphome /WEB-INF/lib/*.jar files in classpath?

    I need to add the jsse jars to one of my servlets. I do not want the jsse in the server classpath(jvm12.conf) however, because this screws with some credit card jar I am using. Can't I have a per application classpath with the /WEB-INF/lib directory? This is iWS 6.0.

    In iWS 6.0, the context information such as a context path of the web application and other properties are defined in web-apps.xml file.
    'class-loader' element in web-apps.xml file can be be used to specify the class path to a web application and customize how the application is serviced.
    Refer to example web-apps.xml file in Prog. guide to Servlets for more details.
    http://docs.iplanet.com/docs/manuals/enterprise/50/servlets/war.htm#33557

  • Help. JDBCRealm error -- org.gjt.mm.mysql.Driver not found

    Hi All,
    I tried to setup JDBCRealm. After I config. to JDBCRealm and restart tomcat. I got this error:
    java.sql.SQLException: org.git.mm.mysql.Driver error.
    Can someone help. Thanks

    web-inf/lib is not sufficient in this case, as the Tomcat engine needs access to the driver - not just your application.
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JDBCRealm
    You need to
    Place a copy of the JDBC driver you will be using inside the $CATALINA_HOME/server/lib directory (if you do not need it visible to web applications) or $CATALINA_HOME/common/lib (if it will be used both by Tomcat 4 and by your apps).
    Cheers.
    evnafets

  • Images not loaded from WEB-INF/lib/images.jar

    The images are found in root/images/*.gif, but not
    when jarred up and placed in the lib folder. I've looked everywhere
    for a solution but all I've seen is suggestions of other places to put
    the folder, or to add it to the classpath.
    The jar is being loaded but the images are not found. Or at least the images are not showing up - the table where the main image is linked expands to the size of the image when the path is correct.
    Does anyone know the solution to this problem? I don't want to just leave them in the folder at root level, because this does not work if I set a default url pattern for the control servlet.
    Thanks,
    Greg

    The images are found in root/images/*.gif, but not
    when jarred up and placed in the lib folder. I've
    looked everywhere
    for a solution but all I've seen is suggestions of
    other places to put
    the folder, or to add it to the classpath.
    The jar is being loaded but the images are not found.
    Or at least the images are not showing up - the table
    where the main image is linked expands to the size of
    the image when the path is correct.
    Does anyone know the solution to this problem? I don't
    want to just leave them in the folder at root level,
    because this does not work if I set a default url
    pattern for the control servlet.
    Thanks,
    GregIf your planning to make the images accessible by normal html tags - img etc, then they cant be in a jar, and they must be in a location from which the container serves content - i.e not under WEB-INF. Unless you want to write a special servlet which does nothing but read the images and feed them to the client - but I wouldnt recommend that.
    Sounds like your using Struts, and sounds like youre not using weblogic since you wouldnt be able to serve even jsp�s (using forward) from under WEB-INF if you were. Putting jsp�s under WEB-INF sounds like such a good idea when using Struts, but in practice...

  • Org.gjt.mm.mysql.Driver not found help!!

    hi all
    it's the first time for me working with MySql, and when i try to connect to the db, i have the following exception:
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    i know that i shall download it from Mysql site, but i don't know WHERE to put it
    i'm using forte 3.0 - jdk 1.4.0 on Win2K
    please help me!
    thanx
    sandro

    No problem,
    in general you should modify the CLASSPATH of your JDK to point to the jar-driver-file, e.g. (on unix): CLASSPATH = "someDirectory"\driverFIle.jar:$CLASSPATH
    and then: export CLASSPATH. That should solve your problem. if using windows: Just take a look at systemControlCenter. There it's possible to modify the CLASSPAT-environment.
    So far...

  • Jars in web-inf/lib not in classpath

              Hello,
              I am building a web application where I wish to use third party jars.
              (specifically cos.jar and log4j.jar)
              AFAIK when you place these jars in the web-inf/lib directory of your application
              they should then be included in the application classpath.
              However this does not seem to always work. I am using Weblogic 6.1, no service
              pack.
              Eventually I got it to work by adding a manifest to my EJB jar file with the classpath
              pointing to the jars and including the jars in the ear file.
              Has anyone else had any issues with this?
              Thanks,
              James
              

    James,
              Yes, I've had troubles with WLS 6.1.2 finding the classes in my jar files
              that are stored in WEB-INF/lib when deploying as a .war file. The funny
              thing is that when I deploy to a WLS 6.1.0 running on two other machines
              (one solaris, one linux), I don't see this problem.
              My servlets all extend the webmacro WMServlet class, which is found in
              WEB-INF/lib/webmacro.jar. When deploying my web app, grems, I see the
              following behavior.
              On WLS 6.1.0 (running on solaris), the server unjars the WEB-INF/lib files into
              ".wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_grems". That directory
              contains a jar file for each one in my .war files WEB-INF/lib directory.
              On WLS 6.1.2 (running on Solaris), however, the server just doesn't seem to do that.
              Instead, it creates
              ".wlnotdelete/WEB-INF/_tmp_war_myserver_myserver_grems/WEB-INF/lib". Not
              only that, but it doesn't put any of my jar files into that directory.
              Notice that it create the WEB-INF directory twice for some reason.
              Needless to say, any class which uses a class from one of those jar files
              bombs spectacularly with a ClassNotFound exception. This is extremely
              frustrating and any help would be greatly appreciated.
              Thanks,
              Bobby
              In article <[email protected]>, "James Lawless"
              <[email protected]> wrote:
              > Hello,
              >
              > I am building a web application where I wish to use third party jars.
              > (specifically cos.jar and log4j.jar)
              >
              > AFAIK when you place these jars in the web-inf/lib directory of your
              > application they should then be included in the application classpath.
              >
              > However this does not seem to always work. I am using Weblogic 6.1, no
              > service pack.
              >
              > Eventually I got it to work by adding a manifest to my EJB jar file with
              > the classpath pointing to the jars and including the jars in the ear
              > file.
              >
              > Has anyone else had any issues with this?
              >
              > Thanks,
              >
              > James
              

  • Project librarys not included in WAR file with deployment (WEB-INF/lib)

    Using JDeveloper 9.0.5.2
    Project Libraries are not included in WEB-INF/lib when deploying. Although the files are selected in the deployment file at 'Contributors'. Within the 'filter' the .jar files are missing.
    To solve it i have to register again (i have already made the librarys project library's) the files within Tools->ManageLibrarys as user library's.
    The other workaround is to make the library's System Library's within the project.
    In my opinion it is a bug that you must include the project librarys as user librarys within the 'LibraryManager'

    Unfortunately no, the issue with output folder being ignored occurs only with example apps bundled with Workshop product.
    You can try the following workaround:
    - In Workshop, Project > Properties - Java Build Path, switch to Source tab - "Remove the source folder listing" - Click OK and dismiss Properties window.
    - Project > Properties - Java Build Path > Source Tab, add the same source folder entry - Click OK
    - Export as WAR
    With this you should see the class files bundled under output directory structure (Ex: WEB-INF/classes).

  • Wl6.1sp2 can't find classes in WEB-INF/lib

              Hi,
              I meet a very strange problem.
              I use struts in my application.so I put struts.jar in web-inf/lib.
              In the .war file, the struts.jar can be found under web-inf/lib.
              my servlet configuration in web.xml is:
              <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              <init-param>
              <param-name>application</param-name>
              <param-value>StrutsProperties</param-value>
              </init-param>
              <init-param>
              <param-name>config</param-name>
              <param-value>/WEB-INF/struts-config.xml</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
              </servlet>
              when this .war file is deploy, the console not show any error message.
              then,when i visit a jsp page that has a <html:form> tag, the console will show
              the error below:
              <Error> <HTTP> <[WebAppServletContext(5418530,struts,/
              struts)] Servlet failed with Exception
              java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
              at java.lang.ClassLoader.defineClass0(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:11
              1)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
              at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
              areClassLoader.java:43)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:120)
              at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:563)
              at jsp_servlet.__logon._jspService(__logon.java:137)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:304)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:2495)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:2204)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              note "org/apache/struts/action/ActionForm" can be found when i open struts.jar
              in web-inf/lib
              why weblogic can't find this class but can find the "org.apache.struts.action.ActionServlet",
              these 2 classes should all be located in struts.jar
              i used it in win2k,so i think it may not be connect with case sensitive.
              Any one can give me some help or a link I did not found in this group.
              Thanks
              

              1.the struts-html.tld is in web-inf directory
              2.this is part of the web.xml
              ===========
              <taglib>
              <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
              </taglib>
              <taglib>
              <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
              </taglib>
              <taglib>
              <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
              </taglib>
              <taglib>
              <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
              </taglib>
              ================
              "Deepak Vohra" <[email protected]> wrote:
              >
              >Are the tld files including the struts-html.tld in the web-inf directory
              >& specified in the web.xml deployment descriptor?
              >
              >thanks,
              >
              >Deepak
              >
              >
              >"erric_sarra" <[email protected]> wrote:
              >>
              >>Hi,
              >>I meet a very strange problem.
              >>
              >>I use struts in my application.so I put struts.jar in web-inf/lib.
              >>In the .war file, the struts.jar can be found under web-inf/lib.
              >>
              >>my servlet configuration in web.xml is:
              >> <servlet>
              >> <servlet-name>action</servlet-name>
              >> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
              >> <init-param>
              >> <param-name>application</param-name>
              >> <param-value>StrutsProperties</param-value>
              >> </init-param>
              >> <init-param>
              >> <param-name>config</param-name>
              >> <param-value>/WEB-INF/struts-config.xml</param-value>
              >> </init-param>
              >> <load-on-startup>1</load-on-startup>
              >> </servlet>
              >>
              >>when this .war file is deploy, the console not show any error message.
              >>then,when i visit a jsp page that has a <html:form> tag, the console
              >>will show
              >>the error below:
              >><Error> <HTTP> <[WebAppServletContext(5418530,struts,/
              >>struts)] Servlet failed with Exception
              >>java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm
              >> at java.lang.ClassLoader.defineClass0(Native Method)
              >> at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
              >> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:11
              >>1)
              >> at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
              >> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
              >> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
              >> at java.security.AccessController.doPrivileged(Native Method)
              >> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
              >> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
              >> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
              >> at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
              >> at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
              >> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
              >> at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
              >>areClassLoader.java:43)
              >> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
              >> at java.lang.Class.forName0(Native Method)
              >> at java.lang.Class.forName(Class.java:120)
              >> at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:563)
              >> at jsp_servlet.__logon._jspService(__logon.java:137)
              >> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>pl.java:265)
              >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>pl.java:304)
              >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >>pl.java:200)
              >> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              >>rvletContext.java:2495)
              >> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              >>pl.java:2204)
              >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >>>
              >>
              >>note "org/apache/struts/action/ActionForm" can be found when i open
              >struts.jar
              >>in web-inf/lib
              >>why weblogic can't find this class but can find the "org.apache.struts.action.ActionServlet",
              >>these 2 classes should all be located in struts.jar
              >>
              >>i used it in win2k,so i think it may not be connect with case sensitive.
              >>
              >>Any one can give me some help or a link I did not found in this group.
              >>
              >>Thanks
              >>
              >>
              >
              

  • Driver not found - JDBC - HELP PLZ!

    Hello everyone.
    i am trying to access my database and this is the code i made:
    public static void connectToDataBase()
    Connection connect = null;
    try{
    String driverName = "oracle.jdbc.driver.OracleDriver";
    String serverName = "192.168.5.6";
    String portNumber = "1521";
    String sid = "deve";
    String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber +
    ":" + sid;
    String usr = "emma";
    String pwd = "emma";
    //Load the JDBC driver
    Class.forName(driverName);
    //Connect to the base
    connect = DriverManager.getConnection(url,usr,pwd);
    catch(ClassNotFoundException e){
    System.out.println("Error---No database driver");
    catch(SQLException s){
    System.out.println("Error---No connection to the database");
    However, when i execute this program, a ClassNotFoundException is launched because i get the message "Error---No database driver".
    Can anyone help me please??
    thank you

    However, when i execute this program, a
    ClassNotFoundException is launched because i get the
    message "Error---No database driver".As mentioned already, you need to add the driver jar in the classpath. Depending on the type of application you are creating, the method for doing that would vary.
    For a simple standalone application, it can be achieved by simply including the JAR name (with path) in the classpath. This can be done by editing the CLASSPATH variable, which I mostly do not prefer, or using the command line switch -cp to set the classpath for the specific command.
    If you are dealing with web applications, you need not play around with the environment variables simply because it would not have any effect. Almost all application servers AFAIK ignore the environment settings. The best way of doing it is copying the driver jar to the WEB-INF/lib sub-directory under your webapp directory. (You could ignore this advice ATM if you haven't started with web applications yet). However, the preferred method of connection in case of webapps (or J2EE applications I might generalize) is using a datasource.
    Finally, a word of advice which I am often tempted to mention early on. Ensure that you are closing all the connections, statements and resultsets in your application once their job is done. Not doing so may lead to further complications in the future, depending on the driver implementations. The safest way is to call the close methods on all the JDBC resources in the finally block of your code to ensure that you always close the resources.
    Gluck!

  • Classes in web-inf/lib not being found.

    I'm having problems with a servlet app in which jar files placed in the web-inf/lib of the application are not found at runtime.
    If I put them in J2ee\home\lib they are found OK.
    This application has previously deployed and worked correctly, then I added another servlet and redeployed, and classes that were previously found OK stopped being found.
    On checking the server all the directories look correct.
    What could be causing this and how can I make my web applications deploy reliably?
    OC4J version is 9.0.3.0.0.
    Thanks

    Guys,
    Have you tried with the production version of OC4J 9.0.2 ? It should work. Please download the production version of OC4J 9.0.2 and give a try.
    regards
    Debu Panda
    Oracle

  • Bug:WEB-INF/lib JARs not added to runtime classpath of WebLogic Server

    The JAR files packaged in the WEB-INF/lib directory of an application do not get installed to the runtime classpath of the Weblogic server.
    Edited by: dvohra16 on Feb 28, 2013 9:24 AM

    Some posts in which an external jar, usually a JDBC jar, had to be added to the startWebLogic script to be added to the runtime classpath of WebLogic server.
    Re: jdbc problem on MS SQL Server
    Re: MySQL JDBC driver w/11.1.2 where too now?
    Re: ADF Parameter form  - java.lang.NoClassDefFoundError: sqlj/runtime/ref/Defa
    Re: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Re: deploy a shared library
    Re: Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    Re: Help need in Adding External jar files.
    Re: NoClassDefFoundError  while Testing a JAX-WS Web Service
    Re: Unable to connect to SQL server 2008 from a deployed Weblogic application
    Re: Howo to add external jar - quick question
    Re: MySql connection with JDev 11.1.2.2 issues
    Re: Integration of MySQL with ADF application

  • Jce in web-inf/lib - does not work

    Hi all!
    I've got the following problem:
    I accomplished to form an ear file that contains an ejb jar and a war file. The
    ejb jar manifest includes several jars that are part of the ear file. Additionally
    the web app needs the following jars: local_policy.jar, jce1_2_1.jar, US_export_policy.jar
    When I put these files into the WEB-INF/lib of the webapp or into Manifest's Class-Path
    of the ejb.jar I always get the same behaviour:
    I can deploy it (yipieeh) but when I run the web app I get the following exception
    (uieehh):
    java.lang.SecurityException: Cannot authenticate JCE framework java.lang.SecurityException:
    The JCE framework has unsigned class files. at com.sun.crypto.provider.SunJCE.a([DashoPro-V1.2-120198])
    at com.sun.crypto.provider.SunJCE.c([DashoPro-V1.2-120198]) at com.sun.crypto.provider.PBEKeyFactory.<init>([DashoPro-V1.2-120198])
    at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Class.java:237)
    at javax.crypto.Support.getImplementation(Support.java:77) at javax.crypto.Support.getImplementation(Support.java:32)
    at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:42)
    Surprisingly it works when I put the jar files into wls6.1SP2's lib directory
    respectively to wls's classpath! But what I need is one ear file that contains
    everything ...
    Please if you know this problem, a workaround or you have only a guess reply to
    this message.
    Thanks for every serious response,
    Chris.

    Well if you got the jar file to work in the /lib/ dir of the EAR file with
    the manifest.mf Class-Path: entry then more power to you. This didn't work
    for me for some reason, just let each ejb/war/etc compile to its own dir and
    deploy it with all its dependencies included...
    Your MalformedURL exception looks different than the security exception you
    had earlier. Im guessing that putting the files in a common location in the
    ear solved the class loading/security exception problem.
    Your malformedURL problem is probably just that, a malformed URL.
    Make sure all your associated metadata is pointing to the right place (use
    paths of /someApp/somejsp.jsp, etc. dont use ../../somejsp.jsp)
    make sure your using the right protocol (dont put one by default). This
    would be my guess. Maybe its expecting an SSL call of the form
    https://something or t3s://something but I'm not sure
    hope this helps,
    Michael Lee
    Architect
    AfterBOT
    [email protected]
    remove nospam_ to email
    "Chris" <[email protected]> wrote in message
    news:[email protected]...
    >
    First of all: Thanks for your response
    "Michael Lee" <[email protected]> wrote:
    Your getting that error because different wars run in different class
    loaders. It does not trust the other class loaders files unless they're
    signed in some way. I think one way you can do this is set up a
    security.policy? file for each war that tells what files are allowedI was thinking about that but: How can I do that?
    from
    where. Here's the way the WLS class loaders work...
    WLS system class loader
    |
    EAR class loader
    |
    EJB class loader
    |
    WAR class loader
    everything down on the chain there can see up, but not vice versa. You
    will
    get a class not found
    That way, the war files can call ejb's without problems, but EJBs can
    not
    access war file classes.
    One other possible way around your problem is to add a /lib/... directory
    to
    your EAR and include a Class-Path: section in your manifest to point
    to the
    JCE files. I think this allows war files to see each others classes.You have to manipulate the EJB-Manifest and put the jar files into the earfile!
    At least this is how it worked in my case! But I 've tried that alreadybut then
    I get a very similiar Exception: something with can not authenticate: ..MalormedURLException:
    no protocol ...
    This
    didn't work for me when I tried to create a shared library between
    EJBs/WARs
    but I didnt try to share files between 2 wars so who knows.
    Hope this helps some,
    Mike Lee
    Architect
    AfterBOT
    [email protected]
    Just remove nospam_ to email me
    "Chris" <[email protected]> wrote in message
    news:[email protected]...
    Hi all!
    I've got the following problem:
    I accomplished to form an ear file that contains an ejb jar and a warfile. The
    ejb jar manifest includes several jars that are part of the ear file.Additionally
    the web app needs the following jars: local_policy.jar, jce1_2_1.jar,US_export_policy.jar
    When I put these files into the WEB-INF/lib of the webapp or intoManifest's Class-Path
    of the ejb.jar I always get the same behaviour:
    I can deploy it (yipieeh) but when I run the web app I get the
    following
    exception
    (uieehh):
    java.lang.SecurityException: Cannot authenticate JCE frameworkjava.lang.SecurityException:
    The JCE framework has unsigned class files. atcom.sun.crypto.provider.SunJCE.a([DashoPro-V1.2-120198])
    at com.sun.crypto.provider.SunJCE.c([DashoPro-V1.2-120198]) atcom.sun.crypto.provider.PBEKeyFactory.<init>([DashoPro-V1.2-120198])
    at java.lang.Class.newInstance0(Native Method) atjava.lang.Class.newInstance(Class.java:237)
    at javax.crypto.Support.getImplementation(Support.java:77) atjavax.crypto.Support.getImplementation(Support.java:32)
    at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:42)
    Surprisingly it works when I put the jar files into wls6.1SP2's libdirectory
    respectively to wls's classpath! But what I need is one ear file thatcontains
    everything ...
    Please if you know this problem, a workaround or you have only a guessreply to
    this message.
    Thanks for every serious response,
    Chris.

Maybe you are looking for