留言板

'NameNotFoundException' in m6/b1/b2 but NO problem in liferay 6.2.0m3

Baogang Liu,修改在10 年前。

'NameNotFoundException' in m6/b1/b2 but NO problem in liferay 6.2.0m3

New Member 帖子: 10 加入日期: 13-8-15 最近的帖子
I am testing "portlet app of broadleaf ecommerce" in lifefay. Broadleaf's resource is configured in ./conf/context.xml of tomcat, as the last section of this post.

When use liferay-portal-tomcat-6.2.0-ce-m3-20121226162932032.zip, there is no problem with jndi. But when use 6.2.0m6 or b1/b2, there is error log as below. what is the change from liferay 6.2.0 m3 to m6/b1/b2 on the jndi definition? How to define it so that a portlet app in liferay m6/b1/b2 can access that jndi succesfully?

"Portlet app of broadleaf ecommerce" is at https://github.com/BroadleafCommerce/DemoSite-Portlet. For the problem in this post, I also posted it on broadleaf forum http://forum.broadleafcommerce.org/viewtopic.php?f=14&t=2108&p=5992#p5992.

=======error log=======
"Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blMergedDataSources' defined in resource loaded from byte array: Cannot resolve reference to bean 'webSecureDS' while setting bean property 'sourceMap' with key [TypedStringValue: value [jdbc/webSecure], target type ]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSecureDS': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/secure] is not bound in this Context. Unable to find jdbc.

Caused by: javax.naming.NameNotFoundException: Name [jdbc/secure] is not bound in this Context. Unable to find .
at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
at com.liferay.portal.security.pacl.jndi.SchemeAwareContextWrapper.lookup(SchemeAwareContextWrapper.java:200)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 87 more
"
=======Resource configured in ./conf/context.xml of tomcat========
<Resource name="jdbc/storage"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="SELECT 1"
timeBetweenEvictionRunsMillis="30000"
maxActive="15"
maxIdle="10"
minIdle="5"
removeAbandonedTimeout="60"
removeAbandoned="false"
logAbandoned="true"
minEvictableIdleTimeMillis="30000"
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
username="postgres"
password="H3hMvyrOm4Kx7fVqiT8S"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/broadleaf"/>

<Resource name="jdbc/secure"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="SELECT 1"
timeBetweenEvictionRunsMillis="30000"
maxActive="15"
maxIdle="10"
minIdle="5"
removeAbandonedTimeout="60"
removeAbandoned="false"
logAbandoned="true"
minEvictableIdleTimeMillis="30000"
jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer"
username="postgres"
password="H3hMvyrOm4Kx7fVqiT8S"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://localhost:5432/broadleaf"/>
Baogang Liu,修改在10 年前。

RE: 'NameNotFoundException' in m6/b1/b2 but NO problem in liferay 6.2.0m3

New Member 帖子: 10 加入日期: 13-8-15 最近的帖子
Below post answered this question. The method is "disable Liferay security manager in portal-ext.properties, adding: portal.security.manager.strategy=none".

http://www.liferay.com/zh/community/forums/-/message_boards/message/14769751 Using a second JNDI database with a portlet.