cancel
Showing results for 
Search instead for 
Did you mean: 

proper call to ejb from jsp - error package not found

Former Member
0 Kudos

I am getting a package not found error from my trc log when I try calling a ejb from my jsp:

com.sap.engine.services.servlets_jsp.client.RequestInfoServer#fsd/oms#com.sap.engine.services.servlets_jsp.client.RequestInfoServer#Guest#2####6788c200ddb011dbca30000cf15747a0#SAPEngine_Application_Thread[impl:3]_6##0#0#Error##Plain###Processing HTTP request to servlet [jsp] finished with error. The error is: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error while executing the compilation process: [C:/usr/sap/FLA/JC00/j2ee/cluster/server0/apps/fsd/oms/servlet_jsp/LocalDevelopmentwebfsd/work/jsp_testmap1175143564124.java:41: package fsd.oms.appsrv does not exist

fsd.oms.appsrv.mappingservices maprequest = null;

^

I am calling the bean in the jsp as follows:

<jsp:useBean id="mappingServicesLocal" scope="page" class="fsd.oms.appsrv.mappingservices" />

<jsp:getProperty name="MapRequest" property="GET_COMPRESSION" />

I have a DC ear project LocalDevelopmentomsfsd

I have a DC ejb project LocalDevelopmentomsejbmodule

I have a DC web project called LocalDevelopmentomswebfsd

The ear project has project references that reference the ejb and web projects

and the application.xml has a module with:

<ejb>fsdomsejbmodule.jar</ejb>

and a module with

<web>

<web-uri>fsd~omsweb.war</web-uri>

<context-root>/LocalDevelopmentwebfsd</context-root>

</web>

The ejb project has this folder structure included:

ejbModule/fsd/oms/appsrv/mappingservices/MappingServicesBean.java (local and localhome also)

The ejb-jar.xml contains all of the <enterprise-beans> information

The web project has this in the web.xml

<ejb-local-ref>

<ejb-ref-name>ejb/mappingServicesBean</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<local-home>

fsd.oms.appsrv.mappingservices.mappingServicesLocalHome</local-home>

<local>fsd.oms.appsrv.mappingservices.mappingServicesLocal</local>

<ejb-link>fsdomsejbmodule.jar#mappingServicesBean</ejb-link>

</ejb-local-ref>

Am I not calling the bean correctly, or not set it up correctly? Or do I need a jndi lookup in another file?

Thanks - Allen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Vladimir - thanks again !!

I am getting closer, I have 3 errors for "cannot resolve symbol"

.../work/jsp_testmap1175186470750.java:78: cannot resolve symbol

symbol : class mappingservices

location: package appsrv

fsd.oms.appsrv.mappingservices mappingServicesLocal = null;

^

.../work/jsp_testmap1175186470750.java:79: cannot resolve symbol

symbol : class mappingservices

location: package appsrv

mappingServicesLocal = (fsd.oms.appsrv.mappingservices)pageContext.getAttribute("mappingServicesLocal", PageContext.SESSION_SCOPE);

^

.../work/jsp_testmap1175186470750.java:85: cannot resolve symbol

symbol : class mappingservices

location: package appsrv

mappingServicesLocal = (fsd.oms.appsrv.mappingservices) Beans.instantiate(getClass().getClassLoader(), "fsd.oms.appsrv.mappingservices");

^

3 errors

(all ^ point between appsrv and mappingservices)

This appears to be a classpath issue? Could this fall under this SAP note?

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_jas/~...

Or do you know of issues with string methods instead of object methods?

Those were a couple of posts I found, that seemed similar, but not really. I appreciate the experienced help and your thoughts!

thanks again - Allen

Vlado
Advisor
Advisor
0 Kudos

The problem is again in the <jsp:useBean ...> declaration:


<jsp:useBean id="mappingServicesLocal" scope="page" class="fsd.oms.appsrv.mappingservices" />

The specified class is wrong - I guess this is just your package name but the class name is missing.

And nevertheless, do you really need it? Since you want to call an EJB and not a plain JavaBean - see above ...

-Vladimir

Former Member
0 Kudos

Vladimir - thanks again, took me a couple minutes to comprehend it. The sample code for calculator is using a plain bean, I was referencing a enterprise bean. Thanks again - it is working now - have a great day !!

Answers (2)

Answers (2)

Vlado
Advisor
Advisor
0 Kudos

Hi Allen,

The <jsp:useBean ...> is about using plain JavaBeans in a JSP page. If you want to call an EJB (Enterprise JavaBean) you have to make use of the already defined <ejb-local-ref> reference. For more information please refer to <a href="http://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/0736159e-0301-0010-9ea4-c63d83d0797b">this</a> How-to Guide (especially Example 1) as well as the online help at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/55/29ed5eff965448941c0b42f01b9804/frameset.htm">help.sap.com</a>.

HTH!

-Vladimir

Former Member
0 Kudos

Vladimir - thanks for the link and for your quick response. that solved that problem I got another error below, but I am going to look at it some more. If you know of anything off the top of your head let me know, otherwise, I'll update the thread in a few hours. Thanks again - Allen

I got this error -

com.sap.engine.services.servlets_jsp.Deploy#fsd/oms#com.sap.engine.services.servlets_jsp.Deploy#Guest#2####7133fa80de0b11db995c000cf15747a0#SAPEngine_Application_Thread[impl:3]_22##0#0#Error##Plain###Runtime error in compiling of the JSP file <C:/usr/sap/FLA/JC00/j2ee/cluster/server0/apps/fsd/oms/servlet_jsp/LocalDevelopmentwebfsd/root/html/testnew.jsp> ! The error is: com.sap.engine.services.servlets_jsp.lib.jspparser.exceptions.JspParseException: Duplicated value [mappingServicesLocal] for attribute [id] in action [].

Former Member
0 Kudos

Please note the ^ under the error message is pointing to the . after appsrv and before mappingservices - the html did not format it correctly when posting - thanks