|
|
|
Liferay и META-INF/context.xml
|
|||
|---|---|---|---|
|
#18+
С простыми сервлетами у меня с META-INF/context.xml всё работает. А с портлетами столкнулся с тем что получаю авторorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context Сам META-INF/context.xml автор<?xml version="1.0" encoding="UTF-8"?> <Context docBase="/"> <Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="100" maxIdle="30" maxWait="-1" username="....." password="....." driverClassName="oracle.jdbc.OracleDriver" validationQuery="select 1 from ACCOUNT" accessToUnderlyingConnectionAllowed="true" url="jdbc:oracle:thin:@localhost:1521:XE" /> </Context> application.properties авторdb.datasource=jdbc/test spring-applicationContext.xml автор... <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:application.properties</value> </list> </property> </bean> <jee:jndi-lookup id="dataSource" jndi-name="${db.datasource}" expected-type="javax.sql.DataSource" /> ... далее если пробую добавить автор <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> в web.xml то получаю авторorg.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] а если переименовываю META-INF/context.xml в WEB-INF/applicationContext.xml то тоже самое ПРОГУГЛИЛ ВСЁ ЧТО МОГ ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.05.2012, 06:19:11 |
|
||
|
Liferay и META-INF/context.xml
|
|||
|---|---|---|---|
|
#18+
нужна помошь .... застрял ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.05.2012, 20:46:59 |
|
||
|
Liferay и META-INF/context.xml
|
|||
|---|---|---|---|
|
#18+
Портлеты вещь хитрая, они запускаются не в контексте war, а в приложении самого Liferay. Соответственно, в нем нет jdbc из другого war, и нет файла liferay.war/WEB-INF/applicationContext.xml Попробуй определять datasource на уровне сервера. Spring имеет специальную библиотеку для портлетов, смотри документацию. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.05.2012, 21:08:34 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=37782845&tid=2131855]: |
0ms |
get settings: |
15ms |
get forum list: |
31ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
85ms |
get topic data: |
26ms |
get forum data: |
6ms |
get page messages: |
96ms |
get tp. blocked users: |
3ms |
| others: | 398ms |
| total: | 672ms |

| 0 / 0 |
