简体   繁体   English

类文件javax / transaction / SystemException中不是本机或抽象的方法中的缺少Code属性

[英]Absent Code attribute in method that is not native or abstract in class file javax/transaction/SystemException

I am building an application using JBoss AS 7.1 and I am writing a test 我正在使用JBoss AS 7.1构建应用程序,并且正在编写测试

@Test
    public void testGetLoginUser() throws Exception {
        final MarketCrudService crudService = new MarketCrudService(jpaRule.getEntityManager());
        crudService.create(new Login("user1", "password"));
    }

This test depends on @Rule created which instantiates a in-memory derby db for writing test data 此测试取决于创建的@Rule ,该实例会实例化in-memory derby db以写入测试数据
When I run this test, I see following error 当我运行此测试时,我看到以下错误

java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/transaction/SystemException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at org.jboss.logging.Logger.getMessageLogger(Logger.java:2248)
    at org.jboss.logging.Logger.getMessageLogger(Logger.java:2214)
    at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:141)
    ... snipped

This happens at line 这发生在线

emFactory = Persistence.createEntityManagerFactory(persistenceUnitName, persistenceProperties);

I googled and found out the this is because jta.jar is missing, so in my pom.xml I added 我用jta.jar搜索,发现这是因为缺少jta.jar ,所以在我的pom.xml添加了

   <dependency>
        <groupId>org.jboss.spec.javax.transaction</groupId>
        <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        <version>1.0.1.Final</version>
    </dependency>

Running again did not solved the problem, how can I fix it? 再次运行并不能解决问题,该如何解决?

Adding this resolved the issue 添加此操作解决了该问题

       <dependency>
            <groupId>org.jboss.spec.javax.transaction</groupId>
            <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        </dependency>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在类文件javax / faces / webapp / FacesServlet中的非本机或抽象方法中的Absent Code属性 - Absent Code attribute in method that is not native or abstract in class file javax/faces/webapp/FacesServlet Java EE 6中类文件javax / mail / MessagingException中不是本机或抽象的方法中的缺少Code属性 - Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException in Java EE 6 ClassFormatError:在类文件 javax/mail/MessagingException 中非本机或抽象的方法中缺少代码属性 - ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException 方法中的Absent Code属性在类文件javax / servlet / ServletException中不是本机的或抽象的 - Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException class 文件 javax/validation/ConstraintViolationException 中非本机或抽象方法中的缺失代码属性 - Absent Code attribute in method that is not native or abstract in class file javax/validation/ConstraintViolationException java.lang.ClassFormatError:类文件javax / faces / FacesException中不是本机或抽象的方法中的缺少Code属性 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/FacesException java.lang.ClassFormatError:在类文件 javax/mail/MessagingException 中非本机或抽象的方法中缺少代码属性 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException java.lang.ClassFormatError:类文件javax / mail / internet / ParseException中不是本机或抽象的方法中的缺少Code属性 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/internet/ParseException 类文件javax / servlet / ServletException中不是本机或抽象的方法中的Embedded Jetty Absent Code属性 - Embedded Jetty Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException JPA ClassFormat 错误“类文件 javax/persistence/Persistence 中非本机或抽象的方法中缺少代码属性” - JPA ClassFormat Error "Absent Code attribute in method that is not native or abstract in class file javax/persistence/Persistence"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM