lukefitzwolfgang / icatproject

Automatically exported from code.google.com/p/icatproject
0 stars 0 forks source link

Cannot create tables for application icat-ear-1583-http. #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm trying to set up icat 4.0, first attempt ever, so it's probably something 
very trivial. Oracle DB access & glassfish start/create work fine. So most 
things seem up and running, however the deployment step fails:

[glassfish3@moon icat40]$ ./glassfish.sh deploy icat
*** Deploying icat
./glassfish.sh deploy /home/glassfish3/icat40/icat-ear-1583-http.ear
Use "exit" to exit and "help" for online help.
Application deployed with name icat-ear-1583-http.

Cannot create tables for application icat-ear-1583-http. The expected DDL file 
icat-ear-1583-http_icat3-exposed-1.0.0-SNAPSHOT_icat3-exposed-user_createDDL.jdb
c is not available.

Exception [EclipseLink-4002] (Eclipse Persistence Services - 
2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. 
Cause: Connection could not be allocated because: IO Error: Unknown host 
specified 
Error Code: 0
Command deploy executed successfully.
Command multimode executed successfully.

What version of the product are you using? On what operating system?
icat4.0.0.zip 
glassfish 3.1.1
Oracle 11.2.0.3.0 (64-bit)
- using tnsname on a lb Oracle cluster. 
Java 1.6.0-sun-1.6.0.26 (64-bit)
OS: Scientific Linux 6.1 (64-bit)

Any help greatly appreciated! Regards, Frank.

Original issue reported on code.google.com by schluen...@gmail.com on 23 Feb 2012 at 12:46

GoogleCodeExporter commented 9 years ago
Hi Frank,

I believe the problem you are experiencing is a result of ICAT not being able 
to talk to the oracle database. To fix this problem please follow the following 
steps:

1. Undeploy icat:
./glassfish.sh undeploy icat

2. Edit glassfish.props:

# URL for oracle (for a local system on XE it is just: 
url="jdbc:oracle:thin:@//localhost:1521/XE")
url="jdbc:oracle:thin:@//localhost:1521/XE"

icatName=ICAT
icatPW=myicatpasswd

# ICATUSER user name and password in database
icatuserName=ICATUSER
icatuserPW=myicatuserpasswd

Please ensure that the url, ICAT and ICATUSER information for the database are 
correct. The username and passwords must match those of the schemas you have 
created.

3. Deploy icat:
./glassfish.sh deploy icat

Expect the following output:

Application deployed with name icat-ear-1583-http.

PER01003: Deployment encountered SQL Exceptions:
    PER01000: Got SQLException executing statement "CREATE TABLE USER_TABLE_ANSTO (USER_ID VARCHAR2(255) NOT NULL, PASSWORD VARCHAR2(255) NOT NULL, PRIMARY KEY (USER_ID))": java.sql.SQLException: ORA-00955: name is already used by an existing object

    PER01000: Got SQLException executing statement "CREATE TABLE USER_SESSION_ANSTO (USER_SESSION_ID VARCHAR2(255) NOT NULL, EXPIRE_DATE_TIME TIMESTAMP NOT NULL, RUN_AS VARCHAR2(255) NOT NULL, PRIMARY KEY (USER_SESSION_ID))": java.sql.SQLException: ORA-00955: name is already used by an existing object

    PER01000: Got SQLException executing statement "CREATE TABLE USER_TABLE (USER_ID VARCHAR2(255) NOT NULL, PASSWORD VARCHAR2(255) NOT NULL, PRIMARY KEY (USER_ID))": java.sql.SQLException: ORA-00955: name is already used by an existing object

    PER01000: Got SQLException executing statement "CREATE TABLE USER_SESSION (USER_SESSION_ID VARCHAR2(255) NOT NULL, EXPIRE_DATE_TIME TIMESTAMP NOT NULL, RUN_AS VARCHAR2(255) NOT NULL, PRIMARY KEY (USER_SESSION_ID))": java.sql.SQLException: ORA-00955: name is already used by an existing object

Command deploy executed successfully.
Command multimode executed successfully.

I hope this resolves your problem. 
Kind Regards 
Harjinder

Original comment by harj1...@googlemail.com on 23 Feb 2012 at 5:06

GoogleCodeExporter commented 9 years ago

Original comment by harj1...@googlemail.com on 23 Feb 2012 at 5:28

GoogleCodeExporter commented 9 years ago
Hi Harjinder,

thanks for the hint. I was using tnsnames.ora (in a non-standard location 
specified via TNS_ADMIN), and  url="jdbc:oracle:thin:@DESY". Seemingly that 
caused some problems. After changing it to  
url="jdbc:oracle:thin:@//dbserverNN.desy.de:1521/desy_db.desy.de" everything 
works. Would still favour to access the oracle db via the tnsnames-url rather 
than through a specific host?!

Regards, Frank.

Original comment by schluen...@gmail.com on 25 Feb 2012 at 10:42

GoogleCodeExporter commented 9 years ago
Hi Frank,

No problem. I personally don't know much about this but here's a link that 
shows how to correctly configure the use of tnsnames.ora for jdbc connection:

http://theblasfrompas.blogspot.com/2008/04/jdbc-thin-connection-using-tnsnamesor
a.html

Maybe this could be of use.

Kind Regards 
Harjinder

Original comment by harj1...@googlemail.com on 27 Feb 2012 at 4:23

GoogleCodeExporter commented 9 years ago

Original comment by crcami...@gmail.com on 17 Apr 2012 at 1:04