Skip to main content

Glassfish V3 usage with Oracle DB and more than one schema (user)

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
Anonymous

Dear Sir and Madam,
I've got a big Problem with the usage of glassfish and don't know if it's a bug or a configuration mistake.
For our business software we use actually the weblogic application server.
We want to switch to glassfish V3.
Now I check local for ToDos.

My JNDI - DataSource Connection has been established and together with the correct *.dbschema-File I'am able to deploy.
All SessionBeans with connection to the database are working fine.
My Problem are the EntityBeans.

From my point of view the problem ist, that my DBUser is different to the Schema-User.
The result of performing a function ist this stack trace:

[#|2012-07-16T09:36:47.117+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=79;_ThreadName=Thread-2;|JDO74004: Bean 'InfoUpdateBean' Methode ejbFindByPrimaryKey:
com.sun.jdo.api.persistence.support.JDODataStoreException: JDO76400: JDBC-SQLException beim Ausführen der SQL-Anweisung:
SQL-Anweisung mit Eingabewerten:java.lang.Long:1159049.
Weitere Informationen finden Sie in der SQLException.
NestedException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

So the Problem is, that the table "LIS_ZUORDNUNG" doesn't exist at the point of view from the current User.
The SQL has to include a pretended schema name like NDA."LIS_ZUORDNUNG".
Then the SQL works fine inside the SQL Developer...

Can you help me? Google isn't my friend in this case :/
Thanks
Sven

My additional configuration-files are:
sun-cmp-mappings.xml => SchemaFile named "NDA.dbschema"
<?xml version="1.0"?>

NDA

InfoUpdateBean
LIS_ZUORDNUNG

autoKey
AUTO_KEY

...

ejb-jar.xml

no description

InfoUpdateBean
com.test.ejb.InfoUpdateHome
com.test.ejb.InfoUpdate
com.test.ejb.InfoUpdateBean
Container
java.lang.Long
False
InfoUpdateBean
autoKey
fiktLiefNr
infoTextNr
anzeigenKz
geladenAm
letzteAktualisierung
benutzerID
autoKey

jdbc/WsiDataSource
javax.sql.DataSource
Container

glassfish-ejb-jar.xml

InfoUpdateBean
com.otto.wsi.ejb.InfoUpdateHome

___________________________________________________________________

Sven Redelin
Otto Group · Group Technology Partner (GTP)
Business Analyst Direktversand · Zentrale Logistik · FI-IS-LO-ZL
sven.redelin@ottogroup.com

Otto (GmbH & Co KG) · Wandsbeker Straße 3-7 · 22172 Hamburg
Telefon +49 40 64616116 · Telefax +49 40 64646116
___________________________________________________________________

Besuchen Sie uns auf:

Karriere machen:

ottogroup.com

ottogroup.com/karriere

___________________________________________________________________

AG Hamburg, HR A 62 024, Persönlich haftend: Verwaltungsgesellschaft Otto mbH,
Hamburg, AG Hamburg, HR B 13 762 vertr. durch: Hans-Otto Schrader (Vorsitzender) ·
Dr. Rainer Hillebrand (Stellvertretender Vorsitzender) · Alexander Birken · Dr. Michael
Heller · Dr. Timm Homann · Hanjo Schneider · Jürgen Schulte-Laggenbeck · Dr. Winfried
Zimmermann
Aufsichtsrat: Dr. Michael Otto (Vorsitzender)
___________________________________________________________________

SAVE PAPER - THINK BEFORE YOU PRINT

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04

did you specify your schema name in the element of sun-cmp-mappings.xml?

-marina

Redelin, Sven wrote:
>
> Dear Sir and Madam,
>
> I've got a big Problem with the usage of glassfish and don’t know if
> it’s a bug or a configuration mistake.
>
> For our business software we use actually the weblogic application server.
>
> We want to switch to glassfish V3.
>
> Now I check local for ToDos.
>
> My JNDI - DataSource Connection has been established and together with
> the correct *.dbschema-File I'am able to deploy.
>
> All SessionBeans with connection to the database are working fine.
>
> My Problem are the EntityBeans.
>
> From my point of view the problem ist, that my DBUser is different to
> the Schema-User.
>
> The result of performing a function ist this stack trace:
>
> [#|2012-07-16T09:36:47.117+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=79;_ThreadName=Thread-2;|JDO74004:
> Bean 'InfoUpdateBean' Methode ejbFindByPrimaryKey:
>
> com.sun.jdo.api.persistence.support.JDODataStoreException: JDO76400:
> JDBC-SQLException beim Ausführen der SQL-Anweisung:
>
> SQL-Anweisung t0."INFOTEXT_NR", t0."ANZEIGEN_KZ", t0."GELADEN_AM",
> t0."LETZTE_AKTUALISIERUNG", t0."BENUTZER_ID" from "LIS_ZUORDNUNG" t0
> where t0."AUTO_KEY" = ?> mit Eingabewerten:java.lang.Long:1159049.
>
> Weitere Informationen finden Sie in der SQLException.
>
> NestedException: java.sql.SQLSyntaxErrorException: ORA-00942: table or
> view does not exist
>
> So the Problem is, that the table "LIS_ZUORDNUNG" doesn't exist at the
> point of view from the current User.
>
> The SQL has to include a pretended schema name like NDA."LIS_ZUORDNUNG".
>
> Then the SQL works fine inside the SQL Developer...
>
> Can you help me? Google isn't my friend in this case :/
>
> Thanks
>
> Sven
>
> My additional configuration-files are:
>
> sun-cmp-mappings.xml => SchemaFile named "NDA.dbschema"
>
> <?xml version="1.0"?>
>
> ONE Application Server 7 OR Mapping //EN'
> 'http://www.sun.com/software/sunone/appserver/dtds/sun-cmp_mapping_1_0.dtd'>
>
>
>
>
>
> NDA
>
>
>
> InfoUpdateBean
>
> LIS_ZUORDNUNG
>
>
>
> autoKey
>
> AUTO_KEY
>
>
>
> ...
>
>
>
>
>
>
>
> ejb-jar.xml
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
> no description
>
>
>
>
>
> InfoUpdateBean
>
> com.test.ejb.InfoUpdateHome
>
> com.test.ejb.InfoUpdate
>
> com.test.ejb.InfoUpdateBean
>
> Container
>
> java.lang.Long
>
> False
>
> InfoUpdateBean
>
> autoKey
>
> fiktLiefNr
>
> infoTextNr
>
> anzeigenKz
>
> geladenAm
>
> letzteAktualisierung
>
> benutzerID
>
> autoKey
>
>
>
> jdbc/WsiDataSource
>
> javax.sql.DataSource
>
> Container
>
>
>
>
>
>
>
>
>
> glassfish-ejb-jar.xml
>
>
>
>
>
>
>
> InfoUpdateBean
>
> com.otto.wsi.ejb.InfoUpdateHome
>
>
>
>
>
>
>
> ___________________________________________________________________
>
> Sven Redelin
>
> Otto Group · Group Technology Partner (GTP)
>
> Business Analyst Direktversand · Zentrale Logistik · FI-IS-LO-ZL
>
> sven.redelin@ottogroup.com
>
> Otto (GmbH & Co KG) · Wandsbeker Straße 3-7 · 22172 Hamburg
>
> Telefon +49 40 64616116 · Telefax +49 40 64646116
>
> ___________________________________________________________________
>
> Besuchen Sie uns auf:
>
>
>
> Karriere machen:
>
> ottogroup.com
>
>
>
> ottogroup.com/karriere
>
> ___________________________________________________________________
>
> AG Hamburg, HR A 62 024, Persönlich haftend: Verwaltungsgesellschaft
> Otto mbH,
>
> Hamburg, AG Hamburg, HR B 13 762 vertr. durch: Hans-Otto Schrader
> (Vorsitzender) ·
>
> Dr. Rainer Hillebrand (Stellvertretender Vorsitzender) · Alexander
> Birken · Dr. Michael
>
> Heller · Dr. Timm Homann · Hanjo Schneider · Jürgen Schulte-Laggenbeck
> · Dr. Winfried
>
> Zimmermann
>
> Aufsichtsrat: Dr. Michael Otto (Vorsitzender)
>
> ___________________________________________________________________
>
> SAVE PAPER - THINK BEFORE YOU PRINT
>

narayana rallab...
Offline
Joined: 2011-04-04

Hi,

 

Did you ask your DB system admin for making this table/view visible for the user who is accessing it?

 

Regards,

 

From: Redelin, Sven [mailto:Sven.Redelin@ottogroup.com]
Sent: Monday, July 16, 2012 2:18 PM
To: users@glassfish.java.net
Subject: Glassfish V3 usage with Oracle DB and more than one schema (user)

 

Dear Sir and Madam,

I've got a big Problem with the usage of glassfish and don't know if it's a bug or a configuration mistake.

For our business software we use actually the weblogic application server.

We want to switch to glassfish V3.

Now I check local for ToDos.

 

My JNDI - DataSource Connection has been established and together with the correct *.dbschema-File I'am able to deploy.

All SessionBeans with connection to the database are working fine.

My Problem are the EntityBeans.

 

From my point of view the problem ist, that my DBUser is different to the Schema-User.

The result of performing a function ist this stack trace:

 

[#|2012-07-16T09:36:47.117+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=79;_ThreadName=Thread-2;|JDO74004: Bean 'InfoUpdateBean' Methode ejbFindByPrimaryKey:

com.sun.jdo.api.persistence.support.JDODataStoreException: JDO76400: JDBC-SQLException beim Ausführen der SQL-Anweisung:

SQL-Anweisung mit Eingabewerten:java.lang.Long:1159049.

Weitere Informationen finden Sie in der SQLException.

NestedException: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

 

So the Problem is, that the table "LIS_ZUORDNUNG" doesn't exist at the point of view from the current User.

The SQL has to include a pretended schema name like NDA."LIS_ZUORDNUNG".

Then the SQL works fine inside the SQL Developer...

 

Can you help me? Google isn't my friend in this case :/

Thanks

Sven

 

My additional configuration-files are:

sun-cmp-mappings.xml => SchemaFile named "NDA.dbschema"

<?xml version="1.0"?>

                NDA

               

                               InfoUpdateBean

                               LIS_ZUORDNUNG

                              

                                               autoKey

                                               AUTO_KEY

                              

...

 

ejb-jar.xml

   no description

  

                InfoUpdateBean

                com.test.ejb.InfoUpdateHome

        com.test.ejb.InfoUpdate

        com.test.ejb.InfoUpdateBean

        Container

        java.lang.Long

        False

        InfoUpdateBean

         autoKey

         fiktLiefNr

         infoTextNr

         anzeigenKz

         geladenAm

         letzteAktualisierung

         benutzerID

         autoKey

        

            jdbc/WsiDataSource

            javax.sql.DataSource

            Container

        

     

 

glassfish-ejb-jar.xml

               

                              

                                               InfoUpdateBean

                                               com.otto.wsi.ejb.InfoUpdateHome

                              

 

___________________________________________________________________   

    

Sven Redelin

Otto Group · Group Technology Partner (GTP)

Business Analyst Direktversand · Zentrale Logistik · FI-IS-LO-ZL

sven.redelin@ottogroup.com

 

Otto (GmbH & Co KG) · Wandsbeker Straße 3-7 · 22172 Hamburg   

Telefon +49 40 64616116 · Telefax +49 40 64646116

___________________________________________________________________   

 

Besuchen Sie uns auf:

Karriere machen:

ottogroup.com

ottogroup.com/karriere

___________________________________________________________________

 

AG Hamburg, HR A 62 024, Persönlich haftend: Verwaltungsgesellschaft Otto mbH,   

Hamburg, AG Hamburg, HR B 13 762 vertr. durch: Hans-Otto Schrader (Vorsitzender) ·   

Dr. Rainer Hillebrand (Stellvertretender Vorsitzender) · Alexander Birken · Dr. Michael   

Heller · Dr. Timm Homann · Hanjo Schneider · Jürgen Schulte-Laggenbeck · Dr. Winfried   

Zimmermann   

Aufsichtsrat: Dr. Michael Otto (Vorsitzender)  

___________________________________________________________________

    

SAVE PAPER - THINK BEFORE YOU PRINT