 |
|
 |
 |
|
 |
 |
| Author |
Message |
|
|
Post subject: What ways java to access beans in spring applicationcontext
Posted: Feb 22, 2010 - 07:51 PM
|
|
Registered Member


Joined: Oct 15, 2005
Posts: 173
|
|
hi dear all
1 - //used to be ok in previous versions to version 8
ApplicationContext applicationContext = new FileSystemXmlApplicationContext(new String ("src/applicationContext.xml"));
error
javax.servlet.ServletException: javax.faces.FacesException: Cant instantiate class: component1.ItemHandler.. IOException parsing XML document from file [D:\JBoss_GR\jboss-4.2.2.GA\bin\src\applicationContext.xml]; nested exception is java.io.FileNotFoundException: src\applicationContext.xml (The system cannot find the path specified)
2 - how to access in jave code the springDAOManager in next applicationContext.xml
<beans>
<bean id="husbandDAOService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="proxyTargetClass"><value>true</value></property><property name="transactionAttributes"></property>
<property name="target"><ref local="springDAOManager"/></property></bean>
</beans>
I tried next but not working for mismatch
SpringDAOManager springDAOManager = (SpringDAOManager)applicationContext.getBean("husbandDAOService"); // not ok
Amir |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: What ways java to access beans in spring applicationcon
Posted: Feb 23, 2010 - 05:24 AM
|
|
Registered Member

Joined: May 18, 2009
Posts: 1532
|
|
Amir,
Can explain in detail what exactly you are trying to do?
| Quote: |
used to be ok in previous versions to version 8
|
Are you working on a project that is imported from an earlier version of MyEclipse?
Also, can you list out the steps to replicate the above issue? |
_________________ Shalini
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 23, 2010 - 05:40 AM
|
|
Registered Member


Joined: Oct 15, 2005
Posts: 173
|
|
hi dear
1 - yes I use the projects from earlier versions
2 - I just try to re run those projects on version 8.
3 - I started with the jsf spring hibernte. I used to get the applicationContext.xml successfuly but now error thrown
ApplicationContext applicationContext = new FileSystemXmlApplicationContext(new String ("src/applicationContext.xml"));
error
error
javax.servlet.ServletException: javax.faces.FacesException: Cant instantiate class: component1.ItemHandler.. IOException parsing XML document from file [D:\JBoss_GR\jboss-4.2.2.GA\bin\src\applicationContext.xml]; nested exception is java.io.FileNotFoundException: src\applicationContext.xml (The system cannot find the path specified)
4 - more important spring question is
Hhow to access in jave code the springDAOManager in next applicationContext.xml
<beans>
<bean id="husbandDAOService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="proxyTargetClass"><value>true</value></property><property name="transactionAttributes"></property>
<property name="target"><ref local="springDAOManager"/></property></bean>
</beans>
I tried next but not working for mismatch. srurely it is as
a - SpringDAOManager is not husbandDAOService
b - husbandDAOService has no corrispondent bean. so how to do that thankfully
SpringDAOManager springDAOManager = (SpringDAOManager)applicationContext.getBean("husbandDAOService"); // not ok
Amir |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Feb 24, 2010 - 10:36 AM
|
|
Registered Member

Joined: May 18, 2009
Posts: 1532
|
|
|
_________________ Shalini
MyEclipse Support
|
| |
|
|
|
 |
|
|
| |
|
|
 |
|
 |
|
|
|
 |