JBoss Community

Using netty causes an classloader issue.

created by Michael Erdmann in JBoss AS 7 Development - View the full discussion

Actually i am trying to implement a small tcp/ip server using google protobuf and netty. At the end an event handler from the netty pipeline will be called which passes the specified message to the server logic. Before invoking the server logic i planned to decode the actual tcp/ip package using the code fragment below.

 

public class ServerHandler extends SimpleChannelHandler {

 

   @Override

    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {  

       ServerCommand req = (ServerCommand) e.getMessage();

       ServerNotification rsp = ServerNotification.newBuilder(). .... .build();

    }

}

 

When the client sends a message to the server i get on the server side:

 

1:29:36,362 WARN  [org.jboss.modules] (New I/O server worker #33-1) Failed to define class site.boavista.community.itf.ClientITF$ServerCommandOrBuilder in Module "deployment.MyCommunityJBoss.war:main" from Service Module Loader: java.lang.LinkageError: Failed to link site/boavista/community/itf/ClientITF$ServerCommandOrBuilder (Module "deployment.MyCommunityJBoss.war:main" from Service Module Loader)

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

...

     at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]

Caused by: java.lang.NoClassDefFoundError: com/google/protobuf/MessageLiteOrBuilder

 

which is quite surprising to me since to corrsponding jar of the protobuf package is included in the deployment war file. I would have expected this to be sufficent. Has anybody encountered such an issue already?

 

Regards

  M.Erdmann

 

Attached the exception log. The source code is avaiable under git://github.com/merdmann/MyCommunityJBoss.git

The intersting package is site.boavista.jboss.view; pls. igonore the other packages since they are not yet called and need

some rework.

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community