"Thomas, Jerry" wrote:
>
> I am trying for the first time to get a servlet to find a bean in Jonas.
> After creating and deploying a war file to Tomcat, the server can find my
> servlet but I get the following error
>
> Cannot lookup TestHome: java.lang.NullPointerException
>
> This occurs in my servlet on the following line of code:
>
> home =
> (TestHome)PortableRemoteObject.narrow(initialContext.lookup("TestHome"),
> TestHome.class);
>
> When running a standalone client, I can find the same bean and get expected
> results from the methods in the bean. What must I do for the servlet to
> 'see' the bean in the EJBServer (is the servlet finding the server) ?
>
> I am running NT using Jonas 2.2.7 and Tomcat 4. The sb and eb samples worked
> fine. I have not been able to get the security sample to compile correctly
> in cygwin thus the attempt to create something on my own.
>
> Here is most of the java code and xml files that I am using. Please let me
> know what I am missing. Thanks.
Hi,
I have succeeded to run the servlet in the
$JONAS_ROOT/examples/src/security
with TOMCAT 3.2.1 after having disabling the security access control.
If you don't need security it seems that it works.
Here is how I have done:
- I have modified $JONAS_ROOT/examples/src/security/ejb-jar.xml by
deleting
<security-role> and <method-permission> tags
- I have compiled by running make under $JONAS_ROOT/example/src/security
- I have copied the war file
$JONAS_ROOT/examples/src/security/ejbSample/ejbSample.war
into $TOMCAT_HOME/webapps
- under $TOMCAT_HOME/webapps/ejbSamples I have create a directory
secured and put
op.html style.css
(This operation is manual beacuse the JOnAS security sample was built to
run with
Tomcat 3.1 and it seems that since Tomcat 3.2 some changes are
mandatoty)
- under conf I have modified server.xml in order to comment the
RequestInterceptor relative to security:
<!-- RequestInterceptor
className="org.apache.tomcat.request.SimpleRealm"
debug="1" / -->
<!-- RequestInterceptor
className="org.objectweb.security.tomcat.interceptor.SecurityCtxInterceptor32"
debug="1" /-->
- I have run registry
- under $JONAS_ROOT/example/src/security/sb I have launched the server:
EJBServer&-
- I have run tomcat
. $JONAS_ROOT/bin/unix/config_env
$TOMCAT_HOME/bin/tomcat.sh start
- I have run my web browser :
netscape http://<hostname>:<port>/ejbSample
where <hostname> is the name of my machine (localhost by default)
and <port> the port number (8080 by default)
- got :
Actions realized by the servlet and the EJB
Create a bean
Start a first transaction
First request on the new bean
Second request on the bean
Commit the transaction
Start a second transaction
Rollback the transaction
Request outside any transaction
Sample is OK.
Can you try this ?
I hope it helps.
Regards,
--
Philippe
Philippe Coq Evidian Phone: (33) 04 76 29 78 49
Bull S.A - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".