Monday, December 3, 2012

Re: Problem to connect to CloudSQL on Websphere 7

I'm running on Windows 7. Prefs are stored on windows registry, ok? I don't have this files.


On Mon, Dec 3, 2012 at 4:48 PM, Rob Clevenger <rcleveng@google.com> wrote:
Not sure, one thing that may work is to find out where it's using as it's Prefs location and copy the files there.

Rob


On Mon, Dec 3, 2012 at 10:46 AM, Fábio Peruchi <fhperuchi@ciandt.com> wrote:
Is there something I can do in this case?


On Mon, Dec 3, 2012 at 3:35 PM, Rob Clevenger <rcleveng@google.com> wrote:
Websphere must be changing the location where java stores it's java.util.Preferences then for a user.

Rob


On Mon, Dec 3, 2012 at 9:31 AM, Fábio Peruchi <fhperuchi@ciandt.com> wrote:
Please ignore only the last e-mail. It's working on Jetty 6.1.10, but it's not working on Websphere Application Server v7.

Thanks,

Fábio Peruchi


On Mon, Dec 3, 2012 at 3:24 PM, Fábio Peruchi <fhperuchi@ciandt.com> wrote:
I'm getting this error running my application from Jetty 6.1.10 too:

java.sql.SQLException: Unable to load OAuth2 refresh or access token. Please run the google_sql command line tool once to setup cached credentials. See: http://code.google.com/apis/sql/docs/commandline.html
at com.google.cloud.sql.jdbc.internal.Exceptions.newInvalidParameterException(Exceptions.java:131)
at com.google.cloud.sql.jdbc.internal.Util.checkParameter(Util.java:222)
at com.google.cloud.sql.Driver.connect(Driver.java:94)
at com.google.cloud.sql.Driver.connect(Driver.java:31)

Can anyone help me?

Thanks.

Fábio Peruchi


On Mon, Dec 3, 2012 at 2:06 PM, Fábio Peruchi <fhperuchi@ciandt.com> wrote:
I got this error on Windows 7 Ultimate 64 bits and Linux version 2.6.32-5-amd64 (Debian 2.6.32-31) using the JDK below:

java version "1.6.0"
Java(TM) SE Runtime Environment (build pxa6460sr7ifix-20100220_02(SR7+IZ69890+IZ70326))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460sr7-20100219_54097 (JIT enabled, AOT enabled)
J9VM - 20100219_054097
JIT  - r9_20091123_13891
GC   - 20100216_AA)
JCL  - 20091202_01


On Mon, Dec 3, 2012 at 1:34 PM, Fábio Peruchi <fhperuchi@ciandt.com> wrote:
Gustavo,

I tried to do what you suggested, but I got this error:

C:\google_sql_tool>google_sql.cmd <instance> <database>
Please authorize Google SQL Service for your Google Account at:
Enter Authorization Code: <token_returned_by_url_above>
Exiting; Unable to open connection.
Unable to fetch OAuth2 tokens.

Guys,

Any other suggestion?

Thanks

Fábio Peruchi

On Mon, Dec 3, 2012 at 1:07 PM, Gustavo Concon <gustavoc@ciandt.com> wrote:
Hi,
I think that happens because when you execute by command line, the credentials are cached at the JVM of the JAVA_HOME environment. So, Websphere runs on its own JVM (%WAS_HOME%/java).

Try to change the JAVA_HOME to point to WAS JVM, runs the google_sql.sh then try again.

Em segunda-feira, 3 de dezembro de 2012 10h07min38s UTC-2, Robson Brock escreveu:
Hi all,

We have a problem when try to connect a CloudSQL database from IBM Websphere 7.
If we try to connect own application by command-line or JUnit on Eclipse Juno, the return is OK (no problem).
However, when we try to connect from IBM Websphere 7, running on my local machine, we receive this error:

java.sql.SQLException: Unable to load OAuth2 refresh or access token. Please run the google_sql command line tool once to setup cached credentials. See: http://code.google.com/apis/sql/docs/commandline.html


The code used is:

DriverManager.registerDriver(new com.google.cloud.sql.Driver());
Connection c = DriverManager
.getConnection("jdbc:google:rdbms://<my_instance>/<my_database>");


Thanks.








No comments:

Post a Comment