• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to get the LOCAL interface of Session Bean form a application in the same JVM?

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a startup class in Weblogic Server, I want to get the LOCAL inteface of a Session Bean. I think they are in the same JVM...Maybe I can use the LOCAL EJB interface? If it is ok, something will be effective.
Anybody who could give me some advice or point out my fault?
Thank you very much!
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about simply testing whether you can use local interfaces? (I think you can but I'm not sure) Besides, if your startup class only executes once during startup, the performance overhead of a remote interface shouldn't be a problem either.
 
Jamy Wang
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My startup class is a server for client. So it's meanful for accessing LOCAL interface.
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by james wang:
I have a startup class in Weblogic Server, I want to get the LOCAL inteface of a Session Bean. I think they are in the same JVM...Maybe I can use the LOCAL EJB interface? If it is ok, something will be effective.
Anybody who could give me some advice or point out my fault?
Thank you very much!


From what I can tell of WebLogic, if the startup class is not in the same *JAR* as the EJB it's accessing, it cannot use a local interface. Note that local interfaces do not mean "local to this JVM" or even "local to this container" but rather "local to this JAR" (ClassLoader context?). This is related to the fact that a CMR between two entity beans can exist if and only if the two beans are packaged into the same JAR.
That being said, I haven't used WebLogic's T3StartupDef class because it runs for the container -- not each EJB application deployed in the container. Instead, I created a SLSB called "StartupSessionEJB" and gave it an initial pool size of 1 and max pool size of 1 and then didn't publish it in JNDI. It's ejbCreate() method gets called once and bingo I'm home free.
 
Jamy Wang
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


That being said, I haven't used WebLogic's T3StartupDef class because it runs for the container -- not each EJB application deployed in the container. Instead, I created a SLSB called "StartupSessionEJB" and gave it an initial pool size of 1 and max pool size of 1 and then didn't publish it in JNDI. It's ejbCreate() method gets called once and bingo I'm home free.


How to create a SLSB and give it an initial and max pool size?
How can I call ejbCreate() method when the Application Server start?
Thanks a lot!!
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by james wang:
How to create a SLSB and give it an initial and max pool size?
How can I call ejbCreate() method when the Application Server start?


Specifying the initial and maximum pool sizes is vendor-specific. I'm using XDoclet to generate our WebLogic deployment descriptors, but here's the resulting block from weblogic-ejb-jar.xml.

As for calling ejbCreate() on the bean, the container does this as part of filling the free pool with initial beans -- one in this case.
 
Jamy Wang
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, David Harkness. Thank you very much!!
I have just another question, how to describe the pool size in JBOSS?
Thank you again!
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by james wang:
Hi, David Harkness. Thank you very much!!
I have just another question, how to describe the pool size in JBOSS?
Thank you again!


I'm always glad to help. Unfortunately I have never used JBoss before. You might try a JBoss-specific forum or mailing list.
Good luck!
 
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic