Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

app modules

 
Tmmet Johnson
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the below questions.

1. In my application ear, I have a ejb module (project) and web module(project).
Which module's (ejb / web) will be loaded first by the class loader?
Is it web, since, web classes call the ejbs?.

2. I have a jar file with utility .class files.I have included this jar in the web project's lib folder.But,at runtime,I get "NoClassDefFoundError" when the classes of utility jar is called.
Do I miss any setting?If so, please let me know.
Also, when I include the same utiltiy jar in ear and refer it in web module(Java Jar Dependencies), everything works fine.

Thanks in advance,
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tmmet Johnson:
Hi,
I have the below questions.

1. In my application ear, I have a ejb module (project) and web module(project).
Which module's (ejb / web) will be loaded first by the class loader?
Is it web, since, web classes call the ejbs?.

2. I have a jar file with utility .class files.I have included this jar in the web project's lib folder.But,at runtime,I get "NoClassDefFoundError" when the classes of utility jar is called.
Do I miss any setting?If so, please let me know.
Also, when I include the same utiltiy jar in ear and refer it in web module(Java Jar Dependencies), everything works fine.

Thanks in advance,


The order of classloading depends on the application server and also on classloader setting which you might have defined. Since you not facing any problem when putting the utility jar in the ejb jar , the ejb jar is getting loaded first. Are you using weblogic server ?
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This varies with the particular server and
different versions of each server, but
sometimes it helps to provide a
classpath in the manifest in order to
find libraries that are outside the
component war or ejb-jar, but are
in the ear.
 
Tmmet Johnson
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the answers.I am using websphere.
Can anyone answer my question no - 2?

Thanks,
 
I found a beautiful pie. And a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!