This is my folder structure..then i created war and jar files in the respective folders. Then i created another folder called myapplication. The folder structure is like this.
Compilation of 'C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java' failed: C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:145: cannot resolve symbol
probably occurred due to an error in /index.jsp line 17:
StatefulSessionHome home = (StatefulSessionHome)ctx.lookup("ejbjsp");
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:145: cannot resolve symbol
probably occurred due to an error in /index.jsp line 17:
StatefulSessionHome home = (StatefulSessionHome)ctx.lookup("ejbjsp");
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:147: cannot resolve symbol
probably occurred due to an error in /index.jsp line 19:
StatefulSession rem = home.create();
Full compiler error(s):
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:145: cannot resolve symbol
symbol : class StatefulSessionHome
location: class jsp_servlet.__index
StatefulSessionHome home = (StatefulSessionHome)ctx.lookup("ejbjsp"); //[ /index.jsp; Line: 17]
^
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:145: cannot resolve symbol
symbol : class StatefulSessionHome
location: class jsp_servlet.__index
StatefulSessionHome home = (StatefulSessionHome)ctx.lookup("ejbjsp"); //[ /index.jsp; Line: 17]
^
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:147: cannot resolve symbol
symbol : class StatefulSession
location: class jsp_servlet.__index
StatefulSession rem = home.create(); //[ /index.jsp; Line: 19]
^
3 errors
Abubacker Siddik wrote:Full compiler error(s):
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:145: cannot resolve symbol
symbol : class StatefulSessionHome
location: class jsp_servlet.__index
StatefulSessionHome home = (StatefulSessionHome)ctx.lookup("ejbjsp"); //[ /index.jsp; Line: 17]
^
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:145: cannot resolve symbol
symbol : class StatefulSessionHome
location: class jsp_servlet.__index
StatefulSessionHome home = (StatefulSessionHome)ctx.lookup("ejbjsp"); //[ /index.jsp; Line: 17]
^
C:\DOCUME~1\Admin\LOCALS~1\Temp\jsp_servlet\__index.java:147: cannot resolve symbol
symbol : class StatefulSession
location: class jsp_servlet.__index
StatefulSession rem = home.create(); //[ /index.jsp; Line: 19]
^
3 errors
Container is unable to find the class files required, so it may be due to classes are not properly packaged ? What are the EAR contents (structure) ?
Abubacker,
myejb.jar -this is an EJB jar? What does it contain? Is it in the manifest of the war file? There's a file in the war's manifest.mf telling it where to look for things.
Also, you might try looking at the startup logs to see if the ejb has started. This will narrow down whether the problem is on the ejb or jsp side.
I hope this is just a toy project. Having Java code (especially EJBs) in a JSP is bad practice.
I am using weblogic8.1 server. i dont have manifest.mf files there. Only ejb-jar.xml and weblogic-ejb-jar.xml. And ya i know this is naive approach to build applications writing ejb code in jsp file. My problem is that i want to deploy an EAR file which successfully runs.
Another doubt persists in my mind is...
EJB gives service components residing on the server side. So once *.jar files are deployed and your service components will reside in server. Any client can go and look for the service component using JNDI Look up name of the component. If this is the case, i write stateless session bean which gives the name of the server if client looked up.. Ok. Now my client writes the lookup code in jsp file (Let it be.. the client is naive).
If my understanding is correct, I should not get the errors mentioned in my earlier replies. Because the errors pose as it depends on the class files that the server runs. Thats puzzling.. Please correct me and give any other way of writing EAR application..
Thanks in advance.
Jeanne Boyarsky
,
author & internet detective
staff
To your questions, Jeane,
1) myejb.jar -this is an EJB jar. K
2) yes weblogic supports manifest file. I think its ejb-jar.xml and weblogic-ejb-jar.xml.
I will give more information now so that you can help me out.
I wrote stateless session bean which just sets and gets name if you pass a string. Then i created jar file. Thats myejb.jar.
myejb.jar contains META-INF\ ejb-jar.xml and weblogic-ejb-jar.xml.
*.class
I have one jsp file. which has JNDI lookup code. This is a naive approach for EAR. (Let it be)
Then i created WEB-INF folder and classes folder in it.
Now the important point is, I placed the class files EJBHome, EJBObject, and Session Bean of myejb.jar in the WEB-INF\Classes folder.. (I thought this would solve my problem).
Now i created myjsp.war file which contains WEB-INF\Classes\*.class(myejb.jar)
WEB-INF\web.xml and weblogic.xml
index.jsp(JNDI look up)
Now coming to EAR file, I created another folder called abu. K
abu folder contains myejb.jar, myjsp.war and META-INF\application.xml and weblogic-application.xml
now i created myapplication.ear file and deployed it. The problem is that index.jsp is throwing compile time error which you can see in the my post reply above.
Jeanne Boyarsky
,
author & internet detective
staff
Abubacker Siddik wrote:I have one jsp file. which has JNDI lookup code. This is a naive approach for EAR. (Let it be)
Ok. Noting that you may encounter problems that are hard to get help with because people don't have experience doing that.
Abubacker Siddik wrote:Now the important point is, I placed the class files EJBHome, EJBObject, and Session Bean of myejb.jar in the WEB-INF\Classes folder.. (I thought this would solve my problem).
That would "solve" a compiler error but introduce a new error - not being able to call the EJB because it is just Java code. It does hint at the problem though. My guess is the JSP imports are incorrect. Can you show what imports you have in the JSP along with the package name of the EJB?
Thanks Jeane, I found the error i did and solved the problem. My EAR is running now. I didnt import package where my *.class files are.. Now i imported the package in the jsp file. Now it runs.. Thanks a lot.
Post by:autobot
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
a bit of art, as a gift, the permaculture playing cards