Step two build error with PosgreSQL

Hi guys,

i have problem build the schema. here is the error msg
Any guys can help me to solve this problem.



[INFO] Scanning for projects...
[INFO] -------------------------------------------------------------------------
---
[INFO] Building Jasper Server database generation
[INFO] task-segment: [clean, install]
[INFO] -------------------------------------------------------------------------
---
[INFO] [clean:clean]
[INFO] Deleting directory C:\jasperintelligence-1.1.0-src\jasperserver\jasperser
ver-repository-hibernate\build-db\target
[INFO] Deleting directory C:\jasperintelligence-1.1.0-src\jasperserver\jasperser
ver-repository-hibernate\build-db\target\classes
[INFO] Deleting directory C:\jasperintelligence-1.1.0-src\jasperserver\jasperser
ver-repository-hibernate\build-db\target\test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [dependency:unpack {execution: unpack}]
[INFO] Configured Artifact: com.jaspersoft.jasperserver.api.metadata.impl:jasper
server-repository-hibernate:null:1.1.0:jar
[INFO] Expanding: C:\Documents and Settings\Anandharaj\.m2\repository\com\jasper
soft\jasperserver\api\metadata\impl\jasperserver-repository-hibernate\1.1.0\jasp
erserver-repository-hibernate-1.1.0.jar into C:\jasperintelligence-1.1.0-src\jas
perserver\jasperserver-repository-hibernate\build-db\target\classes
[WARNING] POM for 'com.jaspersoft.jasperserver.api.metadata.impl:jasperserver-re
pository-hibernate:pom:1.1.0:compile' is invalid. It will be ignored for artifac
t resolution. Reason: Failed to validate POM
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[WARNING] POM for 'com.jaspersoft.jasperserver.api.metadata.impl:jasperserver-re
pository-hibernate:pom:1.1.0:compile' is invalid. It will be ignored for artifac
t resolution. Reason: Failed to validate POM
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
[mkdir] Created dir: C:\jasperintelligence-1.1.0-src\jasperserver\jasperserv
er-repository-hibernate\build-db\target\sql
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[JPivot] 02 Nov 2006 18:24:08,145 ERROR [Session ] org.hibernate.tool.hbm2ddl.Sc
hemaExport#execute: schema export unsuccessful
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnectio
n(DriverManagerConnectionProvider.java:110)
at org.hibernate.tool.hbm2ddl.SchemaExport$ProviderConnectionHelper.getC
onnection(SchemaExport.java:467)
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:183
)
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:135)

at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTas
k.java:53)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:143)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractA
ntMojo.java:108)
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83)

at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:412)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:475)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:454)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[hibernatetool] 1 errors occurred while performing <hbm2ddl>.
[hibernatetool] Error #1: java.sql.SQLException: No suitable driver
[sql] Executing file: C:\jasperintelligence-1.1.0-src\jasperserver\scripts
\quartz\tables_postgres.sql
[sql] Failed to execute: # Thanks to Patrick Lightbody for submitting thi
s... # # In your Quartz properties file, you'll need to set # org.quartz.jobStor
e.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostreSQLDelegate drop tab
le qrtz_job_listeners
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing ant tasks

Embedded error: org.postgresql.util.PSQLException: ERROR: syntax error at or nea
r "#"
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Thu Nov 02 18:24:08 SGT 2006
[INFO] Final Memory: 8M/15M
[INFO] ------------------------------------------------------------------------
anandharaj's picture
7905
Joined: Oct 18 2006 - 5:02pm
Last seen: 9 years 11 months ago

11 Answers:

It looks like you have been looking at http://jasperforge.org/sf/docman/do/downloadDocument/projects.jasperintelligence/docman.root/doc1013
.

You need to install a Postgres driver into your local Maven2 repository and change your settings.xml accordingly.

Mark Penningroth has been working on this too : http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=16822&catid=10



Sherman
JasperSoft
swood's picture
24561
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
Yes, i already place the jdbc driver for PosgreSQL in ./m2/postgresql/postgresql/8.1-407.jdbc3

and also changed the maven setting to use Postgresql.

Seems, a lot of guys building JI with PostgreSQL, can you guys just provide the ".war" with postgresql schema as you did for mysql.
anandharaj's picture
7905
Joined: Oct 18 2006 - 5:02pm
Last seen: 9 years 11 months ago
From the error message, it said that "No suitable Driver found"

[hibernatetool] Executing Hibernate Tool with a standard Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[JPivot] 03 Nov 2006 13:59:26,980 ERROR [Session ] org.hibernate.tool.hbm2ddl.Sc
hemaExport#execute: schema export unsuccessful
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:545)
at java.sql.DriverManager.getConnection(DriverManager.java:140)

I using JDK 1.5.09 and PostgreSQL 8.1.5 with JDBC Driver postgresql-8.1-405.jdbc3
anandharaj's picture
7905
Joined: Oct 18 2006 - 5:02pm
Last seen: 9 years 11 months ago
You have not got your maven2 settings.xml set properly.

See page 13 of http://jasperforge.org/sf/docman/do/downloadDocument/projects.jasperintelligence/docman.root/doc1013




Sherman
JasperSoft
swood's picture
24561
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
Here i attached my maven2 settings.xml I think i set correctly. I'll appreciate if you could check the settings.xml and verify whether its correct/not. [file name=settings-efb9a4ceeb51bacf90428a2ae51eae63.xml size=3608]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/set...
anandharaj's picture
7905
Joined: Oct 18 2006 - 5:02pm
Last seen: 9 years 11 months ago
i found the solution for the error. It is hard-coded in POM file as the database JDBC driver is mysql. That why the build return error No Suitable Driver.

For the quartz table, the comments started with "#" should be removed also.
anandharaj's picture
7905
Joined: Oct 18 2006 - 5:02pm
Last seen: 9 years 11 months ago
I think there is a problem with your C:/Docume~1/Anandharaj/.m2/hibernate.cfg.xml file.

Mine looks like:

Code:
<!DOCTYPE hibernate-configuration PUBLIC<br />
	"-//Hibernate/Hibernate Configuration DTD 3.0//EN"<br />
	"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><br />
<br />
<hibernate-configuration><br />
    <session-factory name="metadata"><br />
        <!-- Database connection settings --><br />
        <property name="connection.driver_class">org.postgresql.Driver</property><br />
        <property name="connection.url">jdbc:«»postgresql://localhost/jasperserver</property><br />
        <property name="connection.username">postgres</property><br />
        <property name="connection.password">pgAdmin</property><br />
<br />
	<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property><br />
	<br />
	<property name="show_sql">false</property><br />
	<property name="format_sql">false</property><br />
	<!-- <mapping resource="org/hibernate/test/legacy/Simple.hbm.xml"/>  --><br />
    </session-factory><br />
</hibernate-configuration><br />
</td></tr></tbody></table><br />
<br />
<br />
Sherman<br />
JasperSoft
swood's picture
24561
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
I have successfully build the JI through all steps. Now i have some errors when i click the "image" in JI repository menu. Its seems like with the blobs in Postgresql.
anandharaj's picture
7905
Joined: Oct 18 2006 - 5:02pm
Last seen: 9 years 11 months ago
Did you check out the .zip file i uploaded about this.

I had problems with the blobs as well.
Post edited by: mpenningroth, at: 2006/11/07 19:35
mpenningroth's picture
Joined: Sep 18 2006 - 12:54am
Last seen: 17 years 1 week ago
Mark,

Was the solution to the Postgres BLOB issue to make the get* and find* methods on the RepositoryService transactional rather than read only?


Sherman
JasperSoft
swood's picture
24561
Joined: Jun 21 2006 - 12:48pm
Last seen: 10 years 11 months ago
My solution was to add additional properties to the jndi definition. Postgres has a setAutoCommitDefault property that I set to false. When a connection is obtained from the pool, it will automatically turn off auto commit.

I tried the *prop changes and they had no impact.

I have attached the readme.txt file that is included in the patch. It describes what I did to get this working.

[file name=readme.txt size=3921]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/rea...
mpenningroth's picture
Joined: Sep 18 2006 - 12:54am
Last seen: 17 years 1 week ago
Feedback
randomness