Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Kevin Dean
GlassFish 3.1.2.2 and SQL Server
August 13, 2012 11:55 AM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

No matter how hard I try, I just can't seem to get Liferay to come up under GlassFish 3.1.2.2 and SQL Server 2008.

I'm running Windows 7 Ultimate 64-bit.

Because of the nature fo my final configuration, it is necessary for me to install GlassFish and then deploy Liferay. To make sure that I have the absolute best option for deployment, I downloaded the Liferay/GlassFish bundle and extracted the Liferay war from that bundle (though the unbundled version of Liferay fails just as miserably).

My first option is to use the JNDI lookup, so my portal-ext.properties file has the following:

1jdbc.default.jndi.name=jdbc/LiferayPool

First, I tried to use the latest JDBC driver provided by Microsoft. Here's what is in my domain.xml:

1    <jdbc-connection-pool validation-table-name="Portlet" datasource-classname="com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource" res-type="javax.sql.ConnectionPoolDataSource" name="LiferayPool" is-connection-validation-required="true">
2      <property name="user" value="GatewayServer"></property>
3      <property name="password" value="${ALIAS=database.server_password}"></property>
4      <property name="portNumber" value="1433"></property>
5      <property name="databaseName" value="Liferay_release_2_0"></property>
6      <property name="serverName" value="localhost"></property>
7    </jdbc-connection-pool>
8    <jdbc-resource pool-name="LiferayPool" jndi-name="jdbc/LiferayPool"></jdbc-resource>

I also tried using the latest JTDS driver, to no avail:

 1    <jdbc-connection-pool validation-table-name="Portlet" datasource-classname="net.sourceforge.jtds.jdbcx.JtdsDataSource" res-type="javax.sql.ConnectionPoolDataSource" name="LiferayPool" is-connection-validation-required="true">
 2      <property name="user" value="GatewayServer"></property>
 3      <property name="password" value="${ALIAS=database.server_password}"></property>
 4      <property name="databaseName" value="Liferay_release_2_0"></property>
 5      <property name="serverName" value="localhost"></property>
 6      <property name="selectMethod" value="cursor"></property>
 7      <property name="port" value="1433"></property>
 8    </jdbc-connection-pool>
 9    <jdbc-resource pool-name="LiferayPool" jndi-name="jdbc/LiferayPool"></jdbc-resource>

In both cases, the deployment hangs. Often, it gets as far as this:

117:47:38,759 INFO  [admin-thread-pool-4848(4)][ServerDetector:154] Server supports hot deploy
217:47:38,768 INFO  [admin-thread-pool-4848(4)][PluginPackageUtil:1033] Reading plugin package for
317:47:47,075 INFO  [admin-thread-pool-4848(4)][AutoDeployDir:106] Auto deploy scanner started for D:\Users\KDean\projects\servers\glassfish3\deploy

I then tried to configure the database connection directly:

1jdbc.default.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
2jdbc.default.url=jdbc:sqlserver://localhost:1433;databaseName=Liferay_release_2_0
3jdbc.default.username=user
4jdbc.default.password=password

And also with JTDS:

1jdbc.default.driverClassName=net.sourceforge.jtds.jdbc.Driver
2jdbc.default.url=jdbc:jtds:sqlserver://localhost:1433/Liferay_release_2_0
3jdbc.default.username=user
4jdbc.default.password=password

Those options didn't work either.

When I deploy with no portal-ext.properties and therefore use the Hypersonic database, everthing works. I really need this to run on my production database, for obvious reasons. Any guidance would be much appreciated.
David H Nebinger
RE: GlassFish 3.1.2.2 and SQL Server
August 13, 2012 12:54 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 8585

Join Date: September 1, 2006

Recent Posts

Deploying just the Liferay war is typically not enough.

What you should try is a diff between the liferay/glassfish bundle and a stock glassfish (the same version as glassfish from the Liferay bundle).

This will identify all of the changes that you'd have to make to your glassfish to get the install to work.

For example, the Liferay/tomcat bundle includes a special lib/ext directory which is not part of the stock Tomcat, nor is it part of the Liferay war file. Dropping the Liferay war file into a stock tomcat will fail because it is missing this key folder (plus the corresponding tomcat config changes to use the lib/ext directory).

Using a diff tool to identify what was changed in the bundle to get Liferay to work will identify the changes that you also need to make to your glassfish server.
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
August 13, 2012 1:14 PM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

I've already been through the bundled version and compared it to my installation after installing the Liferay dependencies. The only difference that I can identify between my installation and the Liferay installation is that the Liferay bundle includes database drivers that I don't need. However, there is apparently more, either in the GlassFish version or buried in the domain.xml file somewhere, because the bundled version connects to SQL Server 2008 just fine.

It's going to be a long week...
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
August 13, 2012 3:02 PM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

It was the GlassFish version. When I downgraded to 3.1.2 from 3.1.2.2, my deployment scripts worked. I still have some details to sort out, but I have a running instance now. Thanks for the pointer.
James Falkner
RE: GlassFish 3.1.2.2 and SQL Server
August 13, 2012 4:46 PM
Answer

James Falkner

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1334

Join Date: September 17, 2010

Recent Posts

Kevin Dean:
It was the GlassFish version. When I downgraded to 3.1.2 from 3.1.2.2, my deployment scripts worked. I still have some details to sort out, but I have a running instance now. Thanks for the pointer.



I was able to get everything running on Mac OS X using GF 3.1.2.2. I did the same thing you did (look at a diff of the GF bundle vs. stock GF). The differences are also documented in the official docs (search for GlassFish and ignore the part about installing patches, you don't need them with GF 3.1.2.2). From memory, here's what I did:

0. Download LR GF 3.1.2 bundle
1. Download GF 3.1.2.2 "Full Profile" from glassfish.org (it should work with Web Profile, I believe that's what our bundles use)
2. Copy all the .jars from step 0's bundled LR+GF's domains/domain1/lib into your freshly extracted GF from step 1
3. Modify the step 1's domain.xml as documented above (all the jvm-options)
4. Deploy Liferay portal by taking the liferay-portal.war from step 0 (in the domains/domain1/autodeploy directory) and copy it the corresponding dir in the step 1 area

Start it up with asadmin start-domain

On the setup wizard's first screen you can then configure to use SQL Server.

Sounds like you got it working though. It should work with 3.1.2.2 though (and you'll want to use it because there is a bug with uploading files that was fixed in 3.1.2.2).
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
August 13, 2012 4:54 PM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

That's terrific, thanks. I was going from my GlassFish 2 / Liferay 5 scripts, which had the deployment entirely automated. The patching is going to be tricky, but I've automated that sort of thing before as well, so it shouldn't be too hard. This week is ridiculously busy and as of now I have to put my Liferay work aside but I should be able to return to it later in the week. I'll post the results here.
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
August 13, 2012 4:57 PM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

A quick review of the patches suggests they have already been fixed, so that simplifies things somewhat.
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
August 17, 2012 8:10 AM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

Thank you... setting the additional properties solved the problem for the most part. I still can't use the JNDI name; the deployment freezes at:

"Auto deploy scanner started for D:\Users\KDean\projects\Portal\release-2.0\servers\liferay\deploy"

Any thoughts on this or should I file a bug report?
James Falkner
RE: GlassFish 3.1.2.2 and SQL Server
August 17, 2012 10:03 AM
Answer

James Falkner

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1334

Join Date: September 17, 2010

Recent Posts

Kevin Dean:
Thank you... setting the additional properties solved the problem for the most part. I still can't use the JNDI name; the deployment freezes at:

"Auto deploy scanner started for D:\Users\KDean\projects\Portal\release-2.0\servers\liferay\deploy"

Any thoughts on this or should I file a bug report?


Hmm.. that's weird. I'd file a bug, but if possible, please include a stack trace at the time it is frozen, so we can see what the threads are doing (using jstack).
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
October 29, 2012 8:28 AM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

I appear to have resolved the problem. In an earlier incarnation of my application (using Liferay 5), I had replaced the LIFERAY_SHARED_ session and request attribute prefix with MYAPP_SHARED_. Restoring LIFERAY_SHARED_ (and keeping my own MYAPP_SHARED_) to portal-ext.properties made this and a couple of other issues go away.
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
November 1, 2012 4:44 AM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

I spoke too soon. It seems that the problem is on the first deployment and database initialization; it works fine with the JNDI name thereafter. I'll open a bug report.
Kevin Dean
RE: GlassFish 3.1.2.2 and SQL Server
November 1, 2012 8:39 AM
Answer

Kevin Dean

Rank: New Member

Posts: 24

Join Date: February 5, 2009

Recent Posts

Opened http://issues.liferay.com/browse/LPS-30803.