Reputation: 1577
EDIT: like an answer below says, this is a bug and it's been reported by someone else.
I was trying to use Hibernate Tools to generate DTOs (this is a question I opened yesterday about that task) in a project of mine. I did an installation of Hibernate Tools in my current Eclipse Neon instance and met the problem detailed further below.
Then, I downloaded an entire JBoss Developer Studio installer and installed it so as to determine whether my Eclipse instance had a problem. To no avail.
(Note: using EclipseLink in the Eclipse instance, I can generate the entities from the diagram and the tables from the entities)
The issue I have is this exception in the Error Log view (and also as a dialog box) when creating a Hibernate configuration, i.e. when clicking the OK button in the dialog window further below:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.hibernate.tool.util.MetadataHelper.getMetadataFromMethod(MetadataHelper.java:78)
at org.hibernate.tool.util.MetadataHelper.getMetadata(MetadataHelper.java:16)
at org.jboss.tools.hibernate.runtime.v_5_1.internal.ConfigurationFacadeImpl.getMetadata(ConfigurationFacadeImpl.java:168)
at org.jboss.tools.hibernate.runtime.v_5_1.internal.ConfigurationFacadeImpl.buildMappings(ConfigurationFacadeImpl.java:106)
at org.hibernate.console.ConsoleConfiguration$4.execute(ConsoleConfiguration.java:272)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:108)
at org.hibernate.console.ConsoleConfiguration.buildMappings(ConsoleConfiguration.java:270)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:44)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:98)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:104)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:231)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.hibernate.tool.util.MetadataHelper.getMetadataFromMethod(MetadataHelper.java:72)
... 12 more
Caused by: java.lang.NullPointerException
at org.jboss.tools.hibernate.runtime.v_5_1.internal.JPAConfiguration.getMetadata(JPAConfiguration.java:36)
... 17 more
Here is a screen capture of the configuration (other than the database dialog being set to MySQL (InnoDB)
on tab Options
, I haven't touched the other options).
Here is the contents of my hibernate.properties file:
hibernate.bytecode.use_reflection_optimizer=false
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.password=verbus
hibernate.connection.url=jdbc:mysql://localhost:3306/verbus
hibernate.connection.username=verbus
hibernate.ddl-auto=none
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.format_sql=true
hibernate.search.autoregister_listeners=true
hibernate.show_sql=true
hibernate.validator.apply_to_ddl=false
hibernate.default_entity_mode=pojo
hibernate.order_inserts=true
hibernate.order_updates=true
The persistence unit exists and was created and updated using the JPA Diagram Editor component of Dali.
Whether the database is empty or tables have already been generated by EclipseLink doesn't change a thing.
I imagine that this results from a misconfiguration but the lack of hints from an error message other than just a standard exception leaves me helpless.
Is it possible to determine the exact cause of this error?
Upvotes: 1
Views: 1108
Reputation: 1
This question is a bug that in the meantime should be resolved. Try the latest Red Hat Developer Studio release. It the problem still persists, please open a JIRA issue at https://issues.jboss.org.
Upvotes: 0