Seam Injection on EJB fails IllegalArgumentException: object is not an instance of declaring class in JBoss EAP

Solution Verified - Updated -

Issue

  • Our application is a JEE 5 application using Seam which fails to inject on EJB components. They are found using JNDI without any issues, but injection of entitymanagers or other components fails. The error below is in the log:
...
Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: PrintJobDaoImpl.setEntityManager(javax.persistence.EntityManager) with parameters: (org.jboss.seam.persistence.EntityManagerProxy) on: com.jboss.examples.jpa.ExampleDaoImpl
  at org.jboss.seam.util.Reflections.invoke(Reflections.java:32)
  at org.jboss.seam.Component.setPropertyValue(Component.java:1914)
  ... 158 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
  ... 159 more

Environment

  • JBoss Enterprise Application Platform
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content