2

I just start with EJBs and have problem with CDI bean @Inject. At deploying and start glassfish server return error message like:

deploy is failing=Error occurred during deployment: Exception while loading the app : CDI deployment failure:Error while loading class com.bwm.servlet.SecurityFilter. Please see server.log for more details.

Logs:

2015-01-03T13:15:36.124+0100|Severe: Exception while loading the app : CDI deployment failure:Error while loading class com.bwm.servlet.SecurityFilter org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class com.bwm.servlet.SecurityFilter ...

Caused by: java.lang.NoClassDefFoundError: Lcom/bwm/beans/interfaces/UserService; at java.lang.Class.getDeclaredFields0(Native Method)...

Caused by: java.lang.ClassNotFoundException: com.bwm.beans.interfaces.UserService...

EJB interface declaration:

    @Local
public interface UserService {

    public BWMResult<String> getUserLogin(Integer userId);
    public BWMResult<User> getUser(String login, String password);
}

EJB:

@Stateless
@Local(UserService.class)
public class UserServiceBean implements UserService {

Security filter in which I try to @Inject EJB:

public class SecurityFilter implements Filter {

@Inject
UserService userService;

EJB is in other project module than SecurityFilter(I add EJB project in build path of SecurityFilter project)

What I do wrong ?

Thnaks in advance.

PDS
  • 562
  • 3
  • 13
  • 27
  • Are you deploying a WAR or an EAR? – John Ament Jan 03 '15 at 17:54
  • I deploy by eclipse by add, it's maybe WAR – PDS Jan 03 '15 at 20:00
  • It looks like however you're building your war...ear... you don't even know what, it's not including the listed classes. – John Ament Jan 03 '15 at 23:55
  • Looks like your EJB interfaces are not in the classpath of your web module. Are these modules in the same EAR? You need to add your ejb module to the web module classpath. If you are developing using Eclipse do it via Properites > Deployment assembly. Otherwise you would need to add it to the Manifest.mf file. – Gas Jan 04 '15 at 20:45

0 Answers0