You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by srini raju <ra...@gmail.com> on 2009/10/26 21:10:17 UTC

javax.inject.DefinitionException: import not a Java type

I am trying to deploy the JAX-RS sample to JBOSSAS5.1.0 and i get
'javax.inject.DefinitionException: import not a Java type' error when i try
to deploy the war file. All CXF jar files are in the war file. Below is my
web.xml and beans.xml. Would appreciate some help.
================================================
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>WEB-INF/beans.xml</param-value>
 </context-param>
 <listener>
  <listener-class>
   org.springframework.web.context.ContextLoaderListener
  </listener-class>
 </listener>
 <servlet>
  <servlet-name>CXFServlet</servlet-name>
  <display-name>CXF Servlet</display-name>
  <servlet-class>
   org.apache.cxf.transport.servlet.CXFServlet
  </servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>CXFServlet</servlet-name>
  <url-pattern>/*</url-pattern>
 </servlet-mapping>
======================================================
  <import resource="classpath:META-INF/cxf/cxf.xml" />
  <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"
/>
  <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
  <jaxrs:server id="customerservice" address="/service1">
    <jaxrs:serviceBeans>
      <ref bean="customerBean" />
    </jaxrs:serviceBeans>
  </jaxrs:server>
  <bean id="customerBean" class="demo.jaxrs.server.CustomerService" />
</beans>
=======================================================

RE: javax.inject.DefinitionException: import not a Java type

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi,

http://docs.jboss.org/webbeans/apidocs/current/javax/inject/DefinitionEx
ception.html
and
http://java.sun.com/javaee/6/docs/api/javax/inject/DefinitionException.h
tml


say it's thrown if the definition of a bean is incorrect...
That said, googling for 'javax.inject.DefinitionException' does not
help...

It is something to do with the resource bean (not) adhering to the
WebBeans conventions...

Cheers, Sergey

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: 27 October 2009 19:25
To: users@cxf.apache.org
Cc: srini raju
Subject: Re: javax.inject.DefinitionException: import not a Java type


I've never seen this error before.   You may need to ask on the jboss
lists as 
I'm not sure where "javax.inject.DefinitionException" errors are thrown.
Is 
there a stack trace?

Dan


On Mon October 26 2009 4:10:17 pm srini raju wrote:
> I am trying to deploy the JAX-RS sample to JBOSSAS5.1.0 and i get
> 'javax.inject.DefinitionException: import not a Java type' error when
i try
> to deploy the war file. All CXF jar files are in the war file. Below
is my
> web.xml and beans.xml. Would appreciate some help.
> ================================================
>  <context-param>
>   <param-name>contextConfigLocation</param-name>
>   <param-value>WEB-INF/beans.xml</param-value>
>  </context-param>
>  <listener>
>   <listener-class>
>    org.springframework.web.context.ContextLoaderListener
>   </listener-class>
>  </listener>
>  <servlet>
>   <servlet-name>CXFServlet</servlet-name>
>   <display-name>CXF Servlet</display-name>
>   <servlet-class>
>    org.apache.cxf.transport.servlet.CXFServlet
>   </servlet-class>
>   <load-on-startup>1</load-on-startup>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>CXFServlet</servlet-name>
>   <url-pattern>/*</url-pattern>
>  </servlet-mapping>
> ======================================================
>   <import resource="classpath:META-INF/cxf/cxf.xml" />
>   <import
resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"
> />
>   <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>   <jaxrs:server id="customerservice" address="/service1">
>     <jaxrs:serviceBeans>
>       <ref bean="customerBean" />
>     </jaxrs:serviceBeans>
>   </jaxrs:server>
>   <bean id="customerBean" class="demo.jaxrs.server.CustomerService" />
> </beans>
> =======================================================
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: javax.inject.DefinitionException: import not a Java type

Posted by Daniel Kulp <dk...@apache.org>.
I've never seen this error before.   You may need to ask on the jboss lists as 
I'm not sure where "javax.inject.DefinitionException" errors are thrown.  Is 
there a stack trace?

Dan


On Mon October 26 2009 4:10:17 pm srini raju wrote:
> I am trying to deploy the JAX-RS sample to JBOSSAS5.1.0 and i get
> 'javax.inject.DefinitionException: import not a Java type' error when i try
> to deploy the war file. All CXF jar files are in the war file. Below is my
> web.xml and beans.xml. Would appreciate some help.
> ================================================
>  <context-param>
>   <param-name>contextConfigLocation</param-name>
>   <param-value>WEB-INF/beans.xml</param-value>
>  </context-param>
>  <listener>
>   <listener-class>
>    org.springframework.web.context.ContextLoaderListener
>   </listener-class>
>  </listener>
>  <servlet>
>   <servlet-name>CXFServlet</servlet-name>
>   <display-name>CXF Servlet</display-name>
>   <servlet-class>
>    org.apache.cxf.transport.servlet.CXFServlet
>   </servlet-class>
>   <load-on-startup>1</load-on-startup>
>  </servlet>
>  <servlet-mapping>
>   <servlet-name>CXFServlet</servlet-name>
>   <url-pattern>/*</url-pattern>
>  </servlet-mapping>
> ======================================================
>   <import resource="classpath:META-INF/cxf/cxf.xml" />
>   <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"
> />
>   <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>   <jaxrs:server id="customerservice" address="/service1">
>     <jaxrs:serviceBeans>
>       <ref bean="customerBean" />
>     </jaxrs:serviceBeans>
>   </jaxrs:server>
>   <bean id="customerBean" class="demo.jaxrs.server.CustomerService" />
> </beans>
> =======================================================
> 

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog