Hi,
I pretty new to Hibernate. I am trying to use Hibernate annotations with Struts.
Now, I am using this plug-in for Struts I found on the Hibernate webiste (HibernatePlugin), but because I am using annotations I thought I had to change
configuration = (new Configuration()).configure(configFileURL);
_factory = configuration.buildSessionFactory();
to
configuration = (new AnnotationConfiguration()).configure(configFileURL);
_factory = configuration.buildSessionFactory();
When I am starting up my (tomcat, latest version) I got this error:
java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
at org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming(Ejb3JoinColumn.java:284)
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:206)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:45)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:288)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
at org.myemps.util.HibernatePlugIn.initHibernate(HibernatePlugIn.java:123)
at org.myemps.util.HibernatePlugIn.init(HibernatePlugIn.java:100)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
...
Can somebody tell me what this means (ok, I noticed the signature is org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(String, String, String) and this thing is passing 4 arg (if I am reading the error right).
And the next question, how can I solve this?
I am using the the latest non-beta versions for Hibernate en Hibernate Annotations.
Thanks alot in advance :)
|