Skip to main content

Exception in thread "main" java.lang.NoClassDefFoundError: org/jvnet/fastin

1 reply [Last post]
bonboy
Offline
Joined: 2005-07-08
Points: 0

I found some technical problems in the J2EE(TM) 1.4 Tutorial Netbeans.
I use the NetBeans 5.0 IDE to run the JAX-RPC topic.

In the sub topic of JAX-RPC : IDE-Generated Static Stub Client

To build, package, and run the client, follow these steps:

1. Choose FileRight ArrowOpen Project (Ctrl-Shift-O). In the file chooser, go to /j2eetutorial14/examples/jaxrpc/staticstub/, select the project, and choose Open Project.
2. The project prompts you to set up a library named "jax-rpc". The library should contain JAR files that are needed by the project. Right-click the project and choose Resolve Reference Problems. Click Resolve. Click New Library and name the library jax-rpc. Click Add JAR/Folder and navigate to the lib directory in your application server installation. Select activation.jar, dom.jar, j2ee.jar, jaxrpc-api.jar, jaxrpc-impl.jar, jhall.jar, mail.jar, saaj-impl.jar, xercesImpl.jar and click OK.
3. In the Projects window, right-click the project and choose Run Project. The IDE builds, packages, and runs the project.
4. In the Output window, the client displays the following output:

Hello Duke!

When I run the project, this messages appear :

init:
deps-jar:
warning: Processing WS-I non conforming operation "sayHello" with RPC-Style and SOAP-encoded

compile:
run:
Endpoint address = http://localhost:8080/helloservice/Hello
Exception in thread "main" java.lang.NoClassDefFoundError: org/jvnet/fastinfoset/FastInfosetSource
at staticstub.Hello_Impl.getHelloSEIPort(Hello_Impl.java:59)
at staticstub.HelloStaticClient.createProxy(Unknown Source)
at staticstub.HelloStaticClient.main(Unknown Source)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

What should I do ?
Because the tutorial says :
(Stub)(new Hello_Impl().getHelloSEIport())
The code in this method is implementation-specific because it relies on a Hello_Impl object, which is not defined in the specifications. The Hello_Impl class will be generated by wscompile in the following section.

This is the where line 59 occurs (Hello_Impl.java:59):

public staticstub.HelloSEI getHelloSEIPort() {
java.lang.String[] roles = new java.lang.String[] {};
//This is a line 59
HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().getHandlerChain(ns1_HelloSEIPort_QNAME));
handlerChain.setRoles(roles);
staticstub.HelloSEI_Stub stub = new staticstub.HelloSEI_Stub(handlerChain);
try {
stub._initialize(super.internalTypeRegistry);
} catch (JAXRPCException e) {
throw e;
} catch (Exception e) {
throw new JAXRPCException(e.getMessage(), e);
}
return stub;
}

Sincerely,
Chart K.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
discussjava_com
Offline
Joined: 2006-08-28
Points: 0

Exception in thread "main" java.lang.NoClassDefFound
The reason people get this is because an error has happened at the time you run the program.

there is only one reason why you get this the class you are trying to get to is not in the classpath.

reasons why:
1- misspeled command when executing the command to run
(command doesn't match the .class filename)
2- classpath doesn't include your class location, jar locations or any other place the code might be in

here is a link on how to set the classpath when running the command
to run your class
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html

by discussjava.com