我的项目使用gwt maven hibernate.并在我的项目中使用一个库来创建会话工厂,使用
configuration configuration = new annotation configuration();session factory = configuration . configure(config file)。buildSessionFactory();
并将其返回给我的应用程序。但是我得到了例外:
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
at com.appops.server.data.hibernate.SessionProvider.createSessionFactory(SessionProvider.java:47)
at com.appops.server.data.hibernate.HibernateDataSourceConnector.init(HibernateDataSourceConnector.java:39)
at com.engile.server.services.ConfigurationServlet.init(ConfigurationServlet.java:49)
at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:117)
at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:82)
at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:102)
at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:172)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39)
at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)
但当我使用
配置配置=新配置();会话工厂=configuration.configure(配置文件). buildSessionFactory();
Its throwing :
Caused by: org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.common.Stock"/>
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1600)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
我的pom.xml看起来像:
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>appops_shared</groupId>
<artifactId>appops_shared</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>appops_client</groupId>
<artifactId>appops_client</artifactId>
<version>1.0</version>
</dependency>
<!-- <dependency> <groupId>appops_server</groupId> <artifactId>appops_server</artifactId>
<version>1.0</version> </dependency> -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>local.mvp4g</groupId>
<artifactId>mvp4g</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.google.gwt.inject</groupId>
<artifactId>gin</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.8</version>
</dependency>
<dependency>
<groupId>com.googlecode.gwtupload</groupId>
<artifactId>gwtupload</artifactId>
<version>0.6.4</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mailapi</artifactId>
<version>1.4.3</version>
</dependency>
<!-- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.7.Final</version>
</dependency> -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.gwtphonegap</groupId>
<artifactId>gwtphonegap</artifactId>
<version>1.8.1.0</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-gwt-server</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-gwt-poll</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-gwt-common</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-compat-tomcat</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-compat-tomcat7</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-compat-jbossweb</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assisted-inject</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
<version>1.11.0-beta</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-servlet</artifactId>
<version>1.11.0-beta</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-gwt-client</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.1.7.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>gwt-oauth2</groupId>
<artifactId>gwt-oauth2</artifactId>
<version>0.2</version>
<classifier>alpha</classifier>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwtVersion}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.0.GA</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.5.6-Final</version>
</dependency>
</dependencies>
我不明白哪个罐子丢失了,或者我使用的罐子版本不正确。有人能帮我摆脱这个异常吗?
根据 http://docs.oracle.com/javase/7/docs/api/java/lang/IncompatibleClassChangeError.html:
当某些类定义发生不兼容的类更改时引发。当前执行的方法所依赖的某个类的定义已经改变。
我注意到您的类路径中有两个可能冲突的hibernate类,一个来自com.appops.server.data。从org.HibernateHibernate另一个,这可能是导致您问题的原因吗?
我在JRE 1.6上用Jersey 1.13写了几个REST服务。在本地一切运行正常,但是在我部署到GAE后,我得到了这个错误: 任何帮助将不胜感激。
我一直试图编译这个简单的警报对话框,以便在用户单击提交按钮时显示。编译代码时会弹出一条错误消息: 错误:(33,74)错误:不兼容的类型: 这个类叫做Login_Activity,它扩展了BaseActivity,它扩展了Activity。
我有下面的Kotlin代码。一个名为的密封类和两个对象类和继承自密封类。我在is Cat情况下的子句中得到这个错误。 为什么会给出这个错误?如何使用Kotlin中的密封类来进行这种类型的操作?密封类是做多态的好选择吗?
问题内容: 我正在学习Java。我试图运行代码,但出现此错误:。它向我显示错误的代码部分。 为什么会这样呢? 问题答案: 这是因为在类中不能有两个具有相同名称但返回类型不同的方法。 子类不能使用与返回类型不同的超类中已经存在的方法相同的名称声明方法。 但是,子类可以声明具有与超类相同的签名的方法。我们称此为“覆盖”。 你需要这个 要么 一个好的做法是通过注释标记覆盖的方法:
我的函数类似于以下简化代码示例: 当我运行Mypy(版本0.52)我得到这个错误: 错误指向代码示例中的倒数第二行。为什么mypy返回此错误?我的代码是无效的(以任何方式)还是一些mypy错误?
我们有: 在models.py 在serializers.py 当我通过mypy检查它时: 资源/序列化程序。py:67:错误:赋值中的类型不兼容(表达式的类型为“Union[Any,object]”,变量的类型为“int”) 请通过mypy进行检查: 资源/serializers.py:68:错误:查找'language_id'的不兼容类型:(得到了"Union[any,对象]",预期为"Uni