Announcement Announcement Module
Collapse
No announcement yet.
spring error when deploying to jboss 5 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring error when deploying to jboss 5

    Code:
    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unnamed bean definition specifies neither 'class' nor 'parent' nor 'factory-bean' - can't generate bean name
    Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml]

    Code:
    <?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:tx="http://www.springframework.org/schema/tx"
           xmlns:jee="http://www.springframework.org/schema/jee"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
           http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
    
        
        <bean>
    		<jee:jndi-lookup id="dataSource" jndi-name="java:/hrdb"  />
    	</bean>
    	
    	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="jpaVendorAdapter">
                <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    				<property name="showSql" value="true"/>
                    <property name="generateDdl" value="false"/>
                    <property name="databasePlatform" value="org.hibernate.dialect.SQLServerDialect"/>
                </bean>
            </property>
        </bean>
    
        <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
            <property name="entityManagerFactory" ref="entityManagerFactory"/>
            <property name="dataSource" ref="dataSource"/>
        </bean>
    
        <tx:annotation-driven/>
    	
    
        <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
            <property name="host" value="${mail.host}"/>
        </bean>
    
    	<!-- Serices -->
        <bean id="personService" class="hrdb.service.impl.PersonServiceImpl">
    		<property name="personDao" ref="personDAO"/>
    	</bean>
        
    	<bean id="emailService" class="hrdb.service.impl.EmailServiceImpl">
    		<property name="emailDao" ref="emailDAO"/>
    	</bean>
        
    	<bean id="employmentService" class="hrdb.service.impl.EmploymentServiceImpl">
    		<property name="employmentDao" ref="employmentDAO"/>
    	</bean>
    	
    	<bean id="otherIdService" class="hrdb.service.impl.OtherIdServiceImpl">
    		<property name="otherIdDao" ref="otherIdDAO"/>
    	</bean>
    	
    	<bean id="roleService" class="hrdb.service.impl.RoleServiceImpl">
    		<property name="roleDao" ref="roleDAO"/>
    	</bean>
    	
    	<!-- Data Access Objects -->
        <bean id="personDAO" class="hrdb.dao.impl.PersonDaoImpl"/>
        <bean id="emailDAO" class="hrdb.dao.impl.EmailDaoImpl"/>
        <bean id="employmentDAO" class="hrdb.dao.impl.EmploymentDaoImpl"/>
        <bean id="otherIdDAO" class="hrdb.dao.impl.OtherIdDaoImpl"/>
        <bean id="roleDAO" class="hrdb.dao.impl.RoleDaoImpl"/>
        
        
    </beans>

    anyone see anything wrong with my applicationContext that would generate this error?

  • #2
    figured it out...

    its just - <jee:jndi-lookup id="dataSource" jndi-name="java:/hrdb" />

    you dont have to wrap it in bean tags.

    Comment

    Working...
    X