This content has been marked as final.
Show 3 replies
-
1. Re: Service Beans in Embeddable EJB 3.0?
jazir1979 Jan 3, 2007 11:04 PM (in response to jantzen)Hi there,
If your EJBs are being started you will see it in your logs, something similar to what I've got here:DEBUG 03-01 15:00:33,895 (Ejb3AnnotationHandler.java:getContainers:158) -found EJB3: ejbName=LookupActionBean, class=LookupActionBean, type=STATELESS DEBUG 03-01 15:00:33,906 (ProxyDeployer.java:initializeRemoteBindingMetadata:131) -no declared remote bindings for : LookupActionBean DEBUG 03-01 15:00:33,925 (Ejb3DescriptorHandler.java:addClassAnnotation:1686) -adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to LookupServiceBean org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@2d95b3 DEBUG 03-01 15:00:33,926 (Ejb3DescriptorHandler.java:addClassAnnotation:1688) -adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to LookupServiceBean org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@2d95b3 DEBUG 03-01 15:00:33,928 (Ejb3DescriptorHandler.java:addClassAnnotation:1686) -adding class annotation javax.annotation.security.DeclareRoles to LookupServiceBean org.jboss.ejb.DeclareRolesImpl@bf5555 DEBUG 03-01 15:00:33,928 (Ejb3DescriptorHandler.java:addClassAnnotation:1688) -adding class annotation javax.annotation.security.DeclareRoles to LookupServiceBean org.jboss.ejb.DeclareRolesImpl@bf5555
When I have the above bean, I can look it up from a unit test as:bean = (LookupAction) ctx.lookup("LookupActionBean/local");
Check that your unit tests run with the following jndi.properties in the classpath, or specified when you get your initial context:java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-
2. Re: Service Beans in Embeddable EJB 3.0?
jantzen Jan 4, 2007 1:13 AM (in response to jantzen)HI Jazir,
I've got the naming properties you describe in place, and I'm looking up stateless beans with the kind of JNDI name you're describing. I'm not sure where EJB Embedded writes its logs though. Which logfile are you looking at?
Thanks -
3. Re: Service Beans in Embeddable EJB 3.0?
jazir1979 Jan 4, 2007 10:35 PM (in response to jantzen)Hi again,
Mine is going to System.out, as configured in the log4j.xml in my ejb3-embedded/conf directory (which is in my classpath when I run the tests).<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="Target" value="System.out"/> <param name="Threshold" value="ALL"/> <layout class="org.apache.log4j.PatternLayout"> <!-- The default pattern: Date Priority [Category] Messagen --> <!-- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/> --> <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L) -%m%n"/> </layout> </appender> <root> <appender-ref ref="CONSOLE"/> </root>