You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by la...@masq.ca on 2002/05/02 17:08:03 UTC

Is there a WebLogic guru in the house?

Hi,

I'm having a hell of a time trying to get my head around the WebApp
configuration to get EJB tests to work correctly. I think my main problem is
that I don't understand the relationship between the weblogic.xml file and
the EJB. So here's my setup. If someone can pinpoint my problem, I'd be so
ever thankful!

META-INF/
META-INF/MANIFEST.MF
META-INF/weblogic-ejb-jar.xml <I'm not sure I need this>
META-INF/ejb-jar.xml <If I include this I get a NPE when starting WL>
WEB-INF/
WEB-INF/classes/<contains all my classes including the junit/home/remote/bean class>
WEB-INF/lib/
WEB-INF/lib/aspectjrt.jar
WEB-INF/lib/cactus-ant.jar
WEB-INF/lib/cactus.jar
WEB-INF/lib/crimson.jar
WEB-INF/lib/httpunit.jar
WEB-INF/lib/junit.jar
WEB-INF/lib/log4j.jar
WEB-INF/lib/mockobjects-core.jar
WEB-INF/lib/mockobjects-doc.jar
WEB-INF/lib/mockobjects-j2ee1.3.jar
WEB-INF/lib/mockobjects-jdk1.3.jar
WEB-INF/lib/xalan.jar
WEB-INF/lib/<some other jars specific to our project>
WEB-INF/weblogic.xml
WEB-INF/web.xml

in my web.xml I have the following:

<web-app>
	<display-name>
		handler
	</display-name>
	<description>
		bla bla bla
	</description>

<!-- Cactus configuration
Note: Do not place any XML comments in this Cactus configuration section
(Ant's filtered copy is used to activate this configuration when the test
web application is built)
-->
<!-- Begin Cactus Configuration -->
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
<url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>

<ejb-ref>
  <ejb-ref-name>create_subscriber_profile</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <!-- these two classes are in the classes directory -->
  <home>ca.masq.fido.handler.HandlerHome</home>
  <remote>ca.masq.fido.handler.Handler</remote>
</ejb-ref>

<!-- End Cactus Configuration -->


</web-app>


In my weblogic.xml I have:

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 6.0//EN"
	"http://www.bea.com/servers/wls610/dtd/weblogic-web-jar.dtd">

<weblogic-web-app>

     <description>
        Web app to test cactus
     </description>

     <weblogic-version/>

	 <reference-descriptor>
		<ejb-reference-description>
		  <ejb-ref-name>create_subscriber_profile</ejb-ref-name>
		  <jndi-name>create_subscriber_profile</jndi-name>
		</ejb-reference-description>
	 </reference-descriptor>


</weblogic-web-app>

In my ejb-jar.xml file, I have the following. If I put this in my META-INF directory, I get a
null pointer exception.

<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
	<enterprise-beans>
        
        <!-- CreateSubscriberHandler -->
		<session>
			<ejb-name>createSubscriberHandler</ejb-name>
			<home>ca.masq.fido.handler.HandlerHome</home>
			<remote>ca.masq.fido.handler.Handler</remote>
			<ejb-class>ca.masq.fido.handler.registration.CreateSubscriberHandlerBean</ejb-class>
			<session-type>Stateless</session-type>
			<transaction-type>Container</transaction-type>										            
            <env-entry>
				<description>EndUserManager Jndi Name</description>
				<env-entry-name>END_USER_MANAGER_JNDI_NAME</env-entry-name>
				<env-entry-type>java.lang.String</env-entry-type>
				<env-entry-value>endusermanager.EndUserManagerHome</env-entry-value>
			</env-entry>
		</session>

	</enterprise-beans>
	
	<assembly-descriptor>

		<container-transaction>
			<method>
				<ejb-name>createSubscriberHandler</ejb-name>
				<method-intf>Remote</method-intf>
				<method-name>*</method-name>
			</method>
			<trans-attribute>Supports</trans-attribute>
		</container-transaction>
    </assembly-descriptor>    

</ejb-jar>

in my weblogic-ejb-jar file, I have this:

<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>

	<weblogic-enterprise-bean>
		<ejb-name>createSubscriberHandler</ejb-name>
		<caching-descriptor>
			<max-beans-in-cache>10</max-beans-in-cache>
		</caching-descriptor>
		<jndi-name>create_subscriber_profile</jndi-name>
	</weblogic-enterprise-bean>	

</weblogic-ejb-jar>

ant in my setUp() I have:

  context = new InitialContext();
  home    = (HandlerHome) EjbUtil.lookupHome(Handler.class, "create_subscriber_profile", context);

which throws a NamingException.

Does anyone know what part of my setup is messed up?

Thanks,

L

-- 
Laurent Duperval <ma...@masq.ca>

BOWIE'S THEOREM
    If an experiment works, you must be using the wrong equipment.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is there a WebLogic guru in the house?

Posted by la...@masq.ca.
On  2 May, To: cactus-user@jakarta.apache.org wrote:
> Ok, so maybe I'm just dense: where do I put the EJB? I thought I had to put
> it in the lib/ directory of the war. But when I do, I still can't locate
> with a JNDI lookup. That's why I thought that the ejb-jar and
> weblogic-ejb-jar files were needed.
> 

Well, I ended up giving up on the wepapp option because I obviously don't
understand it correctly. My tests now work with an ear and it's working as
expected. Eventually, I may go back and revisit this issue but I can't
afford to right now.

L

-- 
Laurent Duperval <ma...@masq.ca>

Murphy's Laws for Frequent Flyers
1.  No flight ever leaves on time unless you are running late and need the
    delay to make the flight.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is there a WebLogic guru in the house?

Posted by la...@masq.ca.
On  2 May, Rajagopal. V wrote:
> Hi
> Why do u need a ejb-jar.xml and weblogic-ejb-jar.xml
> in your WAR??? Its not needed in the war file.
> You need them in ur jar which has the EJBs..Your WAR
> file juste needs to have the web.xml, weblogic.xml and
> the class files(Dont include the EJB Bean, just the
> Home and Remote) and the support lib files. Thats it..
> Just give this a try ;-)
> 

Ok, so maybe I'm just dense: where do I put the EJB? I thought I had to put
it in the lib/ directory of the war. But when I do, I still can't locate
with a JNDI lookup. That's why I thought that the ejb-jar and
weblogic-ejb-jar files were needed.

L

-- 
Laurent Duperval <ma...@masq.ca>

L'affaire est dans le sac qui est lui-même dans la poche.
                                             -Achille Talon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is there a WebLogic guru in the house?

Posted by "Rajagopal. V" <ra...@yahoo.com>.
Hi
Why do u need a ejb-jar.xml and weblogic-ejb-jar.xml
in your WAR??? Its not needed in the war file.
You need them in ur jar which has the EJBs..Your WAR
file juste needs to have the web.xml, weblogic.xml and
the class files(Dont include the EJB Bean, just the
Home and Remote) and the support lib files. Thats it..
Just give this a try ;-)

Cheers
Raj

--- laurent.duperval@masq.ca wrote:
> On  2 May, Rajagopal. V wrote:
> > What I would do is just create a test Servlet with
> teh
> > code in your setup method and put the Home, Remote
> > classses in the Servlet Classpath and try running
> that
> > Servlet. If that works, it shud work in setup()
> too.
> > 
> > BTW, did u check ur weblogic console to see if the
> > JNDI name is registered for ur EJB?
> > 
> 
> My EJB doesn't deploy. Like I said, if I put the
> ejb-jar.xml file in my
> META-INF directory, I get a null pointer exception,
> I'n not sure why.
> 
> I think I'm just going to forget the webapp route
> and do the EAR thing. I
> think I'll have less problems that way.
> 
> L
> 
> -- 
> Laurent Duperval <ma...@masq.ca>
> 
> Why are there flotation devices under plane seats
> instead of parachutes?
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is there a WebLogic guru in the house?

Posted by la...@masq.ca.
On  2 May, Rajagopal. V wrote:
> What I would do is just create a test Servlet with teh
> code in your setup method and put the Home, Remote
> classses in the Servlet Classpath and try running that
> Servlet. If that works, it shud work in setup() too.
> 
> BTW, did u check ur weblogic console to see if the
> JNDI name is registered for ur EJB?
> 

My EJB doesn't deploy. Like I said, if I put the ejb-jar.xml file in my
META-INF directory, I get a null pointer exception, I'n not sure why.

I think I'm just going to forget the webapp route and do the EAR thing. I
think I'll have less problems that way.

L

-- 
Laurent Duperval <ma...@masq.ca>

Why are there flotation devices under plane seats instead of parachutes?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is there a WebLogic guru in the house?

Posted by "Rajagopal. V" <ra...@yahoo.com>.
What I would do is just create a test Servlet with teh
code in your setup method and put the Home, Remote
classses in the Servlet Classpath and try running that
Servlet. If that works, it shud work in setup() too.

BTW, did u check ur weblogic console to see if the
JNDI name is registered for ur EJB?

Cheers
Raj

--- laurent.duperval@masq.ca wrote:
> Hi,
> 
> I'm having a hell of a time trying to get my head
> around the WebApp
> configuration to get EJB tests to work correctly. I
> think my main problem is
> that I don't understand the relationship between the
> weblogic.xml file and
> the EJB. So here's my setup. If someone can pinpoint
> my problem, I'd be so
> ever thankful!
> 
> META-INF/
> META-INF/MANIFEST.MF
> META-INF/weblogic-ejb-jar.xml <I'm not sure I need
> this>
> META-INF/ejb-jar.xml <If I include this I get a NPE
> when starting WL>
> WEB-INF/
> WEB-INF/classes/<contains all my classes including
> the junit/home/remote/bean class>
> WEB-INF/lib/
> WEB-INF/lib/aspectjrt.jar
> WEB-INF/lib/cactus-ant.jar
> WEB-INF/lib/cactus.jar
> WEB-INF/lib/crimson.jar
> WEB-INF/lib/httpunit.jar
> WEB-INF/lib/junit.jar
> WEB-INF/lib/log4j.jar
> WEB-INF/lib/mockobjects-core.jar
> WEB-INF/lib/mockobjects-doc.jar
> WEB-INF/lib/mockobjects-j2ee1.3.jar
> WEB-INF/lib/mockobjects-jdk1.3.jar
> WEB-INF/lib/xalan.jar
> WEB-INF/lib/<some other jars specific to our
> project>
> WEB-INF/weblogic.xml
> WEB-INF/web.xml
> 
> in my web.xml I have the following:
> 
> <web-app>
> 	<display-name>
> 		handler
> 	</display-name>
> 	<description>
> 		bla bla bla
> 	</description>
> 
> <!-- Cactus configuration
> Note: Do not place any XML comments in this Cactus
> configuration section
> (Ant's filtered copy is used to activate this
> configuration when the test
> web application is built)
> -->
> <!-- Begin Cactus Configuration -->
> <servlet>
> <servlet-name>ServletRedirector</servlet-name>
>
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
> </servlet>
> 
> <servlet-mapping>
> <servlet-name>ServletRedirector</servlet-name>
> <url-pattern>/ServletRedirector</url-pattern>
> </servlet-mapping>
> 
> <ejb-ref>
>  
>
<ejb-ref-name>create_subscriber_profile</ejb-ref-name>
>   <ejb-ref-type>Session</ejb-ref-type>
>   <!-- these two classes are in the classes
> directory -->
>   <home>ca.masq.fido.handler.HandlerHome</home>
>   <remote>ca.masq.fido.handler.Handler</remote>
> </ejb-ref>
> 
> <!-- End Cactus Configuration -->
> 
> 
> </web-app>
> 
> 
> In my weblogic.xml I have:
> 
> <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems,
> Inc.//DTD Web Application 6.0//EN"
> 
>
"http://www.bea.com/servers/wls610/dtd/weblogic-web-jar.dtd">
> 
> <weblogic-web-app>
> 
>      <description>
>         Web app to test cactus
>      </description>
> 
>      <weblogic-version/>
> 
> 	 <reference-descriptor>
> 		<ejb-reference-description>
> 		 
>
<ejb-ref-name>create_subscriber_profile</ejb-ref-name>
> 		  <jndi-name>create_subscriber_profile</jndi-name>
> 		</ejb-reference-description>
> 	 </reference-descriptor>
> 
> 
> </weblogic-web-app>
> 
> In my ejb-jar.xml file, I have the following. If I
> put this in my META-INF directory, I get a
> null pointer exception.
> 
> <?xml version="1.0"?>
> <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems,
> Inc.//DTD Enterprise JavaBeans 1.1//EN'
> 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
> <ejb-jar>
> 	<enterprise-beans>
>         
>         <!-- CreateSubscriberHandler -->
> 		<session>
> 			<ejb-name>createSubscriberHandler</ejb-name>
> 			<home>ca.masq.fido.handler.HandlerHome</home>
> 			<remote>ca.masq.fido.handler.Handler</remote>
> 		
>
<ejb-class>ca.masq.fido.handler.registration.CreateSubscriberHandlerBean</ejb-class>
> 			<session-type>Stateless</session-type>
> 			<transaction-type>Container</transaction-type>			
> 						            
>             <env-entry>
> 				<description>EndUserManager Jndi
> Name</description>
> 			
>
<env-entry-name>END_USER_MANAGER_JNDI_NAME</env-entry-name>
> 			
> <env-entry-type>java.lang.String</env-entry-type>
> 			
>
<env-entry-value>endusermanager.EndUserManagerHome</env-entry-value>
> 			</env-entry>
> 		</session>
> 
> 	</enterprise-beans>
> 	
> 	<assembly-descriptor>
> 
> 		<container-transaction>
> 			<method>
> 				<ejb-name>createSubscriberHandler</ejb-name>
> 				<method-intf>Remote</method-intf>
> 				<method-name>*</method-name>
> 			</method>
> 			<trans-attribute>Supports</trans-attribute>
> 		</container-transaction>
>     </assembly-descriptor>    
> 
> </ejb-jar>
> 
> in my weblogic-ejb-jar file, I have this:
> 
> <?xml version="1.0"?>
> <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems,
> Inc.//DTD WebLogic 5.1.0 EJB//EN'
>
'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
> <weblogic-ejb-jar>
> 
> 	<weblogic-enterprise-bean>
> 		<ejb-name>createSubscriberHandler</ejb-name>
> 		<caching-descriptor>
> 			<max-beans-in-cache>10</max-beans-in-cache>
> 		</caching-descriptor>
> 		<jndi-name>create_subscriber_profile</jndi-name>
> 	</weblogic-enterprise-bean>	
> 
> </weblogic-ejb-jar>
> 
> ant in my setUp() I have:
> 
>   context = new InitialContext();
>   home    = (HandlerHome)
> EjbUtil.lookupHome(Handler.class,
> "create_subscriber_profile", context);
> 
> which throws a NamingException.
> 
> Does anyone know what part of my setup is messed up?
> 
> Thanks,
> 
> L
> 
> -- 
> Laurent Duperval <ma...@masq.ca>
> 
> BOWIE'S THEOREM
>     If an experiment works, you must be using the
> wrong equipment.
> 
> 
> 
> 
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>