New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There was no valid EOF ClassLoader factory defined. #157
Comments
@rgurley can you tell us which OS, JDBC Adaptor, and driver you're using? One of my co-workers has the same issue when generating SQL from EntityModeler on Linux. The same project works for me on Mac OS. We're using the Derby plug-in with the EmbeddedDriver. |
In this case, I believe it was big sur, postgresql. I get those on a M1 MBA, but a colleague also has the problem on a new intel MBP. I also tried on linux, and perhaps this is a different issue, because it didn't work due to a class not found on NSDictionary. I haven't had much time to dig into why it fails since trying it. |
On my linux box, I get,
And wolips properties looking like,
I'll see if I can figure out how to get a wolips dev environment set up again to find the problem. |
So far what I've found is that in the case of a maven project at least, it is not finding the WO frameworks. They must be included on the Eclipse build path. When I add
Then I get a different error, with the root cause being,
|
And this happens, because line 527 of NSBundle calls BundlesNamesTable.objectForKey("JavaJDBCAdaptor") and returns null because BundlesNamesTable is an empty NSMutableDictionary {} |
It appears NSBundle.CreateBundleWithPath() is the only thing that populates that private static final dict. That is called by NSBundle._bundleWithPathShouldCreateIsJar() which is public, but I can't open call hierarchy on it. I can see that is called inside NSBundle by
I assume one of these should be called by WOLips to populate the dict, but maybe they're called indirectly via some other WO methods... When I search my WOLips workspace, I don't see any of these 5 called anywhere. When I set a breakpoint in CreateBundleWithPath, it never stops. |
InitMainBundle, LoadBundlesFromJars, LoadBundlesFromClassPath are all private and called in the static initializer. Perhaps it is failing somewhere here. |
At NSBundle:331 FactoryURLClassLoader.getResources("Resources/Info.plist") returns an enumeration where hasNextElement is false. From there LoadBundlesFromJars is called with an empty urlArray, when it seems like it should be an array of WO jars on the classpath for the WOLips plugin. I can see them under Referenced Libraries and they do have a Resources/Info.plist file in the org.objectstyle.wolips.eomodeler as well as the org.objectstyle.wolips.eomodeler.core project. |
As for LoadBundlesFromClassPath, the static initializer is arriving at an array of ( /opt/eclipse/plugins/org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar, But the cleaned up classpath only contains the first entry. It seems like this should contain the frameworks if it were to load them. InitMainBundle doesn't seem like the correct place to load the WO frameworks, just based on the name... |
Summary so far, It seems like there are two separate problems here. One is the entity modeler should be looking for WO frameworks on the plugin classpath, not the project classpath. Two is the fact that those frameworks are not loading when NSBundle loads. Maybe the first is supposed to be that way to find database specific adaptors though. |
I expect that this is all related to the Classloader-Workaround because of the NextStep-Classes which are used by the SQL-Generator-Tool. Short version of it: The SQL-Generator-Tool needs the WO-Jars. But due to the licence-problem that they cannot be shipped with the WOLips-Tool. To circumvent this some classpath-workaround is used. Based on your description this workaround seems to have a problem in your setup |
I've tracked the origin of the classloader that comes up empty handed at NSBundle:331 down to org.objectstyle.wolips.eomodeler.core.model.IEOClassLoaderFactory.Utility.createClassLoader(). It seems like if I can help this classloader find the WO jars, then it may fix the problem. |
While stepping through with a debugger last night I noticed the classpath loading branched on whether or not the jvm is modular. It made me think that maybe this issue is related to the jigsaw modulepath stuff from Java 9. I installed jdk8 and added that to my installed JREs in eclipse, then in the pom, set the target/source to 8 and the classloader could now find all the woframework jars in my .m2/repository. I still get a "could not find a suitable driver for jdbc:postgres..." but the main problem with wo jars being missing went away. I could clear them off the eclipse build path as they were no longer needed there either. I need to step through with the debugger and see how it is working with 8 and then try to find a way to make it work with latest java. |
I believe I've found and fixed the cause of the issue. See #158 |
merged pr |
On Eclipse 2021-06, opening the SQLGenerator dialog gives me,
The reverse generation tool gives me the same message in a dialog, but with a different stack trace,
The text was updated successfully, but these errors were encountered: