[JBoss JIRA] (JBIDE-19792) antlr packages and lib not exported in Hibernate Tools 4.0.1
by Koen Aers (JIRA)
[ https://issues.jboss.org/browse/JBIDE-19792?page=com.atlassian.jira.plugi... ]
Koen Aers updated JBIDE-19792:
------------------------------
Fix Version/s: 4.3.x
> antlr packages and lib not exported in Hibernate Tools 4.0.1
> ------------------------------------------------------------
>
> Key: JBIDE-19792
> URL: https://issues.jboss.org/browse/JBIDE-19792
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: hibernate
> Affects Versions: 4.2.3.Final
> Environment: Eclipse Luna SR2
> Reporter: Bastian Ulke
> Assignee: Koen Aers
> Fix For: 4.3.x
>
> Attachments: B82_MANIFEST.MF, B95_MANIFEST.MF
>
>
> I am currently working on an Eclipse-Plugin that is built on top of the
> Hibernate Tools project. For example, I am using the following statements
> to get the AST of a named query:
> {code}
> try {
> HqlParser parser = HqlParser.getInstance(statementString);
> parser.statement();
> } catch (RecognitionException | TokenStreamException e) {
> e.printStackTrace();
> }
> AST statementAst = parser.getAST();
> {code}
> For this to work well with Hibernate Tools Version 4.0.0, I added bundle
> org.hibernate.eclipse.libs as required bundle to my plug-in configuration
> (which resolved to
> org.hibernate.eclipse.libs_4.0.0.Final-v20141016-1911-B82 so far).
> However, I now updated to Hiberate Tools 4.0.1
> (org.hibernate.eclipse.libs_4.0.1.Final-v20150324-2307-B95). The problem I
> have now is that the following imports cannot be resolved:
> import antlr.RecognitionException;
> import antlr.TokenStreamException;
> import antlr.collections.AST;
> The problem seems to arise from the fact, that in the new version's
> MANIFEST.MF, the antlr... packages are not exported and
> lib/hibernate/antlr-2.7.6.jar is not listed in the Bundle-ClassPath any
> more (I reformatted both MANIFEST.MFs, that you can find attached, to allow
> a convenient comparison). After manually adding the antlr-related entries
> to the new version's MANIFEST.MF, my code works pretty well again.
> I agree, that internal libraries should generally not be exported. However,
> org.hibernate.hql.ast.HqlParser is exported -- so why not its prerequesites?
> (By the way, I'd be fine with integrating another library into my project.
> However, I tried to manally add antlr-2.7.6.jar as library to
> my project, which solved the compilation error, but yields a
> java.lang.ClassNotFoundException: antlr.LLkParser cannot be found by
> org.hibernate.eclipse.libs_4.0.1.Final-v20150324-2307-B95.)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 4 months
[JBoss JIRA] (JBIDE-19830) Nullpointer at recieving schema
by Koen Aers (JIRA)
[ https://issues.jboss.org/browse/JBIDE-19830?page=com.atlassian.jira.plugi... ]
Koen Aers updated JBIDE-19830:
------------------------------
Fix Version/s: 4.3.0.Beta1
> Nullpointer at recieving schema
> -------------------------------
>
> Key: JBIDE-19830
> URL: https://issues.jboss.org/browse/JBIDE-19830
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: hibernate
> Affects Versions: 4.3.0.Alpha2
> Environment: Hibernate: 5.0.0.Alpha2-v20150417-1452-B12
> Eclipse: Eclipse Mars M7
> OS: Windows 7 x64 Enterprise
> DB: Postgres 9.3
> Reporter: Philipp Birkl
> Assignee: Koen Aers
> Fix For: 4.3.0.Beta1
>
>
> While receiving a schema from Database initially a _java.lang.NullPointerException* is thrown_.
> !http://i.imgur.com/2Frtlwu.png!
> Stack trace can be found [here|https://gist.github.com/calaedo/394f3fdb8994741de3ce#file-jbide-1983...].
> While debugging the plugin i found the problem at the implementation of the anonymous comperator in _org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(Object, IProgressMonitor)_.
> {code}
> res = toArray(result.iterator(), Object.class, new Comparator<Object>() {
> public int compare(Object arg0, Object arg1) {
> return getName(arg0).compareTo(getName(arg1));
> }
> private String getName(Object o) {
> String result = null;
> try {
> Method m = o.getClass().getMethod("getName", new Class[] {});
> m.invoke(o, new Object[] {});
> } catch (Exception e) {
> throw new RuntimeException(e);
> }
> return result;
> }
> });
> {code}
> The string result is never set. So the _compareTo_ is always failing.
> I haven't looked it up, but the problem might consist also in earlier versions of JBoss tools.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 4 months
[JBoss JIRA] (JBIDE-19792) antlr packages and lib not exported in Hibernate Tools 4.0.1
by Koen Aers (JIRA)
[ https://issues.jboss.org/browse/JBIDE-19792?page=com.atlassian.jira.plugi... ]
Koen Aers commented on JBIDE-19792:
-----------------------------------
Hi Bastian,
This is exactly what we want to avoid that people do: use the core Hibernate classes directly in the Eclipse tooling code. If you do that, you will lock yourself to one particular version of the Hibernate runtime while the tools should be as independent from the version as possible. This is why we have created a service provider plugin that exposes interfaces for all the Hibernate classes that are used in the tooling code together with service implementations for each included Hibernate version that implements all these interfaces using the proper core Hibernate classes.
Surely this does explain the problem but doesn't solve it. One solution is to create an SPI interface for the classes that you need and implement this interface in the implementation plugins. However, these interfaces could change thoroughly in the next JBoss Tools releases as the SPI is probably too fine-grained right now and needs to be reworked towards something more coarse grained. A second possibility would be to mimic the Hibernate code in your plugin itself. To start with, that is probably the easiest solution.
Cheers,
Koen
> antlr packages and lib not exported in Hibernate Tools 4.0.1
> ------------------------------------------------------------
>
> Key: JBIDE-19792
> URL: https://issues.jboss.org/browse/JBIDE-19792
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: hibernate
> Affects Versions: 4.2.3.Final
> Environment: Eclipse Luna SR2
> Reporter: Bastian Ulke
> Assignee: Koen Aers
> Attachments: B82_MANIFEST.MF, B95_MANIFEST.MF
>
>
> I am currently working on an Eclipse-Plugin that is built on top of the
> Hibernate Tools project. For example, I am using the following statements
> to get the AST of a named query:
> {code}
> try {
> HqlParser parser = HqlParser.getInstance(statementString);
> parser.statement();
> } catch (RecognitionException | TokenStreamException e) {
> e.printStackTrace();
> }
> AST statementAst = parser.getAST();
> {code}
> For this to work well with Hibernate Tools Version 4.0.0, I added bundle
> org.hibernate.eclipse.libs as required bundle to my plug-in configuration
> (which resolved to
> org.hibernate.eclipse.libs_4.0.0.Final-v20141016-1911-B82 so far).
> However, I now updated to Hiberate Tools 4.0.1
> (org.hibernate.eclipse.libs_4.0.1.Final-v20150324-2307-B95). The problem I
> have now is that the following imports cannot be resolved:
> import antlr.RecognitionException;
> import antlr.TokenStreamException;
> import antlr.collections.AST;
> The problem seems to arise from the fact, that in the new version's
> MANIFEST.MF, the antlr... packages are not exported and
> lib/hibernate/antlr-2.7.6.jar is not listed in the Bundle-ClassPath any
> more (I reformatted both MANIFEST.MFs, that you can find attached, to allow
> a convenient comparison). After manually adding the antlr-related entries
> to the new version's MANIFEST.MF, my code works pretty well again.
> I agree, that internal libraries should generally not be exported. However,
> org.hibernate.hql.ast.HqlParser is exported -- so why not its prerequesites?
> (By the way, I'd be fine with integrating another library into my project.
> However, I tried to manally add antlr-2.7.6.jar as library to
> my project, which solved the compilation error, but yields a
> java.lang.ClassNotFoundException: antlr.LLkParser cannot be found by
> org.hibernate.eclipse.libs_4.0.1.Final-v20150324-2307-B95.)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
10 years, 4 months