Apr 1st, 2010, 02:03 AM
Spring Roo - Oracle Connectivity
I am very new to Java / Spring /Roo.
I have been seriously considering Roo for one of my projects.
I am developing a Web application for one of my clients, who requires Oracle as a back-end database. After successfully trying out a few tutorials and examples with HyperSonic Db (the embedded database that all the examples were using), I decided to develop a simple contactManager example to connect to Oracle Xpress Edition.
I am facing persistent problems to connect to the Oracle Database.
My setup is as follows:
Spring Tool Suite 2.3.2
Spring Roo 1.0.2
Oracle XE 10g (10.2.0.2)
Ojdbc 10.2.0.2 (successfully installed using mvn install command)
After, building the Roo application, when I run the application the Web application comes up (I am creating a simple contactManager with Person and Address domains)
When I click on any action that has to connect to the database I get an error message
Data access failure
Sorry, a problem occurred while accessing the database.
I have attached the Stack Trace.
org.hibernate.exception.GenericJDBCException: Cannot open connection; nested exception is javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
I need urgent help. If the information provided is not sufficient, I can provide more details. But please look into the problem and kindly guide me, where I am getting it wrong.
Apr 1st, 2010, 03:43 AM
Post the FULL stacktrace, the one in the attached txt file isn't complete.
Apr 2nd, 2010, 01:05 PM
Oracle Connectivity with Spring Roo
Finally, I have solved the problem of Oracle connectivity from Spring Roo.
Now, I am able to connect to Oracle using Spring Roo and I am able to perform round-trip actions, like create entities and fields in the database, add new fields, then regenerate the app and see the results.
What did I do (differently)?
I started from the beginning, creating a Spring Roo project using Eclipse 3.5, then following the steps to create just one entity.
When I performed the tests, Roo reported that one of the dependency ojdbc14.jar was not configured. Roo indicated to download the ojdbc14.jar manually and install it.
I used the following command, suggested by Roo
mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.2 -Dpackaging=jar
After this, the pom.xml had the dependency looking like this:
I then traversed to the database.properties [under src/main/java/resources/META-INF/spring] and edited the values, so it looked like this:
Finally, I created the controller and ran the application.
I was able to connect to Oracle and when I entered data and saved, I verified it was saving it perfectly. More importantly, when I changed the entity and added new fields using Roo, recompiled and saw that the database was properly updated. This is really wonderful.
I hope this helps newbies like me who wish to use Roo and Oracle in their very first project.
Jul 13th, 2012, 12:47 PM
please send your roo commands as a text document
i also these dayz trying to make app roo with oracle...