0 Replies Latest reply on Mar 30, 2008 4:54 AM by jwenting

    problem with resource definition in chapter 11

      The "min" resource gives a runtime exception on deployment:

      10:47:10,182 WARN [ServiceController] Problem starting service jboss.j2ee:service=EJB3,module=core.jar
      java.lang.RuntimeException: Failed to convert: min to type:int
       at org.jboss.injection.ResourceHandler.handlePropertyAnnotation(ResourceHandler.java:484)
       at org.jboss.injection.ResourceHandler.handleFieldAnnotations(ResourceHandler.java:325)
       at org.jboss.injection.InjectionUtil.processFieldAnnotations(InjectionUtil.java:137)
       at org.jboss.injection.InjectionUtil.processAnnotations(InjectionUtil.java:174)
       at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:358)
       at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:140)
       at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:292)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:356)
       at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
      
      .....
      
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: NYI
       at org.jboss.injection.ResourceHandler.handlePropertyAnnotation(ResourceHandler.java:477)
       ... 107 more
      


      This on JBoss 4.2.2GA running against JDK 1.5.
      Remove the @Resource annotation on the minCheckNumber and the bean deploys fine (so there's probably no error in the ejb-jar.xml or that would have caused a deployment failure all its own).
      Am I missing an entry in jboss.xml that causes the ejb-jar entry to be skipped maybe? The book doesn't mention such an entry.

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
       version="3.0">
       <enterprise-beans>
       <session>
       <ejb-name>ProcessPaymentBean</ejb-name>
       <env-entry>
       <env-entry-name>min</env-entry-name>
       <env-entry-type>java.lang.Integer</env-entry-type>
       <env-entry-value>250</env-entry-value>
       </env-entry>
       </session>
       </enterprise-beans>
      </ejb-jar>