[jboss-user] [JBoss Seam] - Re: Integrate user defined Resources (suggestions needed)
baz
do-not-reply at jboss.com
Thu Mar 22 06:38:18 EDT 2007
Hello,
i tried to follow your advise.
But after starting the app i get this exception:
11:26:34,437 ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/baz]: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
| java.lang.RuntimeException: error while reading /WEB-INF/components.xml
| at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:130)
| at org.jboss.seam.init.Initialization.<init>(Initialization.java:81)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
| at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
| at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
| at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
| at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
| at org.apache.catalina.core.StandardService.start(StandardService.java:450)
| at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
| at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
| at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
| Caused by: java.lang.NullPointerException
| at org.jboss.seam.init.Initialization.installComponentsFromXmlElements(Initialization.java:211)
| at org.jboss.seam.init.Initialization.initComponentsFromXmlDocument(Initialization.java:126)
| ... 17 more
| 22.03.2007 11:26:34 org.apache.catalina.core.StandardContext start
| SCHWERWIEGEND: Error listenerStart
This is because i have not added the @Install annotation to the bean.
The corresponding code (the same in current cvs and seam 1.2.0)Patch1 in Initialization.java looks like
if ( nameAnnotation!=null && nameAnnotation.value().equals(name) )
| {
| Install install = clazz.getAnnotation(Install.class);
| if ( install.value() )
| {
| className = null;
| }
| }
|
If there is no @Install annotation the value of install is null and hence the npe.
After adding the @Install annotation i getCaused by: org.jboss.seam.RequiredException: In attribute requires non-null value: authorizationBean.protocolTemplate
| at org.jboss.seam.Component.getValueToInject(Component.java:1887)
| at org.jboss.seam.Component.injectAttributes(Component.java:1336)
| at org.jboss.seam.Component.inject(Component.java:1163)
|
when trying to inject my bean with @In.
But @AutoCreate is set and i have added auto-create="true" to the definition
Here is the components.xml fragment
<baz:protocol-template file-name="meinFile" auto-create="true"/>
|
What to do next?
Ciao,
Carsten
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030541#4030541
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030541
More information about the jboss-user
mailing list