aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes dynamic class loading Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "dynamic class loading" Watch "dynamic class loading" New topic
Author

dynamic class loading

maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
i have war (in this JSP TagHandler class trying to look up EJB business method that is in ear deployed in node2 instance) deployed in jboss/node1 instance..

ear deployed in jboss/node2 instance..


in theWAR i have added only home and remote interfaces in WEB/classes at client side .(Do i need other custom classes which are using by EJB in WAR);

how do i enable dynamic class loading at client side;i am using jboss-4.0.2;if i enable dynamic class loading do i still need to drop home and remote interfaces and custom classes at client side.


in run.bat at client side.. what steps shouild i take to enable dynamic class loading to look up classses at server side.


set JBOSS_CLASSPATH=C:/jboss-4.0.2/client/jbossall-client.jar -Djava.security.manager=java.rmi.RMISecurityManager
-Djava.security.policy=c:/jboss-4.0.2/server/node1/conf/server.policy






Hashtable contextProperty = new java.util.Hashtable();
contextProperty.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
contextProperty.put(Context.PROVIDER_URL, "jnp://localhost:1099");




InitialContext context = new InitialContext(contextProperty);
DocumentSessionHome home = (DocumentSessionHome)context.lookup("DocumentSessionBean");
DocumentSession doc =(DocumentSession)home.create();
raghu kolipakula
Greenhorn

Joined: Apr 11, 2006
Posts: 7
Try jarring interface(home, remote) stubs(created after rmic) and put this jar file in your web apps lib folder.
It worked for me before.
maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
what are the stubs???
maha laxmi
Ranch Hand

Joined: Sep 23, 2005
Posts: 68
Originally posted by raghu kolipakula:
Try jarring interface(home, remote) stubs(created after rmic) and put this jar file in your web apps lib folder.
It worked for me before.


should i put custom classes also which is used by EJB as parameters in the web apps lib folder
raghu kolipakula
Greenhorn

Joined: Apr 11, 2006
Posts: 7
Yes you should.
Because you pass the same cusotm class objects when you invoke mehtods on remote object.Those classes should available to your client component(jsp/servlet in your case)
Andreas Schaefer
Ranch Hand

Joined: Feb 13, 2006
Posts: 63
Just a side note that JBoss does not have any stubs because it uses proxies and the stubs are included into the JBoss client JARs.

-Andy
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: dynamic class loading
 
Similar Threads
Reference to component or home interface in session facade? Which one is better?
Packaging and Class Loaders
long post IBM.158
dynamic class loading
How to get Remote and Home classes imports in Client Code