On 5/29/07, Jason Thrasher <[EMAIL PROTECTED]> wrote:

Wow, that produced a huge file.  With some grepping, it looked like Spring
1.2.6 and 2.0.5 were being used, but Maven was choosing to use 2.0.5 over
1.x, so it looked OK.  It was easier to tell in the WAR, where I only found
the spring-2.0.5.jar... so I guess I only have one configured.
thanks Matt!

Upon more digging, it turns out that using Struts with the Spring plugin
uses autowire by "name" by default.  More info here:
http://struts.apache.org/2.x/docs/spring-plugin.html
        --->    "The framework enables "autowiring" by default"
which is what I was seeing.

Does that mean that all DAO and Service objects will auto-wire as well
though?  It's not clear to me.

No, it just means that if you have dependencies (i.e.
setUserManager()) in an Action, it should autowire its dependencies.
It only applies to Struts classes AFAIK.

Matt


regards,
Jason


mraible wrote:
>
> If you run "mvn -X | tee mvn.log" and open mvn.log when it's done, is
> another version of Spring getting included in your classpath?  You
> could also run "mvn package" and check the resulting WAR for JARs in
> WEB-INF/lib. As far as autowiring, you can read about Struts 2's
> Spring integration at the following URL:
>
> http://cwiki.apache.org/WW/spring.html
>
> Matt
>
> On 5/29/07, thrasher <[EMAIL PROTECTED]> wrote:
>>
>> I'm still having an issue with this.  It's definitely Spring 2.0.5 in the
>> new
>> M5 version, and my project is picking up the change from AppFuse.  Thanks
>> for the check though Hiugong.
>>
>> After fiddling with the Spring applicationContext-*.xml files, I figured
>> out
>> that there's some kind of auto-wiring happening when running the web
>> application in either jetty or tomcat.  I believe it's Spring autowiring
>> using the wrong beans as arguments to properties of other beans, based on
>> similar names.  I can't figure out where the autowire is configured
>> though... I didn't think autowire was default for Spring.
>>
>> -Jason
>>
>>
>>
>> hiugong.gwok wrote:
>> >
>> > XmlReaderContext.registerWithGeneratedName is introduced since spring
>> > 2.0.3, you might wanna check if you had a dependency on a prior
>> version.
>> > AppFuse M5 uses spring 2.0.5.
>> > Check your pom.xml for this:
>> > <spring.version>2.0.5</spring.version>
>> >
>> >
>> > thrasher wrote:
>> >>
>> >> I've upgraded an AppFuse 2.0-M4 project to M5 (modular struts2), and
>> am
>> >> running into a load of spring-related problems that don't seem to make
>> >> sense.  Spring doesn't seem to be configured properly as I'm getting
>> >> NoSuchMethodErrors.
>> >>
>> >> When running "mvn clean test" in the web module I get this error from
>> my
>> >> tests regarding
>> >> appfuse-service-2.0-m5.jar!/applicationContext-service.xml:
>> >>
>> >> [tft] ERROR [main] ContextLoader.initWebApplicationContext(205) |
>> Context
>> >> initialization failed
>> >> org.springframework.beans.factory.BeanDefinitionStoreException:
>> >> Unexpected exception parsing XML document from URL
>> >>
>> 
[jar:file:/C:/Documents%20and%20Settings/Jason%20Thrasher/.m2/repository/org/appfuse/appfuse-service/2.0-m5/appfuse-service-2.0-m5.jar!/applicationContext-service.xml];
>> >> nested exception is java.lang.NoSuchMethodError:
>> >>
>> 
org.springframework.beans.factory.xml.XmlReaderContext.registerWithGeneratedName(Lorg/springframework/beans/factory/config/BeanDefinition;)Ljava/lang/String;
>> >> Caused by:
>> >> java.lang.NoSuchMethodError:
>> >>
>> 
org.springframework.beans.factory.xml.XmlReaderContext.registerWithGeneratedName(Lorg/springframework/beans/factory/config/BeanDefinition;)Ljava/lang/String;
>> >>
>> >> From what I can see, there's nothing wrong with the 2.0-M5
>> >> applicationContext-service.xml file, so it seems there's a dependancy
>> >> issue.
>> >>
>> >> Here's a sample error message when attempting "mvn jetty:run" in the
>> web
>> >> module (after deleting my tests and just trying to move forward):
>> >>
>> >> [ERROR] FATAL ERROR
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO]
>> >>
>> 
org.springframework.core.CollectionFactory.createConcurrentMapIfPossible(I)Ljava/util/Map;
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO] Trace
>> >> java.lang.NoSuchMethodError:
>> >>
>> 
org.springframework.core.CollectionFactory.createConcurrentMapIfPossible(I)Ljava/util/Map;
>> >>
>> >>
>> >> I was getting errors like this in my "core" module before I deleted my
>> >> Maven2 repo's groupId directory.  When I did that, everything started
>> >> working in core (compile and tests to make my jar).  I'm not having
>> such
>> >> luck with the "web" module though.
>> >>
>> >> Is anyone else running into this problem, or do you know what it might
>> >> be?
>> >>
>> >> thanks,
>> >> Jason
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Spring-errors-in-2.0-M5-tf3824941s2369.html#a10850209
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/Spring-errors-in-2.0-M5-tf3824941s2369.html#a10867678
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to