• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

project classpaths

 
emm raha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
emm raha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic