Project References

Hi,

I need an urgent solution for the below query.

i have two portlet application projects ,

One project is referring some utility classes from another project

what I did is ,i just refer that utility project in “java Build Path” this is not working, Even i tried to refer it from "projectReferences "

but at runtime it showing "ClassNotFoundException "

Note: i don’t want export the utility project as JAR file and deploy it on server/lib folder.

regards,
Suman

Hi
if I understood correctly, you are trying to use some classes from your portlet project A in your portlet project B. If this is right, I don’t think that will work.
I would create a Java EE Utility Project (you’ll need to activate this feature in Designer) containing those classes and refer to that project from your portlet projects.

regards
Javier

Javier,

As i posted above the two are portlet application projects not the Utility Project

regards
Suman

Hi
that will not work, since, as you probably know…

  • at runtime the project cannot access other project’s jar files
  • Designer does not produce a jar file to be packed in the war file

You will need to add a “Builder” (probably ant-based) to your “utility” project which produces this jar file. You can then add this jar file to the project “Java EE Module Dependencies”.

Hope this helps,
Javier