I have a EJB jar which I have added to the deploy directory successfully and
gives me this log file:

[Auto deploy] Starting
[Auto deploy] Auto deploy of
file:/opt/jboss_tomcat/jboss-2.0-FINAL/deploy/cal.jar
[J2EE Deployer] Deploy J2EE application:
file:/opt/jboss_tomcat/jboss-2.0-FINAL/deploy/cal.jar
[J2EE Deployer] Create application cal.jar
[J2EE Deployer] Installing EJB package: cal.jar
[J2EE Deployer] Starting module cal.jar
[Container factory]
Deploying:file:/opt/jboss_tomcat/jboss-2.0-FINAL/bin/../tmp/deploy/cal.jar/e
jb1002.jar
[Container factory] Loading ejb-jar.xml :
jar:file:/opt/jboss_tomcat/jboss-2.0-FINAL/bin/../tmp/deploy/cal.jar/ejb1002
.jar!/META-INF/ejb-jar.xml
[Container factory] Loading standardjboss.xml :
file:/opt/jboss_tomcat/jboss-2.0-FINAL/conf/tomcat/standardjboss.xml
[Verifier] Verifying
file:/opt/jboss_tomcat/jboss-2.0-FINAL/bin/../tmp/deploy/cal.jar/ejb1002.jar
[Verifier] CalendarEntity: Verified.
[Verifier] CalendarEJB: Verified.
[Container factory] Deploying CalendarEntity
[Container factory] Container Invoker RMI Port='4444'
[Container factory] Container Invoker Optimize='true'
[Container factory] Deploying CalendarEJB
[Container factory] Container Invoker RMI Port='4444'
[Container factory] Container Invoker Optimize='true'
[Container factory] Mapped Container method remove HASH -1842617161
[Container factory] Mapped Container method getEJBHome HASH -993218923
[Container factory] Mapped Container method getHandle HASH 1182305581
[Container factory] Mapped Container method getPrimaryKey HASH -131865408
[Container factory] Mapped Container method isIdentical HASH 285457048
[Container factory] Mapped countRows -1665392570to public int
calendar5.CalendarEJB.countRows()
[Container factory] Mapped addDate 2007999521to public boolean
calendar5.CalendarEJB.addDate(java.sql.Timestamp)
[Container factory] Mapping remove
[Container factory] Mapping remove
[Container factory] Mapping getEJBMetaData
[Container factory] Mapping getHomeHandle
[Container factory] Mapping create
[Container factory] Bound CalendarEntity to CalendarEntity
[Bean Cache] Cache policy scheduler started
[Container factory] Bound CalendarEJB to CalendarEJB
[Container factory] Deployed application:
file:/opt/jboss_tomcat/jboss-2.0-FINAL/bin/../tmp/deploy/cal.jar/ejb1002.jar
[J2EE Deployer] J2EE application:
file:/opt/jboss_tomcat/jboss-2.0-FINAL/deploy/cal.jar is deployed.

I then have a JSP page in tomcat/webapps/ROOT/index.jsp which calls a
javabean (in tomcat/webapps/ROOT/WEB-INF/classes), and this JavaBean
contains the following code :

  private CalendarEJBHome home = null ;

  private void makeHome() {
    if( home == null ) {
      try {
        InitialContext ctx = new InitialContext();
        Object objref = ctx.lookup( "CalendarEJB" );
        home = (CalendarEJBHome)PortableRemoteObject.narrow( objref,
CalendarEJBHome.class ) ;
      } catch( Exception e ) {
        lastexception = e.toString() ;
      }
    }
  }

Bt when the JavaBean tries to call makeHome to tie itself to the CalendarEJB
EJB, I get the following exception :

javax.naming.NoInitialContextException:
  Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
    java.naming.factory.initial

I have tried specifying a host and port for the Naming service (like so)

        Object objref = ctx.lookup( "//localhost:1099/CalendarEJB" );

But still the same exception...

Has anyone used jBoss like this?  Or is everybody using EAR files?  Surely
this _should_ work?

I am stuck.

Please help...

Tim Yates



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to