You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by volnei Granado Munhoz <vo...@unopar.br> on 2007/12/13 11:55:23 UTC
Struts + Xwork + xwork-conversion.properties = problem on start app
Hi, i'm using xwork 2.1 with struts 2.1 and Guice to Inject my dependencies.
My struts.xml contains the follow line
<constant name="struts.objectFactory" value="guice" />
and when i start my servlet container the NPE is throwed and aplication is
broken...
When remove or comment the xwork-conversion.properties this runs normaly.
Here is the stakTrace:
java.lang.NullPointerException
at
com.opensymphony.xwork2.conversion.impl.XWorkConverter.createTypeConverter(X
Wor kConverter.java:729)
at
com.opensymphony.xwork2.conversion.impl.XWorkConverter.loadConversionPropert
ies (XWorkConverter.java:756)
at com.opensymphony.xwork2.conversion.impl.XWorkConverter.<init>(XWorkConver
ter.java:184)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sor Impl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
tor AccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:388)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(Contai
ner Impl.java:431)
at
com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.jav
a:4 46)
at
com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:4
8)
at
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(Container
Imp l.java:288)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:400)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(Contai
ner Impl.java:431)
at
com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.jav
a:4 46)
at
com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:4
8)
at
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(Container
Imp l.java:288)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:400)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(Contai
ner Impl.java:431)
at
com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.jav
a:4 46)
at
com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:4
8)
at
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(Container
Imp l.java:288)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:400)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.ja
va: 98)
at
com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java
:48 9)
at
com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java
:48 7)
at
com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.jav
a:5 42)
at
com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java
:48 6)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapCont
ain er(DefaultConfiguration.java:243)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(Def
aul tConfiguration.java:190)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rat ionManager.java:55)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatche
r.j ava:373)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:426)
at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:21
1)
at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplic
ati onHandler.java:310)
at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContex
t.j ava:509)
at org.mortbay.util.Container.start(Container.java:72)
at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
at org.mortbay.util.Container.start(Container.java:72)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
Any solutions?? Thanks!!
ps. Sorry for my poor English
--
Esta mensagem foi verificada pelo sistema de antiv�rus e
acredita-se estar livre de perigo.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Guice ObjectFactory injection into XWorkConverter problem
Posted by volnei Granado Munhoz <vo...@unopar.br>.
Hi, i'm using xwork 2.1 with struts 2.1 (but this occours in all versions)
and Guice to Inject my dependencies.
My struts.xml contains the follow line
<constant name="struts.objectFactory" value="guice" />
and when i start my servlet container the NPE is throwed and aplication is
broken...
When remove or comment the xwork-conversion.properties this runs normaly.
Thanks
--
Esta mensagem foi verificada pelo sistema de antiv�rus e
acredita-se estar livre de perigo.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RES: RES: Guice ObjectFactory injection into XWorkConverter problem (was Re: Struts + Xwork + xwork-conversion.properties)
Posted by volnei Granado Munhoz <vo...@unopar.br>.
Hi Jeromy, the same error happen when use struts 2.0.11 ou 2.0.9.
Thanks!
-----Mensagem original-----
De: Jeromy Evans [mailto:jeromy.evans@blueskyminds.com.au]
Enviada em: sexta-feira, 14 de dezembro de 2007 19:59
Para: Struts Users Mailing List
Assunto: Re: RES: Guice ObjectFactory injection into XWorkConverter problem
(was Re: Struts + Xwork + xwork-conversion.properties)
Sorry, that's what I meant - the guice plugin may not be setup for 2.1
correctly (as in a bug in the plugin).
I'll take a look at it myself when I get a chance too.
volnei Granado Munhoz wrote:
> Hi Jeromy,
>
> I think this is not a configuration problem (probably a Xwork|Struts
> bug), my object factory works fine when I don't use
> xwork-conversion.properties, it's inject all of my objects except the
converter objects.
>
> You can show me your configs??
>
> Thanks...
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
--
Esta mensagem foi verificada pelo sistema de antivírus e acredita-se estar
livre de perigo.
--
Esta mensagem foi verificada pelo sistema de antivírus e
acredita-se estar livre de perigo.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: RES: Guice ObjectFactory injection into XWorkConverter problem
(was Re: Struts + Xwork + xwork-conversion.properties)
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Sorry, that's what I meant - the guice plugin may not be setup for 2.1
correctly (as in a bug in the plugin).
I'll take a look at it myself when I get a chance too.
volnei Granado Munhoz wrote:
> Hi Jeromy,
>
> I think this is not a configuration problem (probably a Xwork|Struts bug),
> my object factory works fine when I don't use xwork-conversion.properties,
> it's inject all of my objects except the converter objects.
>
> You can show me your configs??
>
> Thanks...
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RES: Guice ObjectFactory injection into XWorkConverter problem (was Re: Struts + Xwork + xwork-conversion.properties)
Posted by volnei Granado Munhoz <vo...@unopar.br>.
Hi Jeromy,
I think this is not a configuration problem (probably a Xwork|Struts bug),
my object factory works fine when I don't use xwork-conversion.properties,
it's inject all of my objects except the converter objects.
You can show me your configs??
Thanks...
-----Mensagem original-----
De: Jeromy Evans [mailto:jeromy.evans@blueskyminds.com.au]
Enviada em: sexta-feira, 14 de dezembro de 2007 08:11
Para: Struts Users Mailing List
Assunto: Re: Guice ObjectFactory injection into XWorkConverter problem (was
Re: Struts + Xwork + xwork-conversion.properties)
volnei Granado Munhoz wrote:
> Hi, i'm using xwork 2.1 with struts 2.1 and Guice to Inject my
dependencies.
>
>
> My struts.xml contains the follow line
>
> <constant name="struts.objectFactory" value="guice" />
>
> and when i start my servlet container the NPE is throwed and
> aplication is broken...
>
> When remove or comment the xwork-conversion.properties this runs normaly.
>
>
> Here is the stakTrace:
>
> java.lang.NullPointerException
> at
> com.opensymphony.xwork2.conversion.impl.XWorkConverter.createTypeConve
> rter(X
> Wor kConverter.java:729)
>
That null pointer exception implies the object factory is null or was not
injected into XWorkConverter.
I'm surprised you've not received any prior exceptions so I can't explain
why the objectFactory is not being injected.
Perhaps check that you have the correct version of the struts2-guice-plugin
deployed. It's possible it's not setup correctly for 2.1.
I use Guice in an app in 2.1, but don't use xwork-conversion.properties
directly. Maybe someone else can confirm.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
--
Esta mensagem foi verificada pelo sistema de antivírus e acredita-se estar
livre de perigo.
--
Esta mensagem foi verificada pelo sistema de antivírus e
acredita-se estar livre de perigo.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Guice ObjectFactory injection into XWorkConverter problem (was
Re: Struts + Xwork + xwork-conversion.properties)
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
volnei Granado Munhoz wrote:
> Hi, i'm using xwork 2.1 with struts 2.1 and Guice to Inject my dependencies.
>
>
> My struts.xml contains the follow line
>
> <constant name="struts.objectFactory" value="guice" />
>
> and when i start my servlet container the NPE is throwed and aplication is
> broken...
>
> When remove or comment the xwork-conversion.properties this runs normaly.
>
>
> Here is the stakTrace:
>
> java.lang.NullPointerException
> at
> com.opensymphony.xwork2.conversion.impl.XWorkConverter.createTypeConverter(X
> Wor kConverter.java:729)
>
That null pointer exception implies the object factory is null or was
not injected into XWorkConverter.
I'm surprised you've not received any prior exceptions so I can't
explain why the objectFactory is not being injected.
Perhaps check that you have the correct version of the
struts2-guice-plugin deployed. It's possible it's not setup correctly
for 2.1.
I use Guice in an app in 2.1, but don't use xwork-conversion.properties
directly. Maybe someone else can confirm.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Struts + Xwork + xwork-conversion.properties
Posted by volnei Granado Munhoz <vo...@unopar.br>.
Hi, i'm using xwork 2.1 with struts 2.1 and Guice to Inject my dependencies.
My struts.xml contains the follow line
<constant name="struts.objectFactory" value="guice" />
and when i start my servlet container the NPE is throwed and aplication is
broken...
When remove or comment the xwork-conversion.properties this runs normaly.
Here is the stakTrace:
java.lang.NullPointerException
at
com.opensymphony.xwork2.conversion.impl.XWorkConverter.createTypeConverter(X
Wor kConverter.java:729)
at
com.opensymphony.xwork2.conversion.impl.XWorkConverter.loadConversionPropert
ies (XWorkConverter.java:756)
at com.opensymphony.xwork2.conversion.impl.XWorkConverter.<init>(XWorkConver
ter.java:184)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sor Impl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
tor AccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:388)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(Contai
ner Impl.java:431)
at
com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.jav
a:4 46)
at
com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:4
8)
at
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(Container
Imp l.java:288)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:400)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(Contai
ner Impl.java:431)
at
com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.jav
a:4 46)
at
com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:4
8)
at
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(Container
Imp l.java:288)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:400)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(Contai
ner Impl.java:431)
at
com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.jav
a:4 46)
at
com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:4
8)
at
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(Container
Imp l.java:288)
at
com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(C
ont ainerImpl.java:400)
at
com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.ja
va: 211)
at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:49)
at
com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.ja
va: 98)
at
com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java
:48 9)
at
com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java
:48 7)
at
com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.jav
a:5 42)
at
com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java
:48 6)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapCont
ain er(DefaultConfiguration.java:243)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(Def
aul tConfiguration.java:190)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(Configu
rat ionManager.java:55)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatche
r.j ava:373)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:426)
at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:21
1)
at org.mortbay.jetty.servlet.FilterHolder.start(FilterHolder.java:71)
at
org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplic
ati onHandler.java:310)
at
org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContex
t.j ava:509)
at org.mortbay.util.Container.start(Container.java:72)
at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
at org.mortbay.util.Container.start(Container.java:72)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:282)
at com.iw.plugins.jettyrunner.PluginRunner.launch(PluginRunner.java:104)
at com.iw.plugins.jettyrunner.PluginRunner.main(PluginRunner.java:75)
Any solutions?? Thanks!!
ps. Sorry for my poor English
--
Esta mensagem foi verificada pelo sistema de antivmrus e acredita-se estar
livre de perigo.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
--
Esta mensagem foi verificada pelo sistema de antiv�rus e
acredita-se estar livre de perigo.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org