Can't deploy EAR application with injected ProcessEngine

Hello,

i have created simple EAR-Maven Project with a Stateless-Session Bean. The code is simple like this:

@Stateless
@Remote(NewInterface.class)
public class NewSessionBean implements NewInterface {
@Inject
private ProcessEngine engine;

@Override
public String businessMethod() {
    return this.engine.getName();
}

}

and an initialization Bean, which should be called on Startup:

@Singleton
@Startup
public class InitializationBean {
@EJB
private NewInterface test;

@PostConstruct
private void initialize(){
    String businessMethod = this.test.businessMethod();
    int x = 0;
}

}

But if i want to deploy the application i get an Exception…

{“WFLYCTL0080: Failed services” => {“jboss.deployment.unit."Processapplicationejbs2-ear-1.0.ear".PARSE” => “org.jboss.msc.service.StartException in service jboss.deployment.unit."Processapplicationejbs2-ear-1.0.ear".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "Processapplicationejbs2-ear-1.0.ear"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Class org.camunda.bpm.application.impl.ejb.DefaultEjbProcessApplication is annotated with @ProcessApplication but is neither a ServletProcessApplication nor an EJB Session Bean Component.”}}

This is my ejb-module pom.xml:ejb_module_pom.xml (4.6 KB)

this is my ear pom.xml: ear_pom.xml (1.8 KB)

And this is the pom.xml of the parent general maven project, which holds the ear and the ejb-module-project: pom.xml (593 Bytes)

What i’m missing here? I would be really grateful to you if you can say, what i’m missing here.

Thanks a lot and best regards
Andy

I’m guessing here - but, didn’t see any comments so far…

Here I go then:

I use WildFly/JBoss -

Singleton vs ApplicationScoped
I did want to share my experience here…

I had been using the @Singleton for something else… basically, a property manager. Then, when I added the WildFly Apache Camel extension, along with a Camel RouteBuilder, I started getting errors when I added another @Singleton. I used this to define the Camel configure() method and load the routes/exchanges.

I fixed this problem by replacing @Singleton(s) with the @Startup and @ApplicationScoped annotations.