cancel
Showing results for 
Search instead for 
Did you mean: 

A problem

Former Member
0 Kudos

Hi,everybody.I have a questioon is below (can i call a session bean directly in a .jsp file without through a javabean?)

I had made a test. I create a simple jsp file is aaa.jsp(just present some words).

And i deployed it and typed the url http://localhost:50000/aaa/aaa with IE. It can display.

But when I add some source code in jsp. There are some errors. The ie error message is below

(The request can't be processed.

Details: The requested resource ( aaa/servlet/aaa.jsp ) is not found)

Why it needs a servlet? I didn`t create a servlt!!

The source i added is below

try {

public Sessionccc ccc;

InitialContext ctx = new InitialContext();

Object ob = ctx.lookup

("java:comp/env/ejb/SessioncccBean");

SessioncccHome home =(SessioncccHome)

PortableRemoteObject.narrow

(ob,SessioncccHome.class);

ccc = home.create();

} catch (Exception e) {

throw new Exception("Error instantiating

Calculator EJB" + e.toString());

}

Please help me.Thx a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

http://localhost:50000/aaa/aaa.jsp That`s ok.

Thx a lot.

Could you tell me why?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Louis

Could you tell what you have specified in your web.xml

Regards

Pran

Former Member
0 Kudos

It`s my web.xml

<display-name>WEB APP</display-name>

<description>WEB APP description</description>

<servlet>

servlet-name>aaa.jsp</servlet-name>

<jsp-file>/aaa.jsp</jsp-file>

</servlet>

<servlet-mapping>

<servlet-name>aaa.jsp</servlet-name>

<url-pattern>/</url-pattern>

</servlet-mapping>

<ejb-ref>

<ejb-ref-name>ejb/SessioncccBean</ejb-ref-name>

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

<home>zxcvboy.SessioncccHome</home>

<remote>zxcvboy.Sessionccc</remote>

<ejb-link>ccc.jar#SessioncccBean</ejb-link>

</ejb-ref>

Former Member
0 Kudos

Hi Louis

I tried to reproduce yoru error the only way I could achieve it is by placing a servlet-name that has not been defined , otherwise with the xml file u have shown all the three urls seem to be valid

Regards

Pran