You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tschuler <th...@opentext.com> on 2013/10/09 14:17:40 UTC

IllegalAccessException - OraclePreparedStatementWrapper

Hi!

We are using latest TomEE 1.6.0 snapshot and an oracle database for storing
entity beans.

What we see are warning messages like:
java.lang.IllegalAccessException: Class
org.apache.openjpa.jdbc.sql.OracleDictionary can not access a member of
class oracle.jdbc.driver.OraclePreparedStatementWrapper with modifiers
"public"

It happens if the database table includes "unicode" columns (e.g. NVARCHAR2)
and an entity is manipulated (added, gets found by a named query or
deleted).

We did additional tests and had a look inside the OpenJPA sources. What we
see is:
- The warnings did NOT depend on the used JDBC driver and NOT on the oracle
database version.
- Checking the source code (org.apache.openjpa.jdbc.sql.OracleDictionary) we
can see that a specific prepared statement object
(oracle.jdbc.OraclePreparedStatement) is required but while creation
(conn.prepareStatement) another object
(oracle.jdbc.driver.OraclePreparedStatement) is instantiated.

Is there a way to get the correct OraclePreparedStatement object
instantiated or is a special setting (in persistence.xml or tomee.xml)
needed?

Best regards,
Thomas 



--
View this message in context: http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: AW: IllegalAccessException - OraclePreparedStatementWrapper

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Yes and no. Would be 3rd if openjpa wouldnt see oracle classes at all.
Thats not the error
Le 12 oct. 2013 08:23, "tschuler" <th...@opentext.com> a écrit :

> Hi Romain!
>
> Maybe a custom dictionary could help.
> But regarding to OpenJPA documentation (
> http://ci.apache.org/projects/openjpa/trunk/docbook/manual/main.html)
> chapter 4.4 (OracleDictionary Properties):
>
> UseSetFormOfUseForUnicode: Prior to Oracle 10i, statements executed
> against unicode capable columns (the NCHAR, NVARCHAR, NCLOB Oracle types)
> required special handling to be able to store unicode values. Setting this
> property to true (the default) will cause OpenJPA to attempt to detect when
> the column is one of these types, and if so, will attempt to correctly
> configure the statement using the OraclePreparedStatement.setFormOfUse. For
> more details, see the Oracle JDBC Programming with Unicode<
> http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch7progrunicode.htm#i1006858>.
> Note that this can only work if OpenJPA is able to access the underlying
> OraclePreparedStatement instance, which may not be possible when using some
> third-party datasources. If OpenJPA detects that this is the case, a
> warning will be logged.
>
> And that's exactly what happens here.
> Is a TomEE datasource a "third-party datasource" as described within the
> documentation?
>
> Best regards,
>                 Thomas
>
> Von: Romain Manni-Bucau [via OpenEJB] [mailto:
> ml-node+s979440n4665497h17@n4.nabble.com]
> Gesendet: Mittwoch, 9. Oktober 2013 16:44
> An: Thomas Schuler
> Betreff: Re: IllegalAccessException - OraclePreparedStatementWrapper
>
> Hi,
>
> I think you need to set a custom dictionarry (inheriting from
> oracledictionary) handling wrappers
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<
> http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/10/9 tschuler <[hidden
> email]</user/SendEmail.jtp?type=node&node=4665497&i=0>>
>
> > Hi!
> >
> > We are using latest TomEE 1.6.0 snapshot and an oracle database for
> storing
> > entity beans.
> >
> > What we see are warning messages like:
> > java.lang.IllegalAccessException: Class
> > org.apache.openjpa.jdbc.sql.OracleDictionary can not access a member of
> > class oracle.jdbc.driver.OraclePreparedStatementWrapper with modifiers
> > "public"
> >
> > It happens if the database table includes "unicode" columns (e.g.
> > NVARCHAR2)
> > and an entity is manipulated (added, gets found by a named query or
> > deleted).
> >
> > We did additional tests and had a look inside the OpenJPA sources. What
> we
> > see is:
> > - The warnings did NOT depend on the used JDBC driver and NOT on the
> oracle
> > database version.
> > - Checking the source code (org.apache.openjpa.jdbc.sql.OracleDictionary)
> > we
> > can see that a specific prepared statement object
> > (oracle.jdbc.OraclePreparedStatement) is required but while creation
> > (conn.prepareStatement) another object
> > (oracle.jdbc.driver.OraclePreparedStatement) is instantiated.
> >
> > Is there a way to get the correct OraclePreparedStatement object
> > instantiated or is a special setting (in persistence.xml or tomee.xml)
> > needed?
> >
> > Best regards,
> > Thomas
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495p4665497.html
> To unsubscribe from IllegalAccessException -
> OraclePreparedStatementWrapper, click here<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665495&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU0OTV8LTE4NTIyNTQ0OTI=
> >.
> NAML<
> http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495p4665557.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

AW: IllegalAccessException - OraclePreparedStatementWrapper

Posted by tschuler <th...@opentext.com>.
Hi Romain!

Maybe a custom dictionary could help.
But regarding to OpenJPA documentation (http://ci.apache.org/projects/openjpa/trunk/docbook/manual/main.html) chapter 4.4 (OracleDictionary Properties):

UseSetFormOfUseForUnicode: Prior to Oracle 10i, statements executed against unicode capable columns (the NCHAR, NVARCHAR, NCLOB Oracle types) required special handling to be able to store unicode values. Setting this property to true (the default) will cause OpenJPA to attempt to detect when the column is one of these types, and if so, will attempt to correctly configure the statement using the OraclePreparedStatement.setFormOfUse. For more details, see the Oracle JDBC Programming with Unicode<http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch7progrunicode.htm#i1006858>. Note that this can only work if OpenJPA is able to access the underlying OraclePreparedStatement instance, which may not be possible when using some third-party datasources. If OpenJPA detects that this is the case, a warning will be logged.

And that's exactly what happens here.
Is a TomEE datasource a "third-party datasource" as described within the documentation?

Best regards,
                Thomas

Von: Romain Manni-Bucau [via OpenEJB] [mailto:ml-node+s979440n4665497h17@n4.nabble.com]
Gesendet: Mittwoch, 9. Oktober 2013 16:44
An: Thomas Schuler
Betreff: Re: IllegalAccessException - OraclePreparedStatementWrapper

Hi,

I think you need to set a custom dictionarry (inheriting from
oracledictionary) handling wrappers

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/9 tschuler <[hidden email]</user/SendEmail.jtp?type=node&node=4665497&i=0>>

> Hi!
>
> We are using latest TomEE 1.6.0 snapshot and an oracle database for storing
> entity beans.
>
> What we see are warning messages like:
> java.lang.IllegalAccessException: Class
> org.apache.openjpa.jdbc.sql.OracleDictionary can not access a member of
> class oracle.jdbc.driver.OraclePreparedStatementWrapper with modifiers
> "public"
>
> It happens if the database table includes "unicode" columns (e.g.
> NVARCHAR2)
> and an entity is manipulated (added, gets found by a named query or
> deleted).
>
> We did additional tests and had a look inside the OpenJPA sources. What we
> see is:
> - The warnings did NOT depend on the used JDBC driver and NOT on the oracle
> database version.
> - Checking the source code (org.apache.openjpa.jdbc.sql.OracleDictionary)
> we
> can see that a specific prepared statement object
> (oracle.jdbc.OraclePreparedStatement) is required but while creation
> (conn.prepareStatement) another object
> (oracle.jdbc.driver.OraclePreparedStatement) is instantiated.
>
> Is there a way to get the correct OraclePreparedStatement object
> instantiated or is a special setting (in persistence.xml or tomee.xml)
> needed?
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

________________________________
If you reply to this email, your message will be added to the discussion below:
http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495p4665497.html
To unsubscribe from IllegalAccessException - OraclePreparedStatementWrapper, click here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4665495&code=dGhvbWFzLnNjaHVsZXJAb3BlbnRleHQuY29tfDQ2NjU0OTV8LTE4NTIyNTQ0OTI=>.
NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495p4665557.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: IllegalAccessException - OraclePreparedStatementWrapper

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

I think you need to set a custom dictionarry (inheriting from
oracledictionary) handling wrappers

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/9 tschuler <th...@opentext.com>

> Hi!
>
> We are using latest TomEE 1.6.0 snapshot and an oracle database for storing
> entity beans.
>
> What we see are warning messages like:
> java.lang.IllegalAccessException: Class
> org.apache.openjpa.jdbc.sql.OracleDictionary can not access a member of
> class oracle.jdbc.driver.OraclePreparedStatementWrapper with modifiers
> "public"
>
> It happens if the database table includes "unicode" columns (e.g.
> NVARCHAR2)
> and an entity is manipulated (added, gets found by a named query or
> deleted).
>
> We did additional tests and had a look inside the OpenJPA sources. What we
> see is:
> - The warnings did NOT depend on the used JDBC driver and NOT on the oracle
> database version.
> - Checking the source code (org.apache.openjpa.jdbc.sql.OracleDictionary)
> we
> can see that a specific prepared statement object
> (oracle.jdbc.OraclePreparedStatement) is required but while creation
> (conn.prepareStatement) another object
> (oracle.jdbc.driver.OraclePreparedStatement) is instantiated.
>
> Is there a way to get the correct OraclePreparedStatement object
> instantiated or is a special setting (in persistence.xml or tomee.xml)
> needed?
>
> Best regards,
> Thomas
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/IllegalAccessException-OraclePreparedStatementWrapper-tp4665495.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>