Foros de discusión

fb-itegration invluences other portlets jndi?!

Daniel Niklas, modificado hace 11 años.

fb-itegration invluences other portlets jndi?!

Junior Member Mensajes: 46 Fecha de incorporación: 8/11/10 Mensajes recientes
Hi,

i have problems using fb-integration-portlets. After successful deployment of the fb-integration-war (https://github.com/juliocamarero/facebook-liferay-integration/blob/master/pluginsSDK/dist/fb-integration-portlet-6.1.0.1.war?raw=true), i'm getting problems in another Portlet with JNDI.

It sounds strange and i have no idea whats going on here!? But after the undeployment of the fb-integration-portlet, the other porltet is wokring fine.
In the other Portlet i'm looking up a datasource via JNDI: "java:comp/env/jdbc/xxxDB". With deployed fb-integration-portlet i cannot lookup "java:comp/env".
The portlet uses JPA/Hibernate; Hibernate produces the following statcktrace:

12:41:45,823 ERROR [http-bio-8080-exec-10][render_portlet_jsp:154] javax.naming.NameNotFoundException: Name [java:comp/env/jdbc/xxxDB] is not bound in this Context. Unable to find [java:comp].
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 javax.naming.InitialContext.lookup(InitialContext.java:409)
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:51)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:78)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at dniklas.guestbook.web.bean.EntityManagerFactoryBean.init(EntityManagerFactoryBean.java:20)
at com.sun.faces.vendor.WebContainerInjectionProvider.invokeAnnotatedMethod(WebContainerInjectionProvider.java:117)
at com.sun.faces.vendor.WebContainerInjectionProvider.invokePostConstruct(WebContainerInjectionProvider.java:99)
at com.sun.faces.mgbean.BeanBuilder.invokePostConstruct(BeanBuilder.java:223)
at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:105)


Any hints / ideas whats going on here?

Best regards
Daniel Niklas
thumbnail
Julio Camarero, modificado hace 10 años.

RE: fb-itegration invluences other portlets jndi?!

Liferay Legend Mensajes: 1668 Fecha de incorporación: 15/07/08 Mensajes recientes
Hi Daniel,

do you still have this issue? The fb-integration portlets are very simple portelts which only display information from facebook based on some configuration settings. They don't have any specific database configuration so I don't understand how can they affect to JNDI....
Daniel Niklas, modificado hace 10 años.

RE: fb-itegration invluences other portlets jndi?!

Junior Member Mensajes: 46 Fecha de incorporación: 8/11/10 Mensajes recientes
Hi Julio,

yes, i still have this issue and i don't have an idea whats going on here.
I have a simple test portlet to reproduce this issue. This portlet makes a jndi-lookup:

InitialContext initialContext = new InitialContext();
Context compEnv = (Context) initialContext.lookup("java:comp/env");
DataSource ds = (DataSource) compEnv.lookup("jdbc/liferayDB");
ds.getConnection();


This is not working, when fb-integration-war is deployed:

]Naming-Exception while lookup for java:comp/env/liferayDB
javax.naming.NameNotFoundException: Name [java:comp/env] is not bound in this Context. Unable to find [java:comp].
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 javax.naming.InitialContext.lookup(InitialContext.java:409)
at lab.portlet.simpleportlet.JspPortlet.testJndi(JspPortlet.java:54)
at lab.portlet.simpleportlet.JspPortlet.doView(JspPortlet.java:26)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)

After undeploying fb-integration-war, my test portlet is working fine. I could provide this test-portlet if desired.

Daniel
thumbnail
Andrey Filippov, modificado hace 10 años.

RE: fb-itegration invluences other portlets jndi?!

Junior Member Mensajes: 27 Fecha de incorporación: 21/10/10 Mensajes recientes
Hi,
Just ran into the same issue.. We have Jasperserver trial installed on the portal board and got Name [java:comp/env/jdbc/foodmart] is not bound in this Context. Unable to find [java:comp].

BR.