cancel
Showing results for 
Search instead for 
Did you mean: 

The requested resource does not exist - EAR - Jsp

Former Member
0 Kudos

Hy!

Following a tutorial I'm trying to create a small application in the Developer Studio.

I created a Table, an EJB-Project with an Entity Bean and a Stateless Session Bean, a Web-Project with a JSP-File and an EAR which I deployed. Now the JSP form should be available at http://[server-name]:50000/employee/view.

But I get:

 404   Not Found - SAP J2EE Engine/6.40 
The requested resource does not exist.
Details:	Go to main page of this application!

"main page" is a link which refers to http://localhost:50000/index.html which is the SAP Engine Start Page.

This is my first experience with sap netweaver. So I don't know where I should start to search for the problem or how to solve it.

In the web.xml of the WebProject there is the following code for the servlet mapping:


<servlet>
	<servlet-name>NewEmployee.jsp</servlet-name>
	<jsp-file>/NewEmployee.jsp</jsp-file>
</servlet>
<servlet-mapping>
	<servlet-name>NewEmployee.jsp</servlet-name>
	<url-pattern>/view</url-pattern>
</servlet-mapping>

This is the code in the application.xml of the ear which should make it possible to access the webproject under .../employee.


<module>
	<web>
		<web-uri>EmployeeWeb.war</web-uri>
		<context-root>employee</context-root>
	</web>
</module>

Best Regards,

Carina

Accepted Solutions (1)

Accepted Solutions (1)

prashil
Advisor
Advisor
0 Kudos

Hi Carina,

I think the deployment hasn't been proper.

Try to read the log's for the deployment or follow the deployment procedure once again.

Thanks,

Prashil

Former Member
0 Kudos

Hy!

I tried several changes and found out, I just had to remove the ' / ' bevor NewEmployee.jsp in the jsp-file - tag.


<servlet>
	<servlet-name>NewEmployee.jsp</servlet-name>
	<jsp-file>NewEmployee.jsp</jsp-file>
</servlet>

Now it works and I'm able to test the jsp. There's a form and after a submit a jndi-lookup is performed.


Object ref=jndiContext.lookup("java:comp/ev/ejb/EmployeeService");

It seems the EJB reference in the web.xml:


         <ejb-ref>
		<ejb-ref-name>ejb/EmployeeService</ejb-ref-name>
		<ejb-ref-type>Session</ejb-ref-type>
		<home>com.sap.bsp.EmployeeServicesHome</home>
		<remote>com.sap.bsp.EmployeeServices</remote>
		<ejb-link>EmployeeEjb.jar#EmployeeServicesBean</ejb-link>
	</ejb-ref>

doesn't work, because I get:


com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/ev/ejb/EmployeeService.

Looking forward to a hint

Best regards,

Carina

former_member187702
Active Participant
0 Kudos

Hi Carina

Just try with the following change

Object ref=jndiContext.lookup("java:comp/env/EmployeeService");

and

<ejb-ref-name>EmployeeService</ejb-ref-name>

Regards

Former Member
0 Kudos

Hi Shila,

I tried it and it worked!

Thanks much 😃

Regards

Answers (0)