wei wu

Greenhorn
+ Follow
since Apr 27, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by wei wu

create ejb-jar and war is very easy, i just use jar -cvf command.
Of course, see <jsp:forward page="relative url"/>
19 years ago
JSP
1> put these classes in whichever ejb-jar file which uses these classes.
or you can
2> use Class-Path in ejb-jar's and war's manifest files. But i never succeeded.
jsp helper bean is a good design pattern. It makes your jsp focus on presentation while helper bean focus on some logic. It can minimize the amount of scriptlet in your jsp file.
19 years ago
JSP
Remove application.xml in META-INF and add a manifest.mf instead.
application.xml is only used to list all the modules in an enterprise application rather than web application.
Remove application.xml in META-INF and add a manifest.mf instead.
application.xml is only used to list all the modules in an enterprise application rather than web application.
First of all, you should know these terms,
1> home object-- an instance of home interface implementation class which is generated by container. Every EJB class has only one home object.
2> home stub -- since home object is remote object, it must have stub.
3> ejb object -- an instance of your remote interface implementation class which is generated by container also. ejb object is created by home object.
4> ejb object stub -- the stub of an ejb object.
The situation you concerned doesnot exist. First of all, you call create(...) method on home stub which returns an ejb object stub. The ejb object is associated with an session bean instance. Your method call on ejb object stub will be forwarded to ejb object and then forwarded to the associated session bean instance.
http://www-900.ibm.com/developerWorks/cn/java/j-ejb0924/index_eng.shtml
Other than that, I think there is only one home instance for each EJB class.Look at javax.ejb.EJBMetaData and you will know this. So, the home instance never times out.
When the stateful session bean times out, the container will swap it out to hard disk which is known as passivation. And the container will swap it into memory which is known as activation, when you later on invoke the ejb object which is associated with this session bean instance.
I hope this will make you clear
yes, i know this approach. but this solution is not a graceful one.
Suppose you have a large application which has lots of common utility classes. Are u going to put all these classes into ejb-jar? I think this will dirty ejb-jar.I prefer extracting these classes out from ejb-jars and put them into lib directory which is referenced by Class-Path entries in manifest files of ejb-jars.
I'm very grateful if someone can explain the correct manifest file format!
I wrote a simple enterprise application:
wwlhpApp.ear
|___StatefulAccountEJB.jar
|___webModule.war
|___lib
| |___util.jar
|___META-INF
|___application.xml
|___manifest.mf
and StatefulAccountEJB.jar depends on util.jar, so I add a Class-Path entry in its manifest.mf which is like this:
but when I deploy this app on weblogic6.1, it thrown exception:
java.io.IOException: invalid manifest format
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at java.util.jar.JarFile.getInputStream(Unknown Source)
at weblogic.utils.jars.VirtualJarFile.getInputStream(VirtualJarFile.java
:130)
at weblogic.ejb20.dd.xml.DDUtils.getEntry(DDUtils.java:395)
at weblogic.ejb20.dd.xml.DDUtils.getEjbJarXml(DDUtils.java:285)
at weblogic.ejb20.dd.xml.DDUtils.loadEJBJarDescriptorFromJarFile(DDUtils
.java:182)
at weblogic.ejb20.dd.xml.DDUtils.createDescriptorFromJarFile(DDUtils.jav
a:157)
at weblogic.ejb20.deployer.Deployer.createEJBDescriptor(Deployer.java:74
2)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:851)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:33)
at weblogic.j2ee.Application.deploy(Application.java:262)
at weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:191)
The exception complains the format of ejb's manifest file is not correct.
What is the problem?
I want to create a JNDI tree in the same JVM with remote object, and then I have two problem:
1> Should I bind remote object or its stub to the JNDI tree?
2> How to look up the JNDI tree to get the binded stub from the client side? (Suppose server ip is 192.168.99.42)
I hope a gentleman would give me a piece of code, so i would be much clearer. Thanks a lot!
20 years ago