cancel
Showing results for 
Search instead for 
Did you mean: 

EJB Call in JSP

Former Member
0 Kudos

hi!

I try to make a simple hello world with a stateless session bean and call in a jsp site. But in my HelloWorldHome, it can resolve the HelloWorld create() call. And in my HelloWorld it prints me "The type HelloWorld collides with a package HelloWorld.java". I compared my program with other public helloworld bean programs and with books, but I can't find the reason for this problem. Probably I'm the problem...

thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I renamed my package, and now it's no longer a collide, but can'T still resolve initial process in my HelloWorldProxy.java

Former Member
0 Kudos

Hi

I donno your context

Please check JNDI name whether its same for both

Regards

Former Member
0 Kudos

My problem is to import my HelloWorld.java and HelloWorldHome.java. I have one package with this two files, and my HelloWorldProxy.java is in the same package in .beans . But without these both files, I can't create the InitialContext().

Former Member
0 Kudos

Hi

I think its nothing to do with imports.

--IntialContext

--Lookup to get ref

--then create()

If you cant create intial context then that is something to do with props for initial Context.

I donno about Netweaver AS.In general if you are accessing EJB in JSP you have add Ejb Refrence to web.xml

and more over accessing EJB in JSP is pooor way to do.

else please print your stack trace .

Regards

Former Member
0 Kudos

I checked the references, but they are in my web.xml as you can see:

<web-app>

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

<description>WEB APP description</description>

<servlet>

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

<jsp-file>/HelloWorld.jsp</jsp-file>

</servlet>

<ejb-ref>

<ejb-ref-name>ejb/HelloWorldBean</ejb-ref-name>

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

<home>zf.test2.HelloWorldHome</home>

<remote>zf.test2.HelloWorld</remote>

<ejb-link>HelloWorldBean</ejb-link>

</ejb-ref>

</web-app>

The test calculator in the tutorial runs fine, and I checked all the settings in my helloWorld and that are the same.

Former Member
0 Kudos

I create a my helloworld bean in the calculator workspace, because the calculator bean run.

it works, I can import and see all my files in the package for import.

then I create a new webspace with only my helloworld files and ... it doesn't work. Can't import, the references are not shown to my. I can see the package, but not the files. Has anyone an idea what to do yet?

thanks