Forum LAMS for Tech-Heads - General Forum: Re: Problem using new tool


 
Search: 

2: Re: Problem using new tool
In response to 1 11/17/09 12:18 AM
[ Reply | Forward ]
Hello

Yes the way our spring context files are located changed in LAMS 2.3.  But it would be easier to give advice about what you need to do if we could see the errors you're getting - could you paste them here?

In general if you have a problem have a look at any of the other tools to see how they do things.

Posted by Jun-Dir Liew

3: Re: Re: Problem using new tool
In response to 2 11/17/09 12:14 PM
[ Reply | Forward ]
This is the error shown in the eclipse console

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'socialToolForLAMSService' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:387)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:971)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:880)
at org.lamsfoundation.lams.tool.service.LamsCoreToolService.findToolService(LamsCoreToolService.java:846)
at org.lamsfoundation.lams.tool.service.LamsCoreToolService.getOutputDefinitionsFromTool(LamsCoreToolService.java:381)

Thanks in advance!

Posted by Felipe Peña

4: Re: Re: Problem using new tool
In response to 2 11/17/09 12:15 PM
[ Reply | Forward ]
By the way, my tool is called SocialToolForLAMS.

Posted by Felipe Peña

5: Re: Re: Re: Problem using new tool
In response to 4 11/17/09 03:46 PM
[ Reply | Forward ]
Hi Felipe,

Did you use the tool builder
(http://wiki.lamsfoundation.org/display/lams/Tool+Builder) or did you attempt to build the tool from scratch?

It is definitely a problem with your Spring application context file, but without seeing the full error log and the applicationContext.xml file itself, its hard to say what is missing.

The NoSuchBeanDefined exception usually means exactly as it says. The name you used may not me the same (a typo) or the bean itself did not initalise correctly.

Please attach the entire files and we will be able to help you more

Luke

Posted by Luke Foxton

6: Problem using new tool
In response to 5 11/17/09 06:15 PM
[ Reply | Forward ]
Hi Luke

Firstly, thanks for helping me.

I did use the Tool Builder with the forum tool skeleton.

I attached the lams.log (zipped) and the
socialToolForLAMSApplicationContext.xml file.

Hope it helps.

Greetings.

Posted by Felipe Peña

Attachments:
7: Re: Problem using new tool
In response to 6 11/17/09 06:16 PM
[ Reply | Forward ]
Here's the socialToolForLAMSApplicationContext.xml file.

Posted by Felipe Peña

Attachments:
8: Re: Re: Re: Re: Problem using new tool
In response to 5 11/19/09 09:34 AM
[ Reply | Forward ]
Any help =D?

Posted by Felipe Peña

9: Re: Re: Re: Re: Re: Problem using new tool
In response to 8 11/23/09 11:48 PM
[ Reply | Forward ]
Hi,

Assuming you're using the latest code from CVS, I think the problem is to do with the assumptions we've made for the package names used for all tools.  For example, your tool looks like it uses the following structure:

org.uach.lams.tool.socialToolForLAMS.service.SocialToolForLAMSService

If you look in lams_common/src/java/org/lamsfoundation/lams/beanRefContext.xml, inside the bean context.central is a list of contexts; among them is:

classpath*:org/lamsfoundation/lams/tool/**/*pplicationContext.xml

So basically the problem is that the LAMS core is only including those tools which have their context files under a package that starts with org.lamsfoundation.lams.tool.*

Can you try replacing that classpath line above with this?

classpath*:**/lams/tool/**/*pplicationContext.xml

If that doesn't work, try adding this line below it:

<value>classpath*:org/uach/lams/tool/**/*pplicationContext.xml</value>

Posted by Jun-Dir Liew

10: Re: Re: Re: Re: Re: Re: Problem using new tool
In response to 9 11/24/09 01:37 PM
[ Reply | Forward ]
I did both things, but no success.

I got this error:

Unable to initialize group definition. Group resource name [classpath:/org/lamsfoundation/lams/beanRefContext.xml], factory key [context.central]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'context.central' defined in class path resource [org/lamsfoundation/lams/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.jboss.spring.factory.VFSClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'forumManagerTarget' defined in ZipEntryHandler@1936677334[path=lams.ear/lams-tool-lafrum11.jar/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml context=file:/Users/patrosmania/Documents/Tesis/lams/jboss-5.1.0.GA/server/default/deploy/ real=file:/Users/patrosmania/Documents/Tesis/lams/jboss-5.1.0.GA/server/default/deploy/lams.ear/lams-tool-lafrum11.jar/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.uach.lams.tool.socialToolForLAMS.persistence.TimestampDao] to required type [org.lamsfoundation.lams.tool.forum.persistence.TimestampDao] for property 'timestampDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.uach.lams.tool.socialToolForLAMS.persistence.TimestampDao] to required type [org.lamsfoundation.lams.tool.forum.persistence.TimestampDao] for property 'timestampDao': no matching editors or conversion strategy found

Posted by Felipe Peña

11: Re: Re: Re: Re: Re: Re: Re: Problem using new tool
In response to 10 11/24/09 06:30 PM
[ Reply | Forward ]
Well it's a different error! In this case I think that's progress.

This error is saying that one the forum tool's beans can't start because there is a naming clash with one of the socialToolForLAMS beans. In your applicationContext.xml you might want to try renaming the 'timestampDao' to something more unique, e.g. 'socialToolForLAMSTimestampDao'.

Posted by Jun-Dir Liew

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum