-
1. Re: Application Startup Actions
gavin.king Nov 8, 2006 12:13 PM (in response to iradix)I would really rather prefer if you figured out what changed in 1.1 that broke your code, and let me know...
-
2. Re: Application Startup Actions
iradix Nov 8, 2006 12:32 PM (in response to iradix)Fair enough. I'll look into it some more when I'm testing the page parameter converter change in a little bit. Either way though, I'm curious if you or anyone else has a better solution? Creating an SFSB only to have it remove itself from the application context in it's own @Create method doesn't exactly strike me as the most readable code :)
-
3. Re: Application Startup Actions
iradix Nov 8, 2006 4:23 PM (in response to iradix)Ok Gavin, it looks to me like the problem stems from the SeamListener trying to instantiate the application scoped SFSB before Jboss is initialized. Adding depends="org.jboss.seam.core.Ejb" doesn't seem to help. Stack trace follows
-Exception sending context initialized event to listener instance of class org.j boss.seam.servlet.SeamListener org.jboss.seam.InstantiationException: Could not instantiate Seam component: sta teLoader at org.jboss.seam.Component.newInstance(Component.java:1662) at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:153) at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:12 7) at org.jboss.seam.init.Initialization.init(Initialization.java:323) at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.j ava:33) at org.apache.catalina.core.StandardContext.listenerStart(StandardContex t.java:3669) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 104) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73 9) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja va:589) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j ava:536) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442 ) at org.apache.catalina.core.StandardService.start(StandardService.java:4 50) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683 ) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Caused by: javax.naming.NamingException: Local server is not initialized at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnl yContextFactory.java:45) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6 67) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247 ) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.<init>(InitialContext.java:197) at org.jboss.seam.util.Naming.getInitialContext(Naming.java:35) at org.jboss.seam.util.Naming.getInitialContext(Naming.java:47) at org.jboss.seam.Component.instantiateSessionBean(Component.java:992) at org.jboss.seam.Component.instantiate(Component.java:979) at org.jboss.seam.Component.newInstance(Component.java:1658) ... 28 more
-
4. Re: Application Startup Actions
rlhr Nov 8, 2006 6:09 PM (in response to iradix)I have a couple of components accessing the database and caching data for the application. I didn't get any trouble moving from Seam 1.0 to Seam 1.1
They are defined as follow:@Scope(ScopeType.APPLICATION) @Name("someComponent") public class SomeComponent { @Create public void startup() throws Exception { ... } }
-
5. Re: Application Startup Actions
iradix Nov 8, 2006 6:15 PM (in response to iradix)I think the problem here has to do with the @Startup annotation. I take it you're not using that?
-
6. Re: Application Startup Actions
rlhr Nov 9, 2006 1:51 AM (in response to iradix)That's right, I'm not using the @Startup annotation.
-
7. Re: Application Startup Actions
rlhr Nov 9, 2006 1:56 AM (in response to iradix)Actually I do.
I think the previous code is not the one I intended to copy. Here is what I use:@Scope(ScopeType.APPLICATION) @Intercept(InterceptionType.NEVER) @Startup(depends = {"pojoCache"}) @Name("resourcesManager") public class ResourcesManager { private static final Log log = LogFactory.getLog(ResourcesManager.class); private transient PojoCache pojoCache = org.jboss.seam.core.PojoCache.instance(); private EntityManager entityManager; @Create public void startup() throws Exception { ... } }
-
8. Re: Application Startup Actions
iradix Nov 9, 2006 10:48 AM (in response to iradix)Ok. Well that's making it look increasingly like my problem is with when JBoss initializes since you are using a POJO rather than a session bean. Has this changed between versions?
-
9. Re: Application Startup Actions
gavin.king Nov 13, 2006 8:03 PM (in response to iradix)Is this on JBoss AS? Or E-EJB3?
-
-
11. Re: Application Startup Actions
gavin.king Nov 14, 2006 1:02 PM (in response to iradix)Well, that makes more sense, since Seam is responsible for starting the Ejb component during its startup phase.
Put:depends="org.jboss.seam.core.ejb"
on your component (no caps!) -
12. Re: Application Startup Actions
iradix Nov 14, 2006 1:12 PM (in response to iradix)Huh, don't know where I got the capital E from, I thought I just cut and pasted from the @Name. I'll give it a shot and let you know if it fixes the problem.
-
13. Re: Application Startup Actions
iradix Nov 17, 2006 12:37 PM (in response to iradix)That fixed it. Thanks.