掲示板

JSF Portlet + datasource + data binding components = PROBLEMS!

16年前 に Ricardo Uhalde によって更新されました。

JSF Portlet + datasource + data binding components = PROBLEMS!

New Member 投稿: 9 参加年月日: 07/09/20 最新の投稿
Hi all,

I'm using Java Studio Creator 2 for development, managed to code and deploy 8 portlets with no problem at all BUT, data binding problems.

All my databindings don't work, no matter what I do , I've used plain JDBC API to access my datasources and bound manually all componentes as an alternative solution, not elegant but functional! emoticon

Also downloaded Liferay 4.4 to see if is my version (using Liferay 4.2) but after deploying one test portlet with a dropdown bound to a datasource, I obtain same error as with 4.2 version, like this:

2008-02-28 13:54:12,343 [http-8080-Processor23] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/estatistico].[jsp] - Servlet.service() for servlet jsp threw exception
javax.faces.el.EvaluationException: java.lang.RuntimeException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
....................................................................

My test portlet works ok with Pluto portal, bound with Java Studio Creator 2, data bindings are all OK.

I've searched lots of forums for days, but none seems to know the answer. I'm really lost, could some specialist explain why Tomcat doesn't know where my datasource is?? or how can I add manually datasource definition to Tomcat??

Thanks in advance!!
16年前 に Ricardo Uhalde によって更新されました。

RE: JSF Portlet + datasource + data binding components = PROBLEMS

New Member 投稿: 9 参加年月日: 07/09/20 最新の投稿
Nevermind this, found the solution by reading TOMCAT DOCUMENTATION, why we programmers tend to search in Google what is really obvious, read the friggin documentation!!!

Anyway, solution is to define JSF portlet datasource reference inside context.xml file like this:

<Resource
auth="Container"
name="jdbc/MyDatasourcer"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
password="pass"
maxIdle="30"
maxWait="10000"
username="root"
url="jdbc:mysql://localhost:3306/mydatabase"
maxActive="100"/>

Just simple as that.... emoticon
16年前 に Mauricio Miguel Brazão によって更新されました。

RE: JSF Portlet + datasource + data binding components = PROBLEMS

New Member 投稿: 13 参加年月日: 07/09/14 最新の投稿
hi!
When i put the datasource in the context.xml the 1 problem disapear. But i have this problem:

I create a portlet (in java studio creator) with a table component that access a mysql database.
I deploy the portlet and when i try de portlet, something strage hapens:
- when i do something in the table, the contents of the table disapear.
To see again the contents, i must maximaze the portlet and than turn to the normal.

Could some one help me?
13年前 に chinna singareddy によって更新されました。

RE: JSF Portlet + datasource + data binding components = PROBLEMS!

New Member 投稿: 3 参加年月日: 10/11/16 最新の投稿
Hi everybody i am trying to connect database using Liferay tomcat
i am getting the following error


Target server does support automatic datsource creation

Please help me anyone
thumbnail
13年前 に Nagendra Kumar Busam によって更新されました。

RE: JSF Portlet + datasource + data binding components = PROBLEMS!

Liferay Master 投稿: 678 参加年月日: 09/07/07 最新の投稿
Which version of Liferay are you using
13年前 に chinna singareddy によって更新されました。

RE: JSF Portlet + datasource + data binding components = PROBLEMS!

New Member 投稿: 3 参加年月日: 10/11/16 最新の投稿
I am using Liferayportal 5.2.3