Here's the hint:

>       // Get a naming context
>       InitialContext jndiContext = new InitialContext();
>       sHome = "1";
>
>       // Get a reference to the Interest Bean
>       Object ref  = jndiContext.lookup("InterestBean");
>       sHome = "2";
>
>       // Get a reference from this to the Bean's Home interface
>       InterestHome home = (InterestHome)
>         PortableRemoteObject.narrow (ref, InterestHome.class);
>
>    if (home == null) {sHome = "Home Null!";} else {sHome = "Not Null!";};


>this is the result when I go to 
><http://localhost:8080/servlet/EJB>http://localhost:8080/servlet/EJB:
>
>
>Servlet interface to EJB
>
>
>
>
>
>Calling EJB...
>
>
>
>
>
>ok: 1
>
>
>
>Could not connect to Interest bean. Is EJB Container running?

Your debugging string, sHome, indicates that you got an InitialContext(), 
but that there was probably an exception when you tried to get a reference 
to the Interest bean (because you never did get to the line which sets 
sHome = "2"). I suspect that means that your Interest bean is not deployed, 
or if it is deployed, it has a different name under JNDI namespace.

Change to the jboss/bin directory and run this command:

java -jar jndiView.jar | more

(You should put that in a script or batch file. In fact, this script/batch 
file should be part of the standard distribution.)

If the Interest bean is deployed, you should see its name listed.

Check the jBoss log and see if there's an exception during deployment. If 
you don't see one, you can change the logging MLET code in 
jboss/conf/default/jboss.conf:

<MLET CODE = "org.jboss.logging.ConsoleLogging" ARCHIVE="jboss.jar" 
CODEBASE="../../lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="Information,Warning,Error">
    <ARG TYPE="java.lang.String" VALUE="[{2}] {4} {1} {3}">
</MLET>

(See how I added {1} and {3}.)

<MLET CODE = "org.jboss.logging.FileLogging" ARCHIVE="jboss.jar" 
CODEBASE="../../lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="Information,Debug,Warning,Error">
    <ARG TYPE="java.lang.String" VALUE="[{2}] {4} {1} {3}">
</MLET>

(Again, I added {1} and {3}.)

Now look at the window from which you ran jBoss or file jboss/log/server.log.

-- Ken Jenks, http://abiblion.com/

    Tools for reading.


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to