Business Exception is not in the Clientejb classpath

Asked

Viewed 50 times

3

I have the following situation:

EJB PROJECT

public BussinessException extends Exception {}

public MyInterfaceImplementation implements MyInterface {}

EJB PROJECT CLIENT

public interface MyInterface {
    public void foo() throws BussinessException;    
}

Only that the exception (BussinessException) is not in the classpath of EJBClient. How to solve this problem?? I can’t put the EJB project (physical) on the client’s classpath.

2 answers

1

Complementing André’s reply (I wanted to comment). Here is a visual example:

diagrama

Interestingly, a user from another forum asked a similar question, and I uploaded a Maven project on github with a similar structure, to view, click here.

0

How about three projects?

  • API project: contains its interfaces and business exceptions.
  • EJB Project: implements its interfaces and depends on the API Project jar.
  • Client Project: Accesses your EJB project and also depends on the API Project jar.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.