Announcement Announcement Module
Collapse
No announcement yet.
Odd build path is incomplete message when editing contexts Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Odd build path is incomplete message when editing contexts

    I am getting odd errors in the applicationContext editor

    Build path is incomplete. Cannot find class file for org.apache.commons.dbcp.BasicDataSource SpringDemo/src/pauls/spring applicationContext.xml line 92

    The dbcp jar file is in the classpath and my tests run fine. It also can't find Hibernate classes, also in the buildpath.

    I get the error on this line:
    Code:
    	<aop:advisor advice-ref="txAdvice"
    			pointcut-ref="serviceMethods" />
    Here is my context file:

    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:p="http://www.springframework.org/schema/p"
    	xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    	 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    
    
    
    	<bean name="personBusinessLogic"
    		class="pauls.businesslogic.PersonBusinessLogicImpl">
    	</bean>
    
    
    	<bean name="personDataAccess"
    		class="pauls.dataaccess.PersonDataAccessHibernateImpl"
    		p:session-factory-ref="sessionFactory">
    
    	</bean>
    
    	<bean name="personService"
    		class="pauls.service.PersonServiceImpl">
    		<property name="personBusinessLogic">
    			<ref bean="personBusinessLogic" />
    		</property>
    
    		<property name="personDataAccess">
    			<ref bean="personDataAccess" />
    		</property>
    
    		<property name="fudgeFactor">
    			<value>${fudgeFactor}</value>
    		</property>
    
    	</bean>
    
    
    
    	<bean
    		class='org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'>
    		<property name="locations">
    			<list>
    				<value>classpath:database.properties</value>
    				<value>classpath:application.properties</value>
    			</list>
    		</property>
    	</bean>
    
    	<bean id="sessionFactory"
    		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    		<property name="dataSource" ref="dataSource" />
    		<property name="mappingResources">
    			<list>
    				<value>pauls/model/Person.hbm.xml</value>
    				<value>pauls/model/Address.hbm.xml</value>
    			</list>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">
    					${hibernate.dialect}
    				</prop>
    
    				<prop key="hibernate.hbm2ddl.auto">
    					${hibernate.hbm2ddl.auto}
    				</prop>
    				<prop key="hibernate.show_sql">true</prop>
    				<prop key="connection.pool_size">1000</prop>
    				<prop key="hibernate.jdbc.use_get_generated_keys">
    					${hibernate.jdbc.use_get_generated_keys}
    				</prop>
    
    			</props>
    		</property>
    	</bean>
    	
    	<tx:advice id="txAdvice" transaction-manager="transactionManager">
    		<tx:attributes>
    			<tx:method name="save*" />
    			<tx:method name="*" read-only="true" />
    		</tx:attributes>
    	</tx:advice>
    
    	<!-- ensure that the above transactional advice runs for any execution
    		of an operation defined by the genericDatabaseService interface -->
    	<aop:config>
    		<aop:pointcut id="serviceMethods"
    			expression="execution(* pauls.service.PersonService.*(..))" />
    		<aop:advisor advice-ref="txAdvice"
    			pointcut-ref="serviceMethods" />
    	</aop:config>
    	
    
    
    	<bean id="dataSource"
    		class="org.apache.commons.dbcp.BasicDataSource"
    		destroy-method="close">
    		<property name="driverClassName"
    			value="${database.jdbc.driverClassName}" />
    		<property name="url" value="${database.url}" />
    		<property name="username" value="${database.username}" />
    		<property name="password" value="${database.password}" />
    
    		<property name="initialSize">
    			<value>100</value>
    		</property>
    
    		<property name="maxActive">
    			<value>0</value>
    		</property>
    
    		<property name="maxWait">
    			<value>5000</value>
    		</property>
    
    	</bean>
    	
    	
    	<bean id="transactionManager"
    		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="sessionFactory">
    			<ref local="sessionFactory" />
    		</property>
    	</bean>
    	
    
    </beans>

  • #2
    Hi,

    I just tried it with having commons-dbcp, commons-pool, hiberante3 and spring jars on eclipse' classpath (external jars). Everything works fine. I get the annotations on the personService bean. Could be that I don't get some of the dependencies your impls use; I just created empty classes and interfaces for the names you specified in your app context file.

    Can you share your .classpath?

    Thanks

    Christian

    Comment


    • #3
      Originally posted by cdupuis View Post
      Hi,

      I just tried it with having commons-dbcp, commons-pool, hiberante3 and spring jars on eclipse' classpath (external jars). Everything works fine. I get the annotations on the personService bean. Could be that I don't get some of the dependencies your impls use; I just created empty classes and interfaces for the names you specified in your app context file.

      Can you share your .classpath?

      Thanks

      Christian
      Oddly the errors just disappeared and have not reappeared, this with no changes to the build path, so I can't recreate it now....

      Comment


      • #4
        Originally posted by Paul Newport View Post
        Oddly the errors just disappeared and have not reappeared, this with no changes to the build path, so I can't recreate it now....
        Update - it seems to happen if I have no network connection......

        Comment


        • #5
          Hi,
          I got the similar issue with class path for context.xml configuration. Then I found that there was a jar file in project class path which was removed that from physical location. When I updated my project class path by removing the invalid jar file, the build was successful and errors were gone.

          Comment

          Working...
          X