3 Replies Latest reply on Jun 4, 2004 9:49 AM by ghoyle

    starting jboss in same jvm as another program

    ghoyle Newbie

      Is it possible to start JBOSS in the same jvm as another program i.e. another program will start it, so that it will then be able to access all the containers classes.

        • 1. Re: starting jboss in same jvm as another program
          Darran Lofthouse Master

          Are you trying to get the other program to use the JBoss classes or actual Object instances created by JBoss?

          • 2. Re: starting jboss in same jvm as another program
            ghoyle Newbie

            I am writing corba wrappers to access session beans, so I want them all to run in the jvm, that way I can use the same instance of jacorb etc.
            So was thinking I would have to start JBoss from withing my Corba server program.

            • 3. Re: starting jboss in same jvm as another program
              ghoyle Newbie

              I was thinkng that perhaps another way to achieve this would be to create a seperate jar file for my wrapper application and deploy that along with the jar files for the session beans in an ear file.

              Tried it but could not seem to get it working think there is something wrong with my deployment descriptors. Plus unsure how I would start my wrapper program once it is in the ear file, or will JBOSS do that?

              I have included my deployment descriptors below, if that helps anyone solve this problem. The error i get in jboss is..


              ERROR [MainDeployer] could not create deployment: file:/opt/jboss-3.2.3/server/all/tmp/deploy/tmp43058corba-ejb.ear-contents/cwrapper.jar
              org.jboss.deployment.DeploymentException: Failed to setup client ENC; - nested throwable: (org.jboss.deployment.DeploymentException: Failed to resolve ejb-link: GoodDay make by ejb-name: com/ssl/ejb/GoodDay)


              For my ear file..application.xml
              <?xml version="1.0" encoding="UTF-8"?>
              
              <jboss>
               <app-client>
               <ejb-ref>
               <ejb-ref-name>com/ssl/ejb/GoodDay</ejb-ref-name>
               <jndi-name>GoodDay</jndi-name>
               </ejb-ref>
               </app-client>
              </jboss>
              


              for the jar file that contains my wrapper classes

              application-client.xml

              <?xml version="1.0" encoding="UTF-8"?>
              
              <!DOCTYPE application-client PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN' 'http://java.sun.com/dtd/application-client_1_3.dtd'>
              
              <application-client>
               <display-name>CorbaWrapper</display-name>
               <ejb-ref>
               <ejb-ref-name>com/ssl/ejb/GoodDay</ejb-ref-name>
               <ejb-ref-type>Session</ejb-ref-type>
               <home>GoodDayHome</home>
               <remote>GoodDay</remote>
               <ejb-link>GoodDay</ejb-link>
               </ejb-ref>
              
              </application-client>
              


              and jboss.xml
              <?xml version="1.0" encoding="UTF-8"?>
              
              <jboss>
               <app-client>
               <ejb-ref>
               <ejb-ref-name>com/ssl/ejb/GoodDay</ejb-ref-name>
               <jndi-name>GoodDay</jndi-name>
               </ejb-ref>
               </app-client>
              </jboss>
              


              For my jar file that contains my ejb
              ejb-jar.xml
              <?xml version="1.0"?>
              
              <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'
               'http://alpha-am02-mx01/dtd/ejb-jar_1_1.dtd'>
              
              <ejb-jar>
               <enterprise-beans>
               <session>
               <ejb-name>GoodDay</ejb-name>
               <home>com.ssl.ejb.GoodDayHome</home>
               <remote>com.ssl.ejb.GoodDay</remote>
               <ejb-class>com.ssl.ejb.GoodDayBean</ejb-class>
               <session-type>Stateless</session-type>
               <transaction-type>Container</transaction-type>
               </session>
               </enterprise-beans>
              
               <assembly-descriptor>
               <container-transaction>
               <method>
               <ejb-name>GoodDay</ejb-name>
               <method-intf>Remote</method-intf>
               <method-name>*</method-name>
               </method>
               <trans-attribute>Required</trans-attribute>
               </container-transaction>
               </assembly-descriptor>
              </ejb-jar>