Philippe,

I do not try to run the security example because I have not been able to get
the Make files to run under Cygwin. The scripts do run but they screw up my
classpath. I can't compile the servlet because the servlet.jar is not seen
at compile time even though it appears to be in the classpath. Anyway, that
is a configuration issue for another day.

I believe that I am very close to getting my own example to work. I can get
my own servlet to run but it generates an exception when it goes looking for
my 'TestHome' class (in the same way the security example looks for the
'OpHome' class). I have a standalone application that uses the same code and
finds the EJBServer and beans with no problem. Somewhere I have not set up
whatever is needed in Tomcat to find the EJBServer. Could it be that the
jndi.properties file that my standalone application (under the JONAS_ROOT
directory) uses is not being found by Tomcat? How does Tomcat know where the
EJBServer is? Should I even be attempting this exercise in Tomcat 4?

Any suggestions are much appreciated.

Thanks,
Jerry



-----Original Message-----
From: Philippe Coq [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 3:58 AM
To: Thomas, Jerry
Cc: [EMAIL PROTECTED]
Subject: Re: standalone client works - servlet does not


"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.SecurityCtxInterceptor3
2" 
            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".

Reply via email to