Community Updates, April 19 - April 26
by JBoss Community
===============================================================
Community Updates for April 19 - April 26
===============================================================
You haven't set a status update. Log in and set your status at: https://community.jboss.org.
Your Content
* testing the new list server [https://community.jboss.org/thread/127309]
was viewed 13,182 times and replied to by 3 people
* No Link to Jboss Nukes [https://community.jboss.org/thread/90785]
was viewed 111,266 times and replied to by 3 people
Your Connections - Activity by people you are following
You don't have any connections yet. Find people and connect! [https://community.jboss.org/people/]
Popular Content - The content that is most viewed and participated in
* UsingMod_proxyWithJBoss [https://community.jboss.org/docs/DOC-12529]
* Open Session in View [https://community.jboss.org/docs/DOC-13954]
* ConfigDataSources [https://community.jboss.org/docs/DOC-9328]
* JBoss Developer Studio 4 is now available for free [https://community.jboss.org/community/tools/blog/2011/03/22/jboss-develop...]
* Spring and JBoss AS7 (Part 1) : Getting Started [https://community.jboss.org/blogs/mariusb/2011/07/13/spring-and-jboss-as7...]
* m2e(clipse)-wtp 0.15.0 : New and Noteworthy [https://community.jboss.org/community/tools/blog/2012/02/03/m2eclipse-wtp...]
* Re: a4j:support inside h:inputText [https://community.jboss.org/message/51024#51024]
* Re: HTTPS on JBoss AS 7 - truststore configuration [https://community.jboss.org/message/731416#731416]
* Re: java.net.BindException: Address already in use: JVM_Bind [https://community.jboss.org/message/538913#538913]
Tips and tricks - Remember Who, not Where
Have you ever forgotten the location of a file, but remembered who worked on it? With Community you can easily get to all of the content that someone has worked on. Just navigate to their profile and go to their Stuff tab. Inside that tab you can filter by the type of content, like document, discussion, task, or blog post.
Not interested in these emails anymore, or want to change how often they come? Update your email preferences by visiting: https://community.jboss.org/user-notification-preferences!input.jspa
12 years
[JBoss AS 7 Development] - Spring2.5 Component Scan Not Working in JB 7AS
by Deepak S
Deepak S [https://community.jboss.org/people/deepusrp] created the discussion
"Spring2.5 Component Scan Not Working in JB 7AS"
To view the discussion, visit: https://community.jboss.org/message/729409#729409
--------------------------------------------------------------
Hello Folks,
I'm using JBoss 7 AS(jboss-as-7.1.0.Final) as my server.
I have 2 questions...
1. I'm using Eclipse Helios SR2. I'm not able to get the proper pluging to have JBOSS AS as my server in eclipse.
I got several sites in net for the plugin, but when i tried to install it says conflicting, and it closes.
Can i add Jboss 7 AS to my eclipse ?
2. I'm using spring 2.5, JSF and hibernate application.
The problem is i have used annotation for component and repository but it is not getting initialized. Basically spring component scanner is not working.
Please find the code snippets:
Web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="main.controllerbeans" />
<context:annotation-config />
<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list><value>/WEB-INF/configuration.properties</value></list>
</property>
</bean>
<!-- IMPORTING HIBERNATE SETTINGS -->
<import resource="/db-config.xml"/>
Component scan is not working... it seems
db-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass">
<value>${jdbc.driver.className}</value>
</property>
<property name="jdbcUrl">
<value>${jdbc.url}</value>
</property>
<property name="user">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<!-- <property name="packagesToScan" value="main.dbentities" /> -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.hibernate.dialect}</prop>
<prop key="hibernate.show_sql">false</prop>
</props>
</property>
<property name="packagesToScan" value="org.adit.spring.hibernate.entity" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<context:annotation-config />
<tx:annotation-driven />
</beans>
faces-config.xml
<?xml version="1.0"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>
NotificationBean.java
import java.io.Serializable;
import javax.faces.bean.RequestScoped;
import main.dao.NotificationDAO;
import main.dbentities.Notification;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component("notificationBean")
@RequestScoped
public class NotificationBean implements Serializable {
private static final long serialVersionUID = -3637354326738964505L;
@Autowired
Notification notification;
@Autowired
public NotificationDAO notificationDao;
public NotificationBean() {
notification = new Notification();
//notificationDao = new NotificationDaoImpl();
}
public void persist(){
System.out.println("Persist Method");
notification.setUserId(111);
notification.setPriorityId(1);
notificationDao.save(notification);
}
In my xhtml page i have a input text box:
<h:inputText id="englishMessageTitle" value="#{notificationBean.notification.notificationTitleEng}" />
And there is submit button:
<h:commandButton class="btn_empty" id="submit" value="#{msg['CreateNotification.Submit']}" action="#{notificationBean.persist}" />
I'm getting the follwoing exception:
javax.el.PropertyNotFoundException: /xhtml/postmessage.xhtml @36,111 value="#{notificationBean.notification.notificationTitleEng}": Target Unreachable, identifier 'notificationBean' resolved to null
at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1030)
at javax.faces.component.UIInput.validate(UIInput.java:960)
at javax.faces.component.UIInput.executeValidate(UIInput.java:1233)
at javax.faces.component.UIInput.processValidators(UIInput.java:698)
Its unable to resolve the bean notificationBean
Following are the Jars that i have in my web-inf/lib:
c3p0-0.9.1.2.jar
commons-collections-3.2.1.jar
commons-dbcp-1.4.jar
dom4j-1.6.1.jar
hibernate-3.2.1.ga.jar
hibernate-annotations-3.4.0.GA.jar
hibernate-commons-annotations-3.1.0.GA.jar
hibernate-core-3.3.2.GA.jar
jboss-el-2.0.1.GA.jar
jsf-api.jar
jsf-impl.jar
jsp-2.1-6.0.2.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar
mysql-connector-java-3.0.17-ga-bin.jar
org.springframework.context-2.5.6.SEC01.jar
org.springframework.core-2.5.6.SEC01.jar
org.springframework.transaction-2.5.6.A.jar
persistence-api-1.0.jar
spring-2.5.6.SEC01.jar
spring-beans-2.5.6.SEC01.jar
Please let me know what is the problem, and let me know if u need any other information.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/729409#729409]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years