Apache Tomcat 6 and pat-0.8.war

20 views
Skip to first unread message

arekanderu

unread,
Oct 15, 2010, 4:27:05 PM10/15/10
to pentahoanalysistool-users
Hello,

I am trying to setup latest pat war file with my tomcat6 + mondrian +
custom schema but I am having some trouble.

The result is tomcat not to be even able to load the index.html page
(the one that says It works!) if I enable pat. I have followed the PAT
User Guide and changed the pat.properties in order to use Mysql (which
is were my schema resides) and updated the hibernate.dialect to
org.hibernate.dialect.MySQLDialect - as also instructed in the PAT
User Guide. I packed the new war file, and deployed it to tomcat.

As soon as tomcat starts i can see some PAT_* tables created in my
mysql database - which i assume it means i am on the right track - but
after that tomcat stays forever in a "Waiting for localhost" state. If
i undeploy the pat war file tomcat works just fine.

pat.log does not indicate any errors and neither catalina.out log.

One thing i am not curtain of is the catalina pat.xml which looks like
this:

<Context path="pat">
<Resource name="jdbc/pat-hibernate" auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20" maxIdle="5"
maxWait="10000" username="sa" password=""
driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:mem:pat_app;default_schema=true;type=cached;write_delay=false"/
>
</Context>

Is the above correct since I am using mysql jdbc driver?

I am looking for any suggestions at all, i have been struggling with
this 2 days and I am running out of ideas and documentation wasn't
very helpful.

Cheers

Paul Stoellberger

unread,
Oct 15, 2010, 4:38:21 PM10/15/10
to pentahoanaly...@googlegroups.com
You can delete the tomcat JNDI resource out of the pat.xml file
since hibernate is creating the tables... your db connection should be configured correctly

Try to remove the resource and then try again, I have deployed the WAR file several times with jdbc or jndi configured, and never had a problem with it

-Paul

> --
> You received this message because you are subscribed to the Google Groups "pentahoanalysistool-users" group.
> To post to this group, send email to pentahoanaly...@googlegroups.com.
> To unsubscribe from this group, send email to pentahoanalysistoo...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pentahoanalysistool-users?hl=en.
>

arekanderu

unread,
Oct 15, 2010, 5:01:40 PM10/15/10
to pentahoanalysistool-users
Hello Paul,

Thank you for your fast reply first of all.

I removed the resource completely from the pat.xml and it now looks
like this:

<Context path="pat">

</Context>

Restarted tomcat, still same behavior. My database connection is
definitely correct because I can see the PAT tables being created
inside MySQL and i dont get any errors.
In addition, after the tomcat restart the last line in catalina.out
log is this:
Oct 15, 2010 11:55:28 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor pat-0.8.xml

No errors above that so i guess that it deploys properly.

The PAT User Guide said something about WEB-INF/classes/pat-
hibernate.cfg.xml but I didn't change anything there. Do I need to
change something?

Would it be possible to write me the steps which you follow in order
to deploy the WAR file with MySQL so i can follow them and see where
I've gone wrong?

Regards

Alex

On Oct 15, 11:38 pm, Paul Stoellberger <paul.stoellber...@aschauer-

arekanderu

unread,
Oct 17, 2010, 7:21:08 AM10/17/10
to pentahoanalysistool-users
...anyone?

bugg_tb

unread,
Oct 18, 2010, 9:36:09 AM10/18/10
to pentahoanalysistool-users
Paul wrote all this stuff so I've no idea off the top of my head...
that being said, I have a conference call tonight, so to keep me
entertained during the call, I'll try and recreate it and write some
notes.

Tom

bugg_tb

unread,
Oct 18, 2010, 9:41:30 AM10/18/10
to pentahoanalysistool-users
This is what he told me:

14:36 < pstoellberger> magicaltrout : pat-datasource.xml
14:36 < pstoellberger> I<import resource="pat-datasource-jdbc.xml" />
<< if you want jndi ... replce jdbc with jndi
14:37 < pstoellberger> then open the pat-datasource-jndi.xml
14:37 < pstoellberger> as you can see there is nothing in there
14:37 < pstoellberger> thats the point where you enter your jndi in
context.xml
14:37 < pstoellberger> and open pat.properties.... uncomment jndi.name
=
14:38 < pstoellberger> and put the name of the context.xml next ot
that
14:38 < pstoellberger> if you use jdbc just check out the samples for
jdbc.
14:38 < pstoellberger> + edit the hibernate.dialect property on top of
the properties file


See if it helps :)

Tom

Paul Stoellberger

unread,
Oct 18, 2010, 9:46:43 AM10/18/10
to pentahoanaly...@googlegroups.com
I don't think your db connection is wrong,
after the deploying configuration descriptor there is no entry in the log?
That can take a while.... i noticed that.... after that it usually just works


The guide would be:
place the WAR in the webapps folder, let it explode, stop the server, edit the configs (as described in bugg_tb's email 5 mins ago), restart the server (maybe remove the WAR file before that so it doesn't overwrite the context probably)

you don't have to touch the hibernate.cfg.xml file... all you need to do is edit the pat-datasource.xml to use jndi (if thats not default) and then enter your JNDI in the context.xml .. and then open pat.properties and choose the right hibernate dialect and make sure you have something like : jndi.name=asdf in there

if something doesnt work you should see errors
what happens if you open the webapp?

so e.g: http://localhost:8080/pat-0.8/ ?

-Paul

arekanderu

unread,
Oct 18, 2010, 11:32:06 AM10/18/10
to pentahoanalysistool-users
Hello guys,

Thank you both for your answers, I haven't gone carefully through them
yet but as a quick reply on your question Paul, "what happens if you
open the webapp?", tomcat shows 'Waiting for localhost..." and just
stays there forever...Logs do not show any errors and not even the "It
works" page of the tomcat loads. If i just stop tomcat, undeploy pat,
start tomcat then tomcat works again so something related with pat
must causing the issue.

I will remove everything and setup all from scratch and by reading
more careful all the answers and the guide and let you know of my
results.

- Alexander

On Oct 18, 4:46 pm, Paul Stoellberger <p.stoellber...@gmail.com>
wrote:

arekanderu

unread,
Oct 18, 2010, 6:47:24 PM10/18/10
to pentahoanalysistool-users
Hi again,

I did what Tom posted in combination with what you Paul said and I
think we are getting somewhere here. The context.xml part kinda
confused me though.

This is what pat.properties now looks like:

hibernate.dialect=org.hibernate.dialect.MySQLDialect


# JNDI Setup
jndi.name = Hibernate (<-----should i give a different name here?)

jdbc.driver=com.mysql.jdbc.Driver

jdbc.url=jdbc:mysql://localhost:3306/pat

jdbc.username=root

jdbc.password=root


And this is what my context file looks like:

<Context path="pat">

<Resource name="jdbc/pat-hibernate" auth="Container"
type="javax.sql.DataSource"

factory="org.apache.commons.dbcp.BasicDataSourceFactory"
maxActive="20" maxIdle="5"

maxWait="10000" username="sa" password=""

driverClassName="org.hsqldb.jdbcDriver"
url="jdbc:hsqldb:mem:pat_app;default_schema=true;type=cached;write_delay=false"

validationQuery="select count(*) from
INFORMATION_SCHEMA.SYSTEM_SEQUENCES"/>

</Context>

I do now see an error at the catalina.out log which says the
following:

Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in
ServletContext resource [/WEB-INF/pat-sessionfactory.xml]: Cannot
resolve reference to bean 'dataSource' while setting bean property
'dataSource'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'dataSource' defined in ServletContext
resource [/WEB-INF/pat-datasource-jndi.xml]: Invocation of init method
failed; nested exception is javax.naming.NameNotFoundException: Name
Hibernate is not bound in this Cont

Any suggestions?

Alex

Paul Stoellberger

unread,
Oct 18, 2010, 6:59:26 PM10/18/10
to pentahoanaly...@googlegroups.com
you need to edit the tomcat/webapps/pat-0.8/WEB-INF/pat-datasource.xml to look like

<beans>
<import resource="pat-datasource-jdbc.xml" />
</beans>

so you can forget about the jndi.name thing and just use the jdbc.driver jdbc.url etc.
just edit that xml and start the server again.. that should be the correct config

-paul

arekanderu

unread,
Oct 18, 2010, 7:15:47 PM10/18/10
to pentahoanalysistool-users
I changed pat-datasource.xml back to what you said (which was the
default by the way) and now I am back to were i started. No errors in
logs and tomcat stays forever in the "Waiting for localhost..." state.
I do see all the PAT_* tables being created inside the database but
they have no data in them. Is that normal?

I use Ubuntu 10 + tomcat6 + mysql 5.1.41 + Java(TM) SE Runtime
Environment (build 1.6.0_20-b02) + pat 0.8.war if that helps at all.

I appreciate your patience Paul

- Alex

On Oct 19, 1:59 am, Paul Stoellberger <p.stoellber...@gmail.com>
wrote:

Paul Stoellberger

unread,
Oct 18, 2010, 7:20:35 PM10/18/10
to pentahoanaly...@googlegroups.com
this is really weird.... it always worked for me

could you try using the pat-server package
it comes bundled with a tomcat and a hsql db for the backend. just run that and see if it works. if it does try to modify the datasource config as you did right now.. and see if that works


Just extract it and run the start shell script

-Paul

arekanderu

unread,
Oct 18, 2010, 7:41:56 PM10/18/10
to pentahoanalysistool-users
I used pat-server with my mondrian schema + mysql and it works just
fine after i simply edited pat.properties file and used the jdbc
driver.

I can see my cube and everything. I also see that pat-server loads the
following:

[Server@5013582d]: Database [index=0, id=0, db=file:./hsqldb/
sampledata, alias=sampledata] opened sucessfully in 934 ms.
[Server@5013582d]: Database [index=1, id=1, db=file:./hsqldb/
hibernate, alias=hibernate] opened sucessfully in 30 ms.
[Server@5013582d]: Startup sequence completed in 970 ms.
[Server@5013582d]: 2010-10-19 02:32:10.327 HSQLDB server 1.8.0 is
online

I do not need those loaded. Can you please tell me from where i
disable them?

I really do not understand why this is happening. I will have a
further look into the configuration files of pat-server and see what I
am doing different.
Are you sure that the problem is not in my pat-0.8.xml located in /etc/
tomcat6/Catalina/localhost directory? It contains what i pasted you in
my previous replies and i refered to it as 'context.xml'.

Alex

On Oct 19, 2:20 am, Paul Stoellberger <p.stoellber...@gmail.com>
wrote:
> this is really weird.... it always worked for me
>
> could you try using the pat-server package
> it comes bundled with a tomcat and a hsql db for the backend. just run that and see if it works. if it does try to modify the datasource config as you did right now.. and see if that works
>
> the latest pat-server package is available from:http://ci.analytical-labs.com/job/pat-standalone-server/lastSuccessfu...
> ...
>
> read more »

Paul Stoellberger

unread,
Oct 18, 2010, 7:46:27 PM10/18/10
to pentahoanaly...@googlegroups.com
yes that looks ok
if you don't need hsql then you can disable it by commenting following line in start_patserver.sh :

sh start_hypersonic.sh &

just remove it or put a # in front of it


-Paul

arekanderu

unread,
Oct 18, 2010, 8:04:13 PM10/18/10
to pentahoanalysistool-users
Thanks for all the help Paul. I do however feel beaten at the
moment :) I will compare my setup carefully with the one which pat-
server has and update you with my results.

- Alex

On Oct 19, 2:46 am, Paul Stoellberger <p.stoellber...@gmail.com>
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages