Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:21:21+00:00 2026-06-15T18:21:21+00:00

While executin the test (test looks like this: http://tomee.apache.org/examples-trunk/application-composer/README.html ), I always get: java.lang.NoSuchMethodError:

  • 0

While executin the test (test looks like this: http://tomee.apache.org/examples-trunk/application-composer/README.html), I always get:

java.lang.NoSuchMethodError: org.apache.openejb.jee.ManagedBean.<init>(Ljava/lang/String;Ljava/lang/String;Z)V
    at org.apache.openejb.junit.ApplicationComposer$DeployApplication.evaluate(ApplicationComposer.java:194)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

I try to use Maven in order to get all the dependencies right. Here is the list of dependencies:

<dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.21</version>
        </dependency>
        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0-4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-jee</artifactId>
            <version>4.0.0-beta-1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.openjpa</groupId>
            <artifactId>openjpa-persistence-jdbc</artifactId>
            <version>2.2.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
        </dependency>
        <dependency>
            <groupId>org.apache.openejb</groupId>
            <artifactId>openejb-junit</artifactId>
            <version>4.5.0</version>
        </dependency>
 <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>3.4.2</version>
        </dependency>

The test should check an EJB-DAO. It is used to write an Entity in the DB and get it out of it again. Here is the test code:

    import com.dlrg.dao.impl.RadioMessageDAOImp;
import com.dlrg.entity.RadioMessage;
import org.apache.openejb.jee.EjbJar;
import org.apache.openejb.jee.StatefulBean;
import org.apache.openejb.jee.jpa.unit.PersistenceUnit;
import org.apache.openejb.junit.ApplicationComposer;
import org.apache.openejb.junit.Configuration;
import org.apache.openejb.junit.Module;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import java.util.List;
import java.util.Properties;

@RunWith(ApplicationComposer.class)
public class RadioMessageDAOTest {

    @EJB
    private RadioMessageDAOImp radioMessageDAO;

    @Resource
    private UserTransaction userTransaction;

    @PersistenceContext
    private EntityManager entityManager;

    @Configuration
    public Properties config() throws Exception {
        Properties p = new Properties();
        p.put("MySQLtest", "new://Resource?type=DataSource");
        p.put("MySQLtest.JdbcDriver", "org.hsqldb.jdbcDriver");
        p.put("MySQLtest.JdbcUrl", "jdbc:hsqldb:file:data/hsqldb/hsqldb");
        return p;
    }

    @Module
    public PersistenceUnit persistence() {
        PersistenceUnit unit = new PersistenceUnit("radio-unit");
        unit.setJtaDataSource("MySQLtest");
        unit.setNonJtaDataSource("radioDatabaseUnmanaged");
        unit.getClazz().add(RadioMessage.class.getName());
        unit.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
        return unit;
    }

    @Module
    public EjbJar beans() {
        EjbJar ejbJar = new EjbJar("radio-beans");
        ejbJar.addEnterpriseBean(new StatefulBean(RadioMessageDAOImp.class));
        return ejbJar;
    }



    @Test
    public void test() throws Exception {

        userTransaction.begin();

        try {
            entityManager.persist(new RadioMessage());

            List<RadioMessage> list = radioMessageDAO.getAll();
            Assert.assertEquals(1, list.size());

            for (RadioMessage movie : list) {
                radioMessageDAO.delete(movie);
            }

            Assert.assertEquals(0, radioMessageDAO.getAll().size());

        } finally {
            userTransaction.commit();
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:21:23+00:00Added an answer on June 15, 2026 at 6:21 pm

    Rather use

    org.apache.openejb
    openejb-jee
    4.5.0

    You are mixing a beta version and version 4.5.0 of the OpenEjb stuff. That can’t work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to show loadingActivity while activity1 is executing some code (working), after
I've created a little wpf test application which renders some random rectangles every 30
I expected that Pageheap will force my application to crash while executing the 2nd
I'm trying to run junitreport task in Ant in Ant in Maven: <plugin> <groupId>org.apache.maven.plugins</groupId>
Hi i am using spring framework and while executing annotationbased test case i am
I am getting following error while executing a unti test case(JUNIT).I am using it
I am trying to test setting application using JunitTestcase .My class extends ActivityInstrumentationTestCase2 .
Using PHP , I would like to make a while loop that reads a
while executing the following query, i get an error that there's an error in
I have a problem while executing a SSIS script component. To be honest I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.