Re: Wonder upgrade 6 to 7
Re: Wonder upgrade 6 to 7
- Subject: Re: Wonder upgrade 6 to 7
- From: Chuck Hill <email@hidden>
- Date: Fri, 13 Oct 2017 18:50:56 +0000
- Thread-topic: Wonder upgrade 6 to 7
Hi Rachel,
The problem with that property seems to be that two different pieces of code
are using it and one still has the old name.
The question you really need to answer is why the principal class getting
initialized is affecting your DB connection:
https://github.com/wocommunity/wonder/blob/master/Frameworks/EOAdaptors/JavaERJDBCAdaptor/Sources/er/jdbcadaptor/PrincipalClass.java
All that is doing is setting the delegate:
https://github.com/wocommunity/wonder/blob/master/Frameworks/EOAdaptors/JavaERJDBCAdaptor/Sources/er/jdbcadaptor/ERAdaptorContextDelegate.java
I had a brief look at this and did not see anything that looked suspicious.
Chuck
From: Rachel Han <email@hidden>
Date: Thursday, October 12, 2017 at 8:45 PM
To: Chuck Hill <email@hidden>
Subject: Re: Wonder upgrade 6 to 7
Hi Chuck,
Thank you so much for your reply. :)
So I went to check why the build.properties file in JavaJDBCAdaptor framework
get changed from the git history, then I find
this:(https://github.com/wocommunity/wonder/commit/3b4161daefdc883e0ce7f69bb8dbeea5003b05f6#diff-443c66aa35046e768ef88a148b081593)
Here are the comments on the commit:
====================================
ressurect principalClass property
Temporarily ressurect the principalClass property as the build files bundled
with WOLips are looking for that instead of project.principal.class and thus
will produce problems when you run a project within Eclipse instead of running
the ant build that uses the build.xml files from Wonder. We will remove that
when WOLips has been updated…
========================================
Should I wait for the build.properties get changed back to previous version in
the future? I will still go through the principle class and see what breaks the
DB connection and will report back if anything interesting comes up.
Thank you again for your help and it is really appreciated.
Cheers,
Rachel
On 13 October 2017 at 06:03, Chuck Hill
<email@hidden<mailto:email@hidden>> wrote:
Hi Rachel,
One clarification: the NSPrincipal class in a bundle (.framework usually), is
loaded and initialized (static init done) when NSBundle loads the bundle at the
start of application launch. That class can then do any runtime configuration
that the bundle needs. Something in er.jdbcadaptor.PrincipalClass must be
doing something that affects your database connections, check the code to see
what.
This file is generated from the (from memory) woantbuild.properties file in the
framework. Or maybe wobuild.properties.
Chuck
From: Webobjects-dev
<webobjects-dev-bounces+chill=email@hidden<mailto:email@hidden>>
on behalf of Rachel Han
<email@hidden<mailto:email@hidden>>
Date: Wednesday, October 11, 2017 at 5:52 PM
To: "email@hidden<mailto:email@hidden>"
<email@hidden<mailto:email@hidden>>
Subject: Wonder upgrade 6 to 7
Hi All,
I am a webobjects developer for a few years now and we have a project which is
about 10 years old, so it is kind of hibernation of legacy and sweetness of
wonder. We were doing wonder upgrade from 6 to 7 and like to share our
experience in the forum so it would be of any help if anyone having the same
issue.
Firstly, of course download wonder7 from jenkins latest build, and copied all
the frameworks over to Library/Frameworks. And then reopen eclipse oxygen
(eclipse caches frameworks, so need to be reopened and then clean the project),
after fixed all the compile error,
Then run the application gave me this exception:
Oct 12 09:21:27 xxx[51032] WARN NSLog - An exception occurred while trying to
open a channel: N/A
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.Exceptions - Database
Exception occured: java.lang.IllegalStateException: _obtainOpenChannel --
er.extensions.eof.ERXDatabaseContext
er.extensions.eof.ERXDatabaseContext@4e31276e: failed to open database channel.
Check your connection dictionary, and ensure your database is correctly
configured.
Oct 12 09:21:27 xxx[51032] INFO er.extensions.eof.ERXDatabaseContextDelegate
- xxx: {username = "xxx"; driver = "oracle.jdbc.driver.OracleDriver";
DataSourceJndiName = "xxx"; password = "<password deleted for log>"; URL =
"jdbc:oracle:thin:@xxx"; }
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Checking JDBC connection with information {username = "xxx"; driver =
"oracle.jdbc.driver.OracleDriver"; DataSourceJndiName = "xxx"; password =
"<password deleted for log>"; URL = "jdbc:oracle:thin:@xxx"; }
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Trying to create JDBCAdaptor...
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Successfully created adaptor class er.extensions.jdbc.ERXJDBCAdaptor
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Trying to create plugin...
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Created plugin class com.webobjects.jdbcadaptor.EROraclePlugIn
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Trying to load JDBC driver oracle.jdbc.driver.OracleDriver...
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Successfully loaded JDBC driver oracle.jdbc.driver.OracleDriver
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
JDBC driver and plugin are loaded, trying to connect...
Oct 12 09:21:27 xxx[51032] INFO er.transaction.adaptor.ConnectionAnalyzer -
Error: Exception thrown while connecting.
Check exception message carefully.
Oct 12 09:21:27 xxx[51032] ERROR er.transaction.adaptor.ConnectionAnalyzer -
No connection.
Oct 12 09:21:27 xxx[51032] WARN NSLog - A fatal exception occurred:
_obtainOpenChannel -- er.extensions.eof.ERXDatabaseContext
er.extensions.eof.ERXDatabaseContext@4e31276e: failed to open database channel.
Check your connection dictionary, and ensure your database is correctly
configured.
[2017-10-12 9:21:27 AEDT] <main> java.lang.IllegalStateException:
_obtainOpenChannel -- er.extensions.eof.ERXDatabaseContext
er.extensions.eof.ERXDatabaseContext@4e31276e: failed to open database channel.
Check your connection dictionary, and ensure your database is correctly
configured.
at
com.webobjects.eoaccess.EODatabaseContext._obtainOpenChannel(EODatabaseContext.java:1967)
Then, for the purpose of pinpointing exactly which framework is causing this
error, I tried to upgrade the frameworks batch by batch. so firstly I upgraded
all frameworks in wonder/core, and again reopen eclipse and clean, the
application started up ok. Secondly, I upgraded all frameworks in EOAdaptor,
the application did not start up and gave me the error, so it is obviously one
of the frameworks in EOAdaptor is causing the issue. At this moment, everything
looks simple enough, we only were using JavaERJDBCAdaptor framework.
After comparing everything in the JavaERJDBCAdaptor framework between wonder6
and wonder7, only one difference is in the info.plist file
in wonder7, these two lines were added:
<key>NSPrincipalClass</key>
<string>er.jdbcadaptor.PrincipalClass</string>
From my understanding (or guessing) is that, at runtime, anytime there is a
NSPrincipalClass instance, the wonder will replace it with a
er.jdbcadaptor.PrincipalClass instance.
Anyway, after removed these 2 lines, the application started up correctly.
Obviously this is not a common circumstance, but hopefully, if anyone is having
the same issue, then they could try to tackle it using the similar method.
And also, if anyone would help me understand how this info.plist get built into
the wonder framework package, it would be really appreciated.
Thanks in advance.
Cheers,
Rachel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden