1

We are receiving the following exceptions in one of our code :

java.lang.IllegalAccessError: tried to access class base.BaseMessage from class message.beans.TerminalPowerCommandProducer$Proxy$_$$_WeldSubclass

Our class structure is as follows :

The Base Message creator class with default message properties

package messages.base    
//... required imports
abstract class BaseMessage{ //some protected variables and methods }

the intermediate message class with extension to BaseMessage some additional properties for specific message types

package messages.base
//... required imports
public abstract class PowerMessage extends BaseMessage {//some more protected variables and Logger(using @Inject) and methods}

The actual implementation of the above abstract classes

package messages.beans
//... required imports
@Named    
public class TerminalCommandMessage extends PowerMessage {// some more variables with injections and methods with abstract method implementation}

This class is now injected in some other classes :

package messages.beans
@Named
public class TerminalPowerCommandProducer {

@Inject
TerminalCommandMessage commandMessage

//some other code

}

We are receiving exception as reported above.

We are using WildFly version 10.1.0 Final with jdk 8

Is there an issue with the way we have consumed it? Because if we mark the BaseMessage class as public it all works fine.

0 Answers0