File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes project classpaths Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "project classpaths" Watch "project classpaths" New topic
Author

project classpaths

emm raha
Ranch Hand

Joined: Mar 18, 2003
Posts: 57
I have 2 web projects in WSAD 5.1. I would like to use one within the other. I have tried adding the dependency by selecting the necessary web project under 'Java Build Path' and 'Project References' in the Properties of the other web project, however I keep getting:

java.lang.NoClassDefFoundError

Both the projects are in the same EAR. I can successfully create this dependency on a web project from a java project.

Am really exasperated, and help would be appreciated!
[ December 29, 2004: Message edited by: emm raha ]
emm raha
Ranch Hand

Joined: Mar 18, 2003
Posts: 57
Anyone?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30908
    
158

Emm,
You have to give people more than two hours to answer

The build path is a compile time path. You need to set the "java jar dependencies" on the web project. This is a runtime path. You can get to it by right clicking the project -> properties -> java jar dependencies. Then just select the other web project.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
emm raha
Ranch Hand

Joined: Mar 18, 2003
Posts: 57
Still no headway here. I have 2 Dynamic Web Projects
(1) webRedirect and
(2) webUsedByOthers.

I would like to use the classes in webUsedByOthers (a utility project) from webRedirect (or any other web project). They both belong to the same EAR file. (Jeanne - In WSAD 5.1 I am unable to select anything when in Properties --> Java JAR Dependencies.)

- I have selected webUsedByOthers in Properties --> Project References and Properties --> Java Build Path
-- no luck (class not found)

- I then included <base>\webUsedByOthers\WebContent\WEB-INF\classes to my WSAD/WTE server instance's Environment --> Class Path
-- luck!

- I'm now trying to deploy to WAS 5.0 and don't see Class Path settings in the admin console
-- I've tried to use the Environment --> Shared Libraries
--- no luck (class not found)

Any ideas?
[ January 03, 2005: Message edited by: emm raha ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30908
    
158

Emm,
Strange. Usually when you can't select Java Jar dependencies it is because the project is not part of the EAR. That doesn't seem to be the case here.

It makes sense that adding the build directory to the server's classpath rather than the project classpath would work. It's overkill, but it would work.

Take a look at this

article for the different types of classpaths on the server.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: project classpaths