JDBC help needed ; java.lang.NoClassDefFoundError:test1

hi, everyone, i had a problem when i run my own app to connect javadb in embedded mode
i ve added the ~/javadb/lib/derby.jar to CLASSPATH
and ~/javadb/lib/derby.jar:~/javadb/lib/derbytools.jar to DERBY_HOME
but there is a problem said my own application class cannot be found.
here is my code:
import java.sql.*;
class test1
  public static void main (String args [])
       throws SQLException
       try {
        Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
    } catch (Exception e) {
        System.out.println("ERROR: failed to load javadb JDBC driver.");
        e.printStackTrace();
        return;
      Connection conn = DriverManager.getConnection("jdbc:derby:testdb");
  try{
     Statement stmt1 = conn.createStatement();
        ResultSet rset1 = stmt1.executeQuery( "SELECT * FROM PART" );
     long counter1 = 0;
        double price1;
     while ( rset1.next() )
         price1 = rset1.getDouble(8);
         if (price1 == 1306.4)
          counter1++;
     System.out.println( counter1 );
     stmt1.executeQuery("SHUTDOWN");
     conn.close();
   catch (SQLException e )
     String errmsg = e.getMessage();
     System.out.println( errmsg );
}and i ve followed one Derby JDBC tutorial on the internet,
* AutoLoadJdbcDriver.java
* Copyright (c) 2007 by Dr. Herong Yang. All rights reserved.
import java.sql.*;
import java.util.*;
public class AutoLoadJdbcDriver {
  public static void main(String [] args) {
    Connection con = null;
    try {
      listDrivers();
// Find the driver for a given URL
      Driver driverClass = (Driver) DriverManager.getDriver(
        "jdbc:derby://somehost/somedb");
      System.out.println("\nDriver for jdbc:derby://somehost/somedb");
      System.out.println("   "+driverClass.getClass().getName());
      listDrivers();
    } catch (Exception e) {
      System.err.println("Exception: "+e.getMessage());
  private static void listDrivers() {
    Enumeration driverList = DriverManager.getDrivers();
    System.out.println("\nList of drivers:");
    while (driverList.hasMoreElements()) {
      Driver driverClass = (Driver) driverList.nextElement();
      System.out.println("   "+driverClass.getClass().getName());
The output below confirms that the DriverManager class is able to load any JDBC driver classes as long as their JAR files are included in the classpath.
C:\>javac AutoLoadJdbcDriver.java
C:\>java -cp .;\local\javadb\lib\derbyclient.jar AutoLoadJdbcDriver
List of drivers:
sun.jdbc.odbc.JdbcOdbcDriver
org.apache.derby.jdbc.ClientDriver
Driver for jdbc:derby://somehost/somedb
org.apache.derby.jdbc.ClientDriver
List of drivers:
sun.jdbc.odbc.JdbcOdbcDriver
org.apache.derby.jdbc.ClientDriver
but on my machine , it keep telling me the massage
Exception in thread "main" java.lang.NoClassDefFoundError: SimpleApp
Exception in thread "main" java.lang.NoClassDefFoundError: test1
Exception in thread "main" java.lang.NoClassDefFoundError: AutoLoadJdbcDriver
the ij works well
and the other java app(without jdbc) works well.
anybody can help me to solve this problem?
Edited by: Xiao on Jan 18, 2008 6:19 PM

but on my machine , it keep telling me the massage
Exception in thread "main" java.lang.NoClassDefFoundError: SimpleApp
Exception in thread "main" java.lang.NoClassDefFoundError: test1
Exception in thread "main" java.lang.NoClassDefFoundError: AutoLoadJdbcDriverI assume you get these messages when you try and run the three programs mentioned (SimpleApp, test1 and AutoLoadJdbcDriver).
What commands do you use to do this? What does the command line report the CLASSPATH to be (using the echo command)?
The simplest cause would be that you have the derby jar mentioned as part of CLASSPATH, but not the current directory.

Similar Messages

  • Help on "java.lang.NoClassDefFoundError: oracle/jsp/runtimev2/JspReportUtil"

    Hi all,
    I encounted the following exception on a deployed project to ias 9.0.2:
    500 Internal Server Error
    java.lang.NoClassDefFoundError: oracle/jsp/runtimev2/JspReportUtil     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:333)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java(Compiled Code))     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java(Compiled Code))     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java(Compiled Code))     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:108)     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.EvermindPageContext.handlePageThrowable(EvermindPageContext.java:596)     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.EvermindPageContext.handlePageException(EvermindPageContext.java:567)     at data.lookjjview._jspService(_lookjjview.java(Compiled Code))     at com.orionserver[Oracle9iAS (9.0.2.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java(Compiled Code))     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java(Compiled Code))     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java(Compiled Code))     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java(Compiled Code))     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java(Compiled Code))     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)     at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java(Compiled Code))
    I found there is leak of memory resource on the Oracle RDBMS host while this problem occurs,the database host has only 512Mb RAM.And I once configred the database to worked on Shared Mode,in this case the database has less chance of memory leak,but the above exception occurs more often.So I have to change the database to work back on Dedicate Mode!It's hard to find any tips on my Exception as mentioned above.
    And I want to know the working principle of servlet on iAS.When invoke a servlet,will the servlet be cached on Memory from the first request,or it will be clear up and re-inload until next request?I just wonder if the iAS server will run out of memory,because I noticed there is a memory configure option in "jser.properties" file.And the exception I encoutered seems to occur at a critical point.

    Thanks but that did help since they are talking about
    JDK1.3. I downloaded J2SDK-Beta 3 it says that you
    don't need to set a class path variable. You need to be careful about how you interpret this statement. The rule is, if your system doesn't have a classpath set, you'll get a default of the current directory (.). If your system does have a classpath setting, then the setting will be used.
    Just because you didn't set your classpath doesn't mean someone or some other application didn't. Make sure that your system doesn't have a classpath setting. If it does, you may need to add the current directory (.) to it.

  • Help for java.lang.NoClassDefFoundError:

    hi all, i wrote a jws shows the following.
    import java.lang.*;
    import java.util.*;
    * * @author bow5003
    public class CalculatorWithDLL {
    private native float add(float num1, float num2);
    private native float sub(float num1, float num2);
    private native float mult(float num1, float num2);
    private native float divid(float num1, float num2);
    private native float square(float num1);
    private native float tripple(float num1);
    //private float result;
    /** Creates a new instance of CalculatorWithDLL */
    public static float getAdd(float num1, float num2) {
    CalculatorWithDLL calculator = new CalculatorWithDLL();
    float result = calculator.add(num1, num2);
    return result;
    public static float getSub(float num1, float num2){
    CalculatorWithDLL calculator = new CalculatorWithDLL();
    float result = calculator.sub(num1, num2);
    return result;
    public static float getMult(float num1, float num2) {
    CalculatorWithDLL calculator = new CalculatorWithDLL();
    float result = calculator.mult(num1, num2);
    return result;
    public static float getDivid(float num1, float num2) {
    CalculatorWithDLL calculator = new CalculatorWithDLL();
    float result = calculator.divid(num1, num2);
    return result;
    public static float getSquare(float num1) {
    CalculatorWithDLL calculator = new CalculatorWithDLL();
    float result = calculator.square(num1);
    return result;
    public static float getTriple(float num1) {
    CalculatorWithDLL calculator = new CalculatorWithDLL();
    float result = calculator.tripple(num1);
    return result;
    static {
    System.loadLibrary("Calculator");
    and when i try to access throw the web browser http://localhost:8080/axis/JWS_Files/CalculatorWithDLL.jws?wsdl it gives the error:
    java.lang.NoClassDefFoundError: Could not initialize class CalculatorWithDLL
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:168)
    at java.security.AccessController.doPrivileged(NativeMethod)
    at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
    at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:142)
    at org.apache.axis.utils.cache.ClassCache.lookup(ClassCache.java:85)
    at org.apache.axis.providers.java.JavaProvider.getServiceClass(JavaProvider.java:428)
    at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:461)
    at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:286)
    at org.apache.axis.handlers.JWSHandler.setupService(JWSHandler.java:273)
    at org.apache.axis.handlers.JWSHandler.generateWSDL(JWSHandler.java:294)
    at org.apache.axis.strategies.WSDLGenStrategy.visit(WSDLGenStrategy.java:33)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.generateWSDL(SimpleChain.java:104)
    at org.apache.axis.server.AxisServer.generateWSDL(AxisServer.java:454)
    at org.apache.axis.transport.http.QSWSDLHandler.invoke(QSWSDLHandler.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.axis.transport.http.AxisServlet.processQuery(AxisServlet.java:1226)
    at org.apache.axis.transport.http.AxisServlet.doGet(AxisServlet.java:249)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    anyone can help me?
    Message was edited by:
    BCW0928
    Message was edited by:
    BCW0928

    Where is the dll ?
    you need to include it in a jar, and ref that jar with
    <nativelib href=<url to the jar>/>
    and request all-permissions in you jnlp file (and sign both jars)
    /Andy

  • First Spring Application .Help needed.java.lang.ClassNotFoundException

    Hi
    i am new to this site and java Springs, I couldn't find seprate spring forum so i am posting my question here.
    i hope its not a problem.
    I am very new to Springs and struggeling through my first Spring MVC application. can any one help me here.
    Here is what i have done uptill now.
    WEB.XML
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <servlet>
            <servlet-name>HelloSpring</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
            </servlet>
        <servlet-mapping>
            <servlet-name>HelloSpring</servlet-name>
            <url-pattern>*.htm</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>      
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
         <welcome-file>
                index.jsp
            </welcome-file>
        </welcome-file-list>
    </web-app>
    HelloSpring-servlet.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN/EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
        <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <props>
                    <prop key="/hello.htm">HelloSpringController</prop>
                </props>
            </property>
        </bean>
        <bean id = "HelloSpringController" class="HelloSpringController" />
    </beans>
    index.jsp
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Hello Spring</title>
        </head>
        <body>
        <form action="hello.htm"  method="POST">
            What is your name?
            <input type="text" name="yourName" value="" />
        </form>
        </body>
    </html>
    welcome.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Hello Spring</title>
        </head>
        <body>
        Hello <c:out value="${name}" />
        </body>
    </html>
    HelloSpringController.java (in default package)
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.Controller;
    public class HelloSpringController implements Controller {
        public HelloSpringController() {
        public ModelAndView handleRequest(HttpServletRequest httpServletRequest,
                                          HttpServletResponse httpServletResponse)
                                            throws Exception {
            String name = httpServletRequest.getParameter("yourName");
            return new ModelAndView("welcome.jsp", "name", name);
    }After Entering name in the text box of index.jsp, i am getting the following error.
    exception
    javax.servlet.ServletException: Servlet.init() for servlet HelloSpring threw exception
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         java.lang.Thread.run(Unknown Source)
    root cause
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/HelloSpring-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [HelloSpringController] for bean with name 'HelloSpringController' defined in ServletContext resource [/WEB-INF/HelloSpring-servlet.xml]; nested exception is java.lang.ClassNotFoundException: HelloSpringController
         org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
         org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
         org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
         org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
         org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
         org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
         org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
         org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:330)
         org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
         org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
         org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
         javax.servlet.GenericServlet.init(GenericServlet.java:211)
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         java.lang.Thread.run(Unknown Source)
    root cause
    java.lang.ClassNotFoundException: HelloSpringController
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
         org.springframework.util.ClassUtils.forName(ClassUtils.java:201)
         org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:327)
         org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1066)
         org.springframework.beans.factory.support.AbstractBeanFactory.isBeanClassMatch(AbstractBeanFactory.java:1094)
         org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:354)
         org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:745)
         org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:255)
         org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:125)
         org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
         org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
         org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:72)
         org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:304)
         org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1168)
         org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
         org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
         org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
         org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
         org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
         org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
         org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
         org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:330)
         org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
         org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
         org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
         javax.servlet.GenericServlet.init(GenericServlet.java:211)
         org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         java.lang.Thread.run(Unknown Source)Can anybody tell me what is am doing wrong .. it will be a greate help...
    thanks in advance

    vikash_sharma wrote:
    Thanks for another quick reply
    here is the folder structure of war.
    HelloSpring.war
    -----------Bin (empty)Wrong. No need for this. Remove it.
    ------------src/HelloSpringController.javaWrong. Source code doesn't go in WAR.
    ------------WEB-INF/classes(empty)there's your problem. the HelloSpringController.class has to be in there.
    /libWhere are the Spring JARs?
    /META-INF
    /tldDon't need /tld.
    ------------welcome.jsp
    ------------index.jspWhere's your web.xml? Where is the Spring configuration?
    You're still blank. Not even close to correct. You don't seem to know Java well enough to tackle this. You will NOT be able to accomplish this by asking questions here. Go back and learn more basics.
    %

  • Java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

    When I run java servlet test_ora.java with IE6.0 I get the following error page:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2349)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:376)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:518)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
         at test_ora.doGet(test_ora.java:21)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2349)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:646)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:644)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:483)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:376)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:518)
         at java.lang.Thread.run(Thread.java:536)
    Java Web Services Developer Pack/1.0-fcs
    I thought it is about JDBC configuration. But when I run JdbcCheckup.java everything works fine. Can anybody help me, please?
    test_ora.java looks like this:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class test_ora extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    String str_dok_numer, str_f_inkraft;
    int int_dok_wal_id;
    Connection conn=null;
    Statement s = null;
    response.setContentType("text/html;charset=iso-8859-2");
    PrintWriter out = response.getWriter();
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@192.168.15.2:1521:DB2","janusz","kimono");
    s = conn.createStatement();
    } catch (SQLException e) {
    out.println("Blad polaczenia z baza danych: " + e.getMessage());
    try {
    ResultSet r =s.executeQuery("select dok_numer, f_inkraft, dok_wal_id from gndlf_umowy_inkraft");
    out.println("DOK_NUMER\tF_INKRAFT\tDOK_WAL_ID");
    while(r.next()){
    out.println (r.getString (1) +"\t" + r.getString (2) + "\t" +r.getString (3));
    conn.close();
    } catch (Exception e) {
    out.println("Wystapil problem z wyslaniem SQL do bazy danych: " + e.getMessage());
    finally {
    try { conn.close(); }
    catch(SQLException e) {}
    and here is code for JdbcCheckup.java (I get it from Internet and made some modifications):
    * This sample can be used to check the JDBC installation.
    * Just run it and provide the connect information. It will select
    * "Hello World" from the database.
    // You need to import the java.sql package to use JDBC
    import java.sql.*;
    // We import java.io to be able to read from the command line
    import java.io.*;
    class JdbcCheckup {
    public static void main(String args[])
    throws SQLException, IOException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Prompt the user for connect information
    System.out.println("Please enter information to test connection to the database");
    String user;
    String password;
    String database;
    user = readEntry("user: ");
    int slash_index = user.indexOf('/');
    if (slash_index != -1)
    password = user.substring(slash_index + 1);
    user = user.substring(0, slash_index);
    else
    password = readEntry("password: ");
    database = readEntry("database(a TNSNAME entry): ");
    System.out.print("Connecting to the database...");
    System.out.flush();
    System.out.println("Connecting...");
    //Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@" + database, user, password);
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.168.15.2:1521:" + database, user, password);
    System.out.println("connected!!!");
    // Create a statement
    Statement stmt = conn.createStatement();
    // Do the SQL "Hello World" thing
    ResultSet rset = stmt.executeQuery("select 'Hello World' from dual");
    while (rset.next())
    System.out.println(rset.getString(1));
    // close the result set, the statement and connect
    rset.close();
    stmt.close();
    conn.close();
    System.out.println("Your JDBC installation is correct.");
    // Utility function to read a line from standard input
    static String readEntry(String prompt)
    try
    StringBuffer buffer = new StringBuffer();
    System.out.print(prompt);
    System.out.flush();
    int c = System.in.read();
    while (c != '\n' && c != -1)
    buffer.append((char)c);
    c = System.in.read();
    return buffer.toString().trim();
    catch(IOException e) {
    return "";
    I use Java Web Service Developer Pack 1.0 on Win98 SE, database Oracle 8.1.7 is installed on dedicated IBM server (AIX 4.x).
    I put these lines in autoexec.bat:
    set PATH=C:\Perl\bin\;"C:\j2sdk1.4.0\bin";%PATH%
    set CLASSPATH=.;C:\j2sdk1.4.0\lib\tools.jar;C:\j2sdk1.4.0\lib\classes12.zip;C:\j2sdk1.4.0\lib\classes111.zip;%CLASSPATH%
    set CLASSPATH=C:\jwsdp_1_0\common\lib\servlet.jar;C:\jwsdp_1_0\common\lib\jasper-compiler.jar;C:\jwsdp_1_0\common\lib\jasper-runtime.jar;%CLASSPATH%
    set JAVA_HOME=C:\j2sdk1.4.0

    I have the same problem. I created a JSP page that uses a class to retrieve database information. I added a main method to the class so I would be able to test it. When I test the class using the main method the method returns all the information from the database. When I try it using Tomcat, I get the following error: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    Does anyone have an idea of what is going on?
    My CLASSPATH configuration is the same.

  • Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/pool

    I have the following configuration:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    on a Suse 10.1 Linux.
    The javaversion is Java.Version = 1.4.2_11
    The classpath does look like:
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen> echo $CLASSPATH
    /derby.jar:/derbytools.jar:/derbynet.jar:/derbyclient.jar:/derbyTesting.jar:/local/derby/tools/java/jakarta-oro-2.0.8.jar:/derbyLocale_de_DE.jar:/derbyLocale_es.jar:/derbyLocale_fr.jar:/derbyLocale_it.jar:/derbyLocale_ja_JP.jar:/derbyLocale_ko_KR.jar:/derbyLocale_pt_BR.jar:/derbyLocale_zh_CN.jar:/derbyLocale_zh_TW.jar:/oracle/oracle/product/10.2.0/db_1/jdbc/lib/classes12.jar:/oracle/oracle/product/10.2.0/db_1/jdbc/lib/classes12.zip:/oracle/oracle/product/10.2.0/db_1/jlib/orai18n.jar:/oracle/oracle/product/10.2.0/db_1/jdbc/lib/ojdbc14.jar:/home/Eisele/Oracle/ojdbc14.jar:/home/Eisele/FH-Weihenstephan/Winter_Semester_200809/Uebungen
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen>
    The Program JDBCVersion.java which I copied out of the Oracle-Documentation looks like:
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.jdbc.pool.OracleDataSource;
    class JDBCVersion
    public static void main (String args[]) throws SQLException
    System.out.println("Java.Version = " + System.getProperty("java.version")) ;
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("jdbc:oracle:thin:scott/tiger@host:port:service");
    Connection conn = ods.getConnection();
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();
    // gets driver info:
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
    I get the following error
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen> javac JDBCVersion.java
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen> java -cp ~/FH-Weihenstephan/Winter_Semester_200809/Uebungen/ JDBCVersion
    Java.Version = 1.4.2_11
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource
    at JDBCVersion.main(JDBCVersion.java:10)
    Eisele@brezn:~/FH-Weihenstephan/Winter_Semester_200809/Uebungen>
    Can anyone help me out here and tell me, what I did wrong ?
    Thanks in advance !
    Rüdiger

    Two thoughts.
    The first is that 10.2.0.1 is unpatched. Why? It has been two years since its release and no one has applied 10.2.0.2, 10.2.0.3 or 10.2.0.4.
    The second is that your question is not a database question but a Java question is you are more likely to get an answer that will help you if you post in a group where it is on-topic.

  • Please HELP me with installation - java.lang.noclassdeffounderror:

    Please Help! For school we need to install JAVA. I installed JDK 5.0 and id did not work. I got exception in thread "main" java.lang.noclassdeffounderror: hello. I was using Texpad to write, compile, and run it. In short I deleted all JAVA 5.0 using My Computer program removal. I installed JAVA 1.4..2_10 and I am still getting that same error. I want the JAVA 1.4..2_10 to be installed and not JAVA.5.0.
    My System Variable CLASSPATH still shows C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip. My System Variable PATH has nothing as far as JAVA in it. MY PATHEXT has JS and JSE amoung other things in it. My System Variable QTJAVA still has Files\Java\jre1.5.0_03\lib\ext\QTJava.zip in it.
    Please tell me step-by-step how I can fix this. I never updated these variables before. What do I need to type and where? What do I need to get rid of or change?
    PLEASE HELP!
    Thanks,
    Jim

    I left my System variable classpath --> C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip I left my QT JAVA --> C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip I added Path --> ;C:\j2sdk1.4.2_10\bin and then restarted my computer. I added hello file in C:\j2sdk1.4.2_10\bin and tried to compile it under a new name and it would not compile. it gave me the error below. I was able to compile other java program in my other folder in a different directory. I am still getting the same error messages/ Anything else I should try? IS there anyplace or person I can call who would come and fix this? Something is wrong. This should not be giving me this much trouble. All The Java directions on other websites tell me to do different things. I am so confused... please help.
    I get this during the compilenow:
    javac: invalid flag: C:\j2sdk1.4.2_10\bin\helloa.txt
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options
    Tool completed with exit code 2
    Jim
    If you can fix this I will give you 14 points. I hope it is enough. I just want this to work for school.

  • Java.lang.NoClassDefFoundError . Please help

    Hi everyone!
    I have this problem...i create a small java program, like "hello world". It is ok to compile and run it. The directory structure is as follows:
    /some/files/mypackage/myclass.java
    if i put in my source pacake mypackage/myclass, then i can compile the program, but when i try to run it i get this error:
    java.lang.NoClassDefFoundError
    Exception in thread "main" java.lang.NoClassDefFoundError: myclass (wrong name: mypackage/myclass)
    Thanks!!!

    You can always search the forum for answers - just put "wrong name" in the search box.
    In your case, you entered "java myclass" but the class that the jvm found was named mypackage/myclass. In other words, the myclass class is defined to be in the mypackage package so the fully qualified name of the class is mypackage/myclass (or mypackage.myclass). Your command needs to be "java mypackage/myclass" Most likely, you need to "cd /some/files/" before entering the command to run it.

  • Argh! "java.lang.NoClassDefFoundError"! help!

    I am a student and only just started programming in Java. When I installed the SDK on my home computer i discovered that everytime i try and run a program i have written, no matter how basic, i get a "java.lang.NoClassDefFoundError". I did a search on the forum and found lots of stuff about something called classpath, but i have no idea what it is or how to do it, despite the explanations ive read. If someone could please take me through it step by step id be VERY greatful.
    I'm running it on Windows XP home edition.
    Thanks alot
    Jon

    I tried the tutorial you showed me, thanks. However, it doesnt seem to have worked, when i did the "set CLASSTEST=" in the directory i was in then it worked, but only temporarily. But when I tried changing the Path variable in Environment Variables (Control Panel\System --> Advanced --> Environment Variables, it didnt seems to work. I added "C:\j2sdk1.4.2_02\bin" to both the user variables and system variables.
    Anyway, this is what I tried, from the beginning...
    I wrote the code in TextPad, the code is as follows -
    public class HelloWorld {
    public static void main( String[] args ) {
    System.out.println( "hello world" );
    (as i understand, it couldnt be any simpler!)
    I then compiled this in TextPad and got no errors.
    I then tried then run it, also through TextPad (Tools --> Run Java Application) and got this error (word for word) -
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
    Press any key to continue . . .
    I also tried running it from the command prompt and just got the same error, even when i switched to the right directory (C:\Documents and Settings\Jon\Desktop\Uni_stuff). The commands i entered were "java HelloWorld".
    If anyone can help me with this, id be greatful as its getting pretty urgent.
    Thanks
    Jon Britton

  • [Help]Migrating to OBIEE has java.Lang.NoCLassDefFoundError

    Hi,
    When I try to migrate report to obiee according to guide, there are classic error of java "java.Lang.NoCLassDefFoundError"
    My steps are:
    1) set classpath=C:\OracleBI\oc4j_bi\j2ee\home\applications\xmlpserver\xmlpserver\WEB-INF\lib
    (this is the path can find aolj.jar;xdoparser.jar;collections.jar;versioninfo.jar;xmlparserv2-904.jar)
    2) Download patch p5472959_11i_WINNT.zip from metlink and put j5472959_xdo.zip into above lib
    3) call from command line of windows XP:
    java -verbose -classpath oracle.apps.xdo.rdfparser.DataTemplateGenerator C:\biout\test.xml
    or
    java -verbose -classpath aolj.jar;xdoparser.jar;collections.jar;j5472959_xdo.zip;versioninfo.jar;xmlparserv2-904.jar oracle.apps.xdo.rdfparser.DataTemplateGenerator C:\biout\test.xml
    But... No matther how to change the classpath and java command, there always has error:
    Exception in thread main java.Lang.NoCLassDefFoundError C:\biout\test/xml
    (PS: is not error of Exception in thread main java.Lang.NoCLassDefFoundError oracle.apps.xdo.rdfparser.DataTemplateGenerator, so I think system can find oracle.apps.xdo.rdfparser.DataTemplateGenerator, but it doesn't recongize C:\biout\test.xml )
    Can any person help me? Thanks a lot.

    I wouldn't recommend setting the CLASSPATH variable... it's OK for now, but it'll become problematic in the long term... so IMHO you may as well form good habits upfront.
    To compile:
    C:\javacode>javac -d "." Example.java
    To execute:
    C:\javacode>java -classpath "." Example
    Or as of java 1.5 you can shorten that to:
    C:\javacode>java -cp "." Example
    java -version
    tells you which version of java you're running.
    Cheers, Keith.

  • HELP:: jsse1.0.3 problem with jdk1.3.1(java.lang.NoClassDefFoundError)

    Hi,
    I am now working with jsse1.0.3 and jdk1.3.1(I can not use the new jdk version, because the system I developed is based on jdk1.3.1). what makes me strange is that I can compile my program without problem, but when I run it, it always report error.
    my source code is :
    import java.security.*;
    import javax.net.ssl.*;
    System.out.println("Classpath ->"+System.getProperty("java.class.path"));
    SSLSocketFactory factory = (SSLSocketFactory)SSLSocketFactory.getDefault();
    SSLSocket SSLcontrol_connection = (SSLSocket)factory.createSocket(ftp_server, 990);
    SSLcontrol_connection.startHandshake();
    ..........the erroe message is:
    Classpath ->O:\hpovams_dev_sd40\sd\lib\JClark.zip;O:\hpovams_dev_sd40\sd\lib\jcert.jar;O:\hpovams_dev_sd40\sd\lib\jnet.jar;O:\hpovams_dev_sd40\sd\lib\jsse.jar;..........
    java.lang.NoClassDefFoundError
    at javax/net/ssl/SSLSocketFactory.a (DashoA12275)
    at javax/net/ssl/SSLSocketFactory.getDefault (DashoA12275)It is not a classpath problem as I have included the 3 jar files into classpath,.
    I also tried to add
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());before create SSLSocketFactory, then it report that
    java.lang.NoClassDefFoundError
         at com/sun/net/ssl/internal/ssl/Provider.<init> (DashoA12275)My developing GUI is eclipse 3.1, and the OS is winXP.
    Please give me some help, thank you very much.

    oh. I have found the problem. Acturally, the running enviroment is under microsoft j++, so it could only support jdk1.1, but jsse only support from jdk1.2, so that's the problem why it said that no class found.
    Now I only found that oracle has a solution for SSL which support
    jkd1.1(SUN's jsse package only support from jdk1.2). It described the
    method and sample code in Oracle Advanced Security Administrator's
    Guide Release 2 (9.2)
    (http://www.stanford.edu/dept/itss/docs/oracle/9i/network.920/a96573/a...)

  • Error: java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

    hi,
    I try a simple connect to a DB 9.2.0.1
    through JDBC
    $javac -d /home/oracle/jdbc Applet1.java
    OK
    but ...
    oracle@pluto:/home/oracle/jdbc$ appletviewer -J-Djava.security.policy=mypolic>
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    at mypackage.Applet1.connectToDB(Applet1.java:55)
    at mypackage.Applet1.access$000(Applet1.java:17)
    at mypackage.Applet1$1.actionPerformed(Applet1.java:41)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1
    64)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstr
    ctButton.java:1817)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonMode
    .java:419)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:25
    private void connectToDB(ActionEvent e) {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver())
    con = DriverManager.getConnection ("jdbc:oracle:thin:@pluto:1521:DB
    9IDEV","system","manger");
    empValues.setText("Connected to the Database. Fetching Values from
    TOTO Tables.\n");
    fetchValues();
    } catch (SQLException ex) {
    System.out.println("Connection Error = " + ex.toString());
    I tried with:
    CLASSPATH=/tools/oracle/9.2.0/jdbc/lib/classes12.jar
    and ( loaded from otn for JDK 1.4 and 9.2.0.1)
    CLASSPATH=/tools/oracle/9.2.0/jdbc/lib/ojdbc14.jar
    What I have to put in the CLASSPATH, please ???

    Please don't cross post.
    http://forum.java.sun.com/thread.jsp?thread=541572&forum=57&message=2625798
    http://forum.java.sun.com/thread.jsp?thread=541573&forum=48&message=2625800
    http://forum.java.sun.com/thread.jsp?thread=541574&forum=31&message=2625802

  • Java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver

    I am trying to connect from a servlet running in Tomcat on my desktop to an instance of Personal Oracle9i running on my desktop. I am gettiung NoClassDefFoundError. The code compiles.
    I know it is a path issue but I am at a loss to figure out where. Tomcat does not find the driver however it is in my machines path.
    Running following:
    j2sdk1.4.1_02
    Personal Oracle 9.2
    Tomcat 4.1.29
    Windows XP
    I have added the location of Classes12.zip to the class path: .;c:\Sun\AppServer\lib\j2ee.jar;c:\Sun\AppServer\lib\j2ee-svc.jar;d:\oracle\ora92\jdbc\lib\classes12.zip;
    The "root cause" of error is:
    java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
         at OOP.OracleConnectionDemo.doPost(OracleConnectionDemo.java:34)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    The code is as follows:
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jdbc.OracleDriver;
    //import oracle.jdbc.driver.*; //did not work either
    public class OracleConnectionDemo extends HttpServlet {
         public void doPost(HttpServletRequest req, HttpServletResponse resp)
              throws ServletException, IOException{
              Connection con = null;
              // Load the Oracle JDBC driver
              try{
                   //two versions did not work
                   //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver);
              DriverManager.registerDriver(new OracleDriver());
         con = DriverManager.getConnection
                   ("jdbc:oracle:thin:@micron.1521:MCAP","scott","scott");     
              catch (SQLException e){
              catch (Exception e){
              finally{
                   try{
                        if (con != null)
                   con.close();
              catch(SQLException ignored){
              }//finally
    }

    What you should be realizing is that Tomcat doesn't give a hoot about your system CLASSPATH. It totally ignores it. You really shouldn't even have one, because IDEs and app servers don't even take it into account. Get rid of it.
    You're making lots of mistakes here:
    (1) The Tomcat docs explicitly state that it won't look inside ZIP files. Change it to a JAR file.
    (2) You're using JDK 1.4.1 and classes12.zip? You realize, of course, that there's an ojdbc14.jar available for download from Oracle. Go get it.
    (3) Put the JDBC JAR in the WEB-INF/lib directory of your Web app. If you don't have one, you're not deploying your Web app properly.
    (4) You've got Java code with empty catch blocks? That's one of the most foolish things a person can do. If an exception's thrown you'll never know it. For goodness sake, at least print the stack trace.
    (5) Why do you have those Oracle imports? That ties your code to Oracle. The design of the java.sql package lets you use interfaces. Why don't you write JDBC the way it was meant to be written?
    (6) Why aren't you setting up a JNDI data source?
    %

  • Help with error  "main" java.lang.NoClassDefFoundError:

    I am pretty new to Java and I just install the JDK1.4.2 03
    I am getting an error when I run the class file TestChart.class with the
    java.exe:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    I have several class files in the directory d:\personal\java-ChartGen
    Chart.class
    ChartColourScheme.class
    ChartPanel.class
    ColorPanel.class
    TestChart.class
    TestIt.class
    All these files are for the program.
    Can some one help me why is this happening?? Is there something I can do
    that I am missing???
    I tried using the -CLASSPATH to direct it to the same directory but still
    with the same error.
    Please help me. Thank you

    I use the command line as follows:
    c:\j2sdk1.4.2_03\bin\java d:\personal\java-ChartGen\TestChart.class
    The full error message is as follows:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    d:\personal\java-ChartGen\TestChart/class
    I thought it may be the CLASSPATH, but all my class files are located in the
    same folder and I used the switch -classpath but the same error comes up.

  • Java.lang.NoClassDefFoundError: Simulation Help please!

    java.lang.NoClassDefFoundError: Simulation
         at SimulationController.setEnv(SimulationController.java)
         at EnvironmentController.setEnv(EnvironmentController.java)
         at EnvironmentController.openFile(EnvironmentController.java)
         at MBSGUIFrame$1.actionPerformed(MBSGUIFrame.java)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113)
         at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
         at java.awt.Component.processMouseEvent(Component.java:5100)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    Exit code: 0
    No Errors
    This occurs when I try to run a data file through a case study program that I need for my examinations. I'm using RealJ 3.51, with SDK 1.4.2_09 The case study launches fine, and when I open the .dat file, I can see the fish which should begin to move, but that is when I get that error.

    Trying to guess... Does that class have a package or something?

Maybe you are looking for

  • Jsp,bc4j,Data web Bean , error : NO ROWS AVAILABLE FOR EDITING

    HI I'm developping a jsp application based on Bc4j. when trying to insert a new row with missing fields which must be not null, in order to be able to edit the row and correct the non seized fields, I display the edit page and it works for several vi

  • PO-GR-IR Link

    Hi All, I have a requirement where in i have to develop a report, for which PO-GR-IR needs to be displayed. We get the hostory of PO from EKBE, and we get GR from MSEG and IR from RSEG. But the problem is if a PO has 4 GRs and 3 IRs then how to know

  • Scroll Bar on Window

    Hi. I have a form where the canvas/window is long. As such the Window has a scroll bar that the user can slide to move the canvas up and down within the window. Are there any programmatic controls for this? 1) After the user commits their changes I'd

  • Errors generating Java classes from XML schema

    I received the following errors when generating Java classes from the schema located at: http://imsproject.org/xsd/ims_qti_rootv1p1.xsd and http://imsproject.org/xsd/ims_xml.xsd XML Spy v4 claims that the schema is well-formed and valid. Could this b

  • My iPad 2 won't go into sleep mode or let me shut it off, any help?

    My iPad 2 won't go into sleep mode or let me shut it off, any help?