Combination View Flat View Tree View
Threads [ Previous | Next ]
Luca Costa
LUCENE: No JDBC dialect found
May 7, 2008 7:16 AM
Answer

Luca Costa

Rank: Junior Member

Posts: 72

Join Date: March 5, 2008

Recent Posts

I'm trying to enable lucene on database - jdbc
in a portal 5.0.1, tomcat 6, ms-sqlserver 2005 already running well with database.

In the portal.ext I add the following line:
lucene.store.type=jdbc

then when I start the portal I have a error:
13:41:51,093 ERROR [LuceneUtil:407] No JDBC dialect found

Seems does not catch the right dialect.

Can someone help me??
Thanks to all!
Luca
JR Houn
RE: LUCENE: No JDBC dialect found
May 7, 2008 10:35 AM
Answer

JR Houn

LIFERAY STAFF

Rank: Expert

Posts: 489

Join Date: November 19, 2007

Recent Posts

Hi Luca-

Based on what can be seen in portal.properties you shouldn't have to designate a specific lucene dialect as it should choose automatically based on the jdbc address:

 1    #
 2    # Set the JDBC dialect that Lucene uses to store indexes in the database.
 3    # This is only referenced if Lucene stores indexes in the database. Liferay
 4    # will attempt to load the proper dialect based on the URL of the JDBC
 5    # connection. For example, the property "lucene.store.jdbc.dialect.mysql" is
 6    # read for the JDBC connection URL "jdbc:mysql://localhost/lportal".
 7    #
 8    lucene.store.jdbc.dialect.db2=org.apache.lucene.store.jdbc.dialect.DB2Dialect
 9    lucene.store.jdbc.dialect.derby=org.apache.lucene.store.jdbc.dialect.DerbyDialect
10    lucene.store.jdbc.dialect.hsqldb=org.apache.lucene.store.jdbc.dialect.HSQLDialect
11    lucene.store.jdbc.dialect.jtds=org.apache.lucene.store.jdbc.dialect.SQLServerDialect
12    lucene.store.jdbc.dialect.microsoft=org.apache.lucene.store.jdbc.dialect.SQLServerDialect
13    lucene.store.jdbc.dialect.mysql=org.apache.lucene.store.jdbc.dialect.MySQLDialect
14    #lucene.store.jdbc.dialect.mysql=org.apache.lucene.store.jdbc.dialect.MySQLInnoDBDialect
15    #lucene.store.jdbc.dialect.mysql=org.apache.lucene.store.jdbc.dialect.MySQLMyISAMDialect
16    lucene.store.jdbc.dialect.oracle=org.apache.lucene.store.jdbc.dialect.OracleDialect
17    lucene.store.jdbc.dialect.postgresql=org.apache.lucene.store.jdbc.dialect.PostgreSQLDialect


hope this helps,
jr
Luca Costa
RE: LUCENE: No JDBC dialect found
May 8, 2008 12:49 AM
Answer

Luca Costa

Rank: Junior Member

Posts: 72

Join Date: March 5, 2008

Recent Posts

Hi Houn,
Yes, simply enabling jdbc got the error.

This is my jdbc configuration in ROOT.xml
<Resource
name="jdbc/LiferayPool"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost;databaseName=LPortal;"
username="sa"
password="sapwd"
maxActive="20"
/>

so I partially solved looking at the "sqlserver":
What i found (?) is that there is a bug (?) in the example config: this property has no effect:
lucene.store.jdbc.dialect.microsoft=org.apache.lucene.store.jdbc.dialect.SQLServerDialect

instead using dialect "sqlserver" (what i found on the jdbc url) i can go:
===
lucene.store.jdbc.dialect.sqlserver=org.apache.lucene.store.jdbc.dialect.SQLServerDialect
===

Now tables are created on my sqlserver but I have another error: seems similar to this bug:
http://support.liferay.com/browse/LEP-4132

===
07:32:04,703 ERROR [IndexWriterFactory:207] Unable to create a new writer
org.apache.lucene.store.jdbc.JdbcStoreException: Failed to create indexInput instance [org.apache.lucene.store.jdbc.index.FetchOnBufferReadJdbcIndexInput]; nest
ed exception is java.lang.ClassNotFoundException: org.apache.lucene.store.jdbc.index.FetchOnBufferReadJdbcIndexInput
java.lang.ClassNotFoundException: org.apache.lucene.store.jdbc.index.FetchOnBufferReadJdbcIndexInput
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.lucene.store.jdbc.JdbcFileEntrySettings.getSettingAsClass(JdbcFileEntrySettings.java:175)
.....
===

Solutions?
Thanks to all,
Luca
Pablo Sebastián Abbate
RE: LUCENE: No JDBC dialect found
May 23, 2008 7:34 AM
Answer

Pablo Sebastián Abbate

Rank: New Member

Posts: 3

Join Date: May 22, 2008

Recent Posts

Try this in portal-ext.properties

lucene.store.jdbc.dialect.sqljdbc=org.apache.lucene.store.jdbc.dialect.SQLServerDialect

emoticon
Luca Costa
RE: LUCENE: No JDBC dialect found
May 23, 2008 8:10 AM
Answer

Luca Costa

Rank: Junior Member

Posts: 72

Join Date: March 5, 2008

Recent Posts

Hi Pablo,
thank you for your hint,

I think it is related to which driver we use to make the connection:
I use tomcat / microsoft sqljdbc_1.2 and in ROOT.xml I have:
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost;databaseName=LPortal;"

so I have to use: (now I'm testing with trunk (5.0.2))
lucene.store.jdbc.dialect.sqlserver=org.apache.lucene.store.jdbc.dialect.SQLServerDialect

Probably you are using another jdbc connection
I guess
url="jdbc:sqljdbc://..........;"

and in portal-ext.properties you need
lucene.store.jdbc.dialect.sqljdb=org.apache.lucene.store.jdbc.dialect.SQLServerDialect

Seem that the .sqlserver or .sqljdb should be used according to what we have in the jdbc string...

Now my lucene is working well.
Luca

P.S. seem that microsoft sql have 2 drivers and 3 subprotocols... This was confusing... emoticon
http://db.apache.org/ddlutils/databases/sqlserver.html
Jason Chen
RE: LUCENE: No JDBC dialect found
January 31, 2012 4:35 PM
Answer

Jason Chen

Rank: Junior Member

Posts: 62

Join Date: July 22, 2010

Recent Posts

Hey Luca, thanks for your suggestion. That works for my case as well.