• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

StackOverflowError looking up stateless EJB3

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm testing with EJB3 on JBoss 4.0.4GA. My application uses a JSF front end tied to an EJB3 backend using both stateless and entity beans. When I perform the lookup of the stateless beans from the faces managed bean I get a StackOverflowError. Using a simple EJB client application seems to work fine, so the problem appears to be with the lookup (and debugging statements in the code seem to reinforce this). This is the line that errors:



This is what appears to be the important part of the exception:



This may be related to the problem too - I'm deploying the EJBs in a jar separately from the web war. I tried using an ear but then it couldn't find jstl so the web app wouldn't load. I suppose if anybody knows the answer to that problem it'd be helpful too as doing this as an ear is probably the right way to go.

Thanks for any help you can provide and if there's more information that I can post that would be helpful please let me know.

Thanks again,
Mike
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know what exactly might be causing the problem but try one or more of the following:
1. Make sure you are mapping ejb/CalculatorBean with the correct JNDI name with which you are deploying the ejb
2. If you are invoking your ejb as a remote client, you may have to set prvider_url and initial_context_factory etc. in the InitialContext
3. Add ejb reference in the war's web.xml file

As far as using ear file is concerned, where do you jstl and related jar files? As long as you put them in WEB-INF/lib directory, you should be okay.
 
Mike Litherland
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using NetBeans (5.5 beta) to package my code. It looks like it puts the library jar files (like the jstl.jar and jsf-impl.jar) in the root of the archive. I tried moving them to WEB-INF/lib without luck. I guess the daily builds of NB 5.5 do things a bit differently so I'm trying to download it now to see how it does it. (It can also use the JBoss supplied MyFaces instead of its own Faces RI, which will eliminate at least that problem.)

At the moment I'm much confused over how this packaging is supposed to be and nothing I do seems to allow these packages to be picked up. Is it documented anywhere?

Thanks,
Mike
 
Chintan Rajyaguru
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jars directly under ear are treated as utility jars and must be included in your MANIFEST.MF file. For example, if you have framework.jar, which is used by both ejb and war files, you might want to put it directly under war and include it in MANIFEST.MF (under META-INF directory) in this format
Class-Path: log4j.jar framework.jar foo/bar/util.jar

Here are some links for j2ee packaging and deployment:
http://www.theserverside.com/articles/content/J2EE-Deployment/chap24.pdf
http://java.sun.com/j2ee/j2ee-1_4-fr-spec.pdf (look at chapter 8)

Remember, the first link uses j2ee 1.3 and the second link uses j2ee 1.4 but the information should still apply to your problem.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I notice that you did not write more, did you sovle your problem? I asking because i have the same error, if you solved, can tell me how?

m.a.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic