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
Similar Messages
-
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. -
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 PMbut 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. -
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
JonI 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 -
Stuck for 2 days: Exception in thread "main" java.lang.NoClassDefFoundError
I wrote the code in netbeans 5.5 under windows XP and compiled perfectly. I tried to run the generated Jar file code in the command prompt and it did work perfectly.
C:\Datahub\dist> java -jar Datahub.jar
BUT when I took the jar file and tried to run it under linux here is what I got:
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: main.hw
at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.6.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:Datahub.jar,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
...4 more
The project i am working on is funded by IBM and they will be really mad if it didn't work :(
Please help.It is not clear what You want to run under Linux. Jar under JVM or native code? If You are going to use JVM make it clear for Yourself which one You are going to use and then make sure it is installed properly.
-
[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. -
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...) -
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,
JimI 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. -
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 youI 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. -
Help me. - java.lang.NoClassDefFoundError
Hello.
Sombody help me.
My TesterBean call to TraderBean.
But TesterBean not found traderClient.jar.
The traderClient.jar include TraderHome and Trader class.
Is traderClient.jar set to classpath of WLS6.1?
For example, Writing in a startSever.cmd file?
startSever.cmd ----------------------------
set CLASSPATH=.;.\lib\weblogic_sp.jar;. . . ;traderClient.jar
Does traderClient.jar must setted at startServer.cmd?
But I don't want to this setting.
Thanks.
Min
My Program source.
My TesterBean's ejb_MANIFEST.MF content is ............
Manifest-Version: 1.0
Class-Path: traderClient.jar
public class TesterBean implements SessionBean {
public void test() throws NamingException, Exception
try {
TraderHome home = (TraderHome)ctx.lookup("ejb20-statelessSession-TraderHome");
Exception ..............
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: examples/ejb20/basic/statelessSession/TraderHome
TesterBean's Build.xml contents..
<target name="jar_ejb" depends="compile_ejb">
<jar jarfile="${dist}/std_ejb20_basic_tester.jar" basedir="${build}" manifest="ejb_MANIFEST.MF">
TraderBean's ejb-jar.xml contents ....
<ejb-client-jar>traderClient.jar</ejb-client-jar>
[att1.html]im having similar problems. i suspect it has something to do with the classpath...but as of yet im still stuck. i get this error when i attempt to start the tomcat that coems with jwsdp1.1
-
Java.lang.NoClassDefFoundError: Weblogic looks for wrong drivers
Hi all,
I have a strange problem with weblogic. I use weblogic7.0 with MS SQLServer database.
All my jdbc related code from anywhere within my web application works without
a problem.
But when I try to access the database as a client using weblogic's datasource(obtained
by JNDI lookup), I get the NoClassDefFoundError. Weblogic seems to be looking
for some Oracle drivers strangely, where as I don't have any thing related to
Oracle at all. It breaks on getConnection() call on data source. My connection
pool and data source are defined properly and I have the JDBC drivers for SQLServer
in weblogic's classpath and also in client's classpath(although not required).
Again, all the database access code within my session beans using the same datasource
works fine. Weblogic server and the client application are running on the same(local)
machine.
Any help would be appreciated.
Thanks in advance.
Vas
Here's the stack trace.
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleStatement
at java.lang.Class.getMethods0(Native Method)
at java.lang.Class.getMethods(Class.java:737)
at weblogic.rmi.utils.Utilities.getRemoteMethods(Utilities.java:382)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:79)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:60)
at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:637)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:656)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:651)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:59)
at weblogic.common.internal.RemoteObjectReplacer.resolveObject(RemoteObjectReplacer.java:249)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:134)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectStreamClass.invokeMethod(ObjectStreamClass.java:1610)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:388)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:140)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:91)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:161)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:128)
at weblogic.jdbc.common.internal.RmiDataSource_WLStub.getConnection(Unknown Source)
at com.actiontech.jmetro.server.core.DBSession.executeQuery(DBSession.java:109)
at com.actiontech.jmetro.server.query.NamespaceMappings.loadMappings(NamespaceMappings.java:76)
at com.actiontech.jmetro.server.query.NamespaceMappings.<init>(NamespaceMappings.java:56)
at com.actiontech.jmetro.server.query.NamespaceMappings.getInstance(NamespaceMappings.java:50)
at com.actiontech.jmetro.server.query.NamespaceMappingsTest.testSave(NamespaceMappingsTest.java:21)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:360)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:246)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:146)Hi all,
I have a strange problem with weblogic. I use weblogic7.0 with MS SQLServer database.
All my jdbc related code from anywhere within my web application works without
a problem.
But when I try to access the database as a client using weblogic's datasource(obtained
by JNDI lookup), I get the NoClassDefFoundError. Weblogic seems to be looking
for some Oracle drivers strangely, where as I don't have any thing related to
Oracle at all. It breaks on getConnection() call on data source. My connection
pool and data source are defined properly and I have the JDBC drivers for SQLServer
in weblogic's classpath and also in client's classpath(although not required).
Again, all the database access code within my session beans using the same datasource
works fine. Weblogic server and the client application are running on the same(local)
machine.
Any help would be appreciated.
Thanks in advance.
Vas
Here's the stack trace.
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleStatement
at java.lang.Class.getMethods0(Native Method)
at java.lang.Class.getMethods(Class.java:737)
at weblogic.rmi.utils.Utilities.getRemoteMethods(Utilities.java:382)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:79)
at weblogic.rmi.internal.StubGenerator.<init>(StubGenerator.java:60)
at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:637)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:656)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:651)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:59)
at weblogic.common.internal.RemoteObjectReplacer.resolveObject(RemoteObjectReplacer.java:249)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:134)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectStreamClass.invokeMethod(ObjectStreamClass.java:1610)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:388)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:140)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:91)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:161)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:128)
at weblogic.jdbc.common.internal.RmiDataSource_WLStub.getConnection(Unknown Source)
at com.actiontech.jmetro.server.core.DBSession.executeQuery(DBSession.java:109)
at com.actiontech.jmetro.server.query.NamespaceMappings.loadMappings(NamespaceMappings.java:76)
at com.actiontech.jmetro.server.query.NamespaceMappings.<init>(NamespaceMappings.java:56)
at com.actiontech.jmetro.server.query.NamespaceMappings.getInstance(NamespaceMappings.java:50)
at com.actiontech.jmetro.server.query.NamespaceMappingsTest.testSave(NamespaceMappingsTest.java:21)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:360)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:246)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:146) -
Hi,
system i am using for Oracle SOA is :
Windows 64 Bit
i5 Processor
6 GB RAM
29 GB on C Drive is already free after installation of all SOA related products.
I have installed wlserver_10.3 for SOA 11g Development purpose and followed exact installation sequence and procedure as mention in oracle documentation
i created domain also and every thing look correct but after installation procedure there are "Additional actions required just after every thing installed" :
setting memory limit
starting weblogic server (Admin Server)
starting weblogic managed server
and so on
now Problem is when i execute C:\Oracle\Middleware\user_projects\domains\soa_div_domain\bin startWebLogic.cmd
as mention in oracle documentation i am getting following error message : (i have only included last error lines instead of complete console log)
oConsole= -Dweblogic.ext.dirs=C:\Oracle\MIDDLE~1\patch_wls1036\profiles\default\
sysext_manifest_classpath;C:\Oracle\MIDDLE~1\patch_oepe180\profiles\default\syse
xt_manifest_classpath;C:\Oracle\MIDDLE~1\patch_ocp371\profiles\default\sysext_ma
nifest_classpath;C:\Oracle\MIDDLE~1\patch_adfr1111\profiles\default\sysext_manif
est_classpath weblogic.Server
Listening for transport dt_socket at address: 8453
Exception in thread "main" java.lang.NoClassDefFoundError: vXmx512m
Caused by: java.lang.ClassNotFoundException: vXmx512m
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: ++Xmx512m. Program will exit.
Now to resolve this what i already tried are :
I change JAVA_HOME and PATH to jdk6 which came with web logic installer
Location is at :
JAVA_HOME : C:\Oracle\Middleware\jdk160_29
PATH : C:\Oracle\Middleware\jdk160_29\bin
The above dose not include any space between path
I ran the startWebLogic.cmd and got same error
After that I also added
CLASSPATH : C:\Oracle\Middleware\jdk160_29\lib\tool.jar;C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar;C:\Oracle\Middleware\jdk160_29\bin
WL_HOME: C:\Oracle\Middleware\wlserver_10.3
I ran the startWebLogic.cmd and got same error
I also used earlier path which I used with eclipse when I was working on other java development.
JAVA_HOME : C:\Program Files\Java\jdk1.7.0_21
PATH : C:\Program Files\Java\jdk1.7.0_21\bin
I ran the startWebLogic.cmd and got same error
Then I also gave PATH: C:\Oracle\Middleware\wlserver_10.3\server\lib (including the existing one using ; )
I ran the startWebLogic.cmd and got same error
Now may be there is a file called setSOADomainEnv.cmd in
< C:\Oracle\Middleware\user_projects\domains\soa_div_domain\bin\ setSOADomainEnv.cmd>
That include some values for memory set :
set JAVA_OPTIONS=%JAVA_OPTIONS%
set DEFAULT_MEM_ARGS=-Xms512m –Xmx512m
set PORT_MEM_ARGS=-Xms512m –Xmx768m
if "%JAVA_VENDOR%" == "Oracle" goto OracleJVM
set DEFAULT_MEM_ARGS=%DEFAULT_MEM_ARGS% -XX:PermSize=128m -XX:MaxPermSize=768m
set PORT_MEM_ARGS=%PORT_MEM_ARGS% -XX:PermSize=256m -XX:MaxPermSize=768m
now as I change the red highlighted value to 512 value because I have less memory resource and I checked in installation documentation to change the above red highlighted value to 512 original is 1024 which is too high and it was crating problem and showing memory space problem so I change it to 512 and now I am not getting that memory space problem error but may be the above error is related with change value in setSOADomainEnv.cmd file or not
Following are my domain, weblogic and soa home directory path and all these path are exactly what it suppose to be according to Oracle Installation Documentation:
WebLogic :
C:\Oracle\Middleware\wlserver_10.3
C:\Oracle\Middleware\coherence_3.7
C:\Oracle\Middleware\oepe_11.1.1.8.0
SOA Oracle Home Directory :
C:\Oracle\Middleware\Oracle_SOA1
OSB Home Location :
C:\Oracle\Middleware\Oracle_OSB1
Domain name : soa_div_domain
Domain Location : C:\Oracle\Middleware\user_projects\domains
Application Location : C:\Oracle\Middleware\user_projects\applications
Domain Location: C:\Oracle\Middleware\user_projects\domains\soa_div_domain
form here i am trying to start weblogic : C:\Oracle\Middleware\user_projects\domains\soa_div_domain\bin\startWebLogic.cmd
Please tell me any body want more details.
Thanks.I think you are missing a character '-'
USER_MEM_ARGS="Xms512m -Xmx512m -XX:MaxPermSize=128m"Add this character like follows
"-Xms512m -Xmx512m -XX:MaxPermSize=128m" -
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. -
ERROR: java/lang/NoClassDefFoundError. HELP!!!
Hi all, can any one tell me what's wrong with my program that runs fine in JavaONEStudio5, but i find following error message when i run it in WTK21:
Project "readWriteRights" loaded
Project settings saved
Building "readWriteRights"
Build complete
Running with storage root DefaultColorPhone
Uncaught exception java/lang/NoClassDefFoundError: ReadWriteRights.
Here is my simple program:
* readWriteRights.java
* A simple application program to read a text file
* and store it's content into a Record Store.
* the data is read from the Record Store for verification
* Created on 2004/4/8 2:29am
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.io.*;
import javax.microedition.rms.*;
import java.io.*;
public class readWriteRights extends MIDlet {
public readWriteRights() { } // constructor
public void startApp() throws MIDletStateChangeException {
String fileName = "origin.drm";
String field[] = new String [] {"","","","","","","",""}; // Total 8 constraints in the file
int i = 0;
// retrieve the contents of a resource file
System.out.println("Retrieving the resource file - readme.txt");
System.out.println("--------------------------------------------");
InputStream is = this.getClass().getResourceAsStream(fileName);
try {
if ( is != null ) {
int ch = is.read();
while ( ch != -1) {
// print out the contents of the readme file
System.out.print((char) ch);
// temp = (temp-10)*2; // decoding
if (ch == 10) { i++; } //skip it if the character is \n
else
field[i] += (char)ch;
if(i >= field.length)
{ ch = -1;}
else{ ch = is.read();}
is.close();
} catch (IOException e) {
System.out.println(e);
// Write to a record store
String rs_Name = "db1";
RecordStore rs = null;
try {
if ( exist(rs_Name) == true) {
RecordStore.deleteRecordStore(rs_Name);
} // check and delete existing Record Store
rs = RecordStore.openRecordStore(rs_Name,true);
System.out.println("Record Store "+rs_Name+" is opened.");
catch(Exception e){
System.out.println("Error: "+e.getMessage());
finally{
//* write records
for (int j = 0; j < field.length; j++)
byte[] rec = field[j].getBytes();
//close the record store
try {
rs.addRecord(rec,0,rec.length);
System.out.println((j+1) +" record is added to db1");
System.out.println("Record: "+field[j]);
catch (Exception e){System.out.println("Error: "+e.getMessage());}
System.out.println("Write reord completed.");
//* read records
try {
int len =50;
byte[] recData = new byte[len];
System.out.println("The data read from Record Store.");
for (int k=1; k <= rs.getNumRecords(); k++)
len = rs.getRecord(k, recData, 0);
System.out.println("Record #"+k+": "+new String(recData, 0, len));
System.out.println("---------------------------------------------------");
catch (Exception e){System.out.println("Error2: "+e.getMessage()); }
// * close record Store
try {
rs.closeRecordStore();
System.out.println("record store db1 is closed");
catch (Exception e){System.out.println("Error: "+e.getMessage());}
destroyApp(true);
notifyDestroyed();
* The method to check if the Record Store existed or not
public boolean exist(String recordStoreName) {
boolean existF=true;
RecordStore rs=null;
if(recordStoreName.length()>32) return false;
try {
rs=RecordStore.openRecordStore(recordStoreName,false);
catch(RecordStoreNotFoundException e) {existF=false;}
catch(Exception e){}
finally{
try{
rs.closeRecordStore();
}catch(Exception e){}
return existF;
} // end of check Record Store existance method
* Pause the MIDlet
public void pauseApp() { }
* Called by the framework before the application is unloaded
public void destroyApp(boolean unconditional) { }
}I doubt that the error is caused by " java.io.* " which is not included in MIDP so that my program cannot run in WTK21.. is that true?
if yes, what can I do with it because I have to run it in WTK21 for demonstration. thx!!!!! -
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
-
How do I get a button to show in a list only when a survey is filled?
I am using cf9 with mySQl 5+. I have two tables: Signups - where people signup to take a course. Course_eval – once the course is completed, the student fills in the course evaluation I use an inner join on userID in both tables. I have a page, show
-
Need to change the status of IDOC of type 'INFREC' to 51 failed
Hi SapAll. here i have got a situation where iam running a sap standard program 'RBDSEINF' tcode'me18' by filling in parameters "Info record,Merchanise category as INFREC and while running it is doing some validations using the Function module 'MA
-
Problems configuring router after hard reset
I'll start with my 'vitals' --- * WRK54G Wireless Router * Cable internet * Desktop computer is wired to the router * Roku media player - wireless connection (will play my mp3s off of the computer or listen to internet radio stations) * Tivo wireless
-
I have download Oracle 9iAS but I cannot unzip the file. The WinZips error message is "Cannot open file: it does not appear to be a valid archive. If you downloaded this file, try to download it again". This happen to all the files that I donwload ab
-
Green webcam light on all the time
When I boot up my Macbook the green light by the webcam comes on and stays on. When I start up ichat or photobooth nothing comes on the screen. Is my laptop defective?