1 2 3 Previous Next 30 Replies Latest reply on Sep 27, 2011 5:01 AM by for1988

    Failed to inject entityManager in @FacesConverter

    jee4hire
      The entityManager is null in the defined @FacesConverter below.
      How can I get a valid handle to the entityManager inside the @FacesConverter?

      java:

      @FacesConverter("entityFileConverter")
      public class FileConverter implements Converter, Serializable {
        @Inject private EntityManager entityManager;

        @Override
        public Object getAsObject(FacesContext context, UIComponent component, String value) {
          Long id = Long.valueOf(value);
          return entityManager.find(File.class, id);
        }

        @Override
        public String getAsString(FacesContext context, UIComponent component, Object value) {
          return ((File)value).getId().toString();
        }
      }

      xhtml:


        <h:inputText label="File" id="file" required="true" value="#{job.file}">
          <f:converter converterId="entityFileConverter"/>
        </h:inputText>
        • 1. Re: Failed to inject entityManager in @FacesConverter
          lightguard

          Do you have a producer for your EntityManager?

          • 2. Re: Failed to inject entityManager in @FacesConverter
            jee4hire

            How do you create a producer for EntityManager?

            • 3. Re: Failed to inject entityManager in @FacesConverter
              lightguard
              • 4. Re: Failed to inject entityManager in @FacesConverter
                jee4hire
                The entityManager is still null after using this:


                import javax.enterprise.context.ConversationScoped;
                import javax.enterprise.inject.Produces;
                import javax.persistence.EntityManagerFactory;
                import javax.persistence.PersistenceUnit;

                import org.jboss.seam.solder.core.ExtensionManaged;

                /**
                * @author Shane Bryzak
                */
                public class EntityManagerProducer {
                  @Produces
                  @ExtensionManaged
                  @ConversationScoped
                  @PersistenceUnit
                  EntityManagerFactory emf;
                }
                • 5. Re: Failed to inject entityManager in @FacesConverter
                  lightguard

                  Do you have Seam Persistence as a dependency?

                  • 6. Re: Failed to inject entityManager in @FacesConverter
                    jee4hire

                    Yes,   119223  Defl:N   103690  13% 2011-07-18 08:58 fb1581b3  WEB-INF/lib/seam-persistence-3.0.1-20110711.040751-17.jar



                    war:
                      443432  Defl:N   420698   5% 2011-05-16 12:02 d108cdd2  WEB-INF/lib/antlr-2.7.6.jar
                      897071  Defl:N   858346   4% 2011-07-12 15:16 a1635c95  WEB-INF/lib/antlr-3.3.jar
                      163650  Defl:N   149460   9% 2011-07-12 15:16 e8acd98f  WEB-INF/lib/antlr-runtime-3.3.jar
                      608376  Defl:N   554163   9% 2011-07-14 12:55 4bb8e85b  WEB-INF/lib/c3p0-0.9.1.1.jar
                      269014  Defl:N   245020   9% 2011-06-20 14:42 0d19c92a  WEB-INF/lib/commons-net-3.0.1.jar
                      253950  Defl:N   241386   5% 2011-05-12 11:27 f758d70e  WEB-INF/lib/cssparser-0.9.5.jar
                      988489  Defl:N   902079   9% 2011-07-12 15:16 22c8db9d  WEB-INF/lib/drools-compiler-5.2.0.Final.jar
                    1902276  Defl:N  1719856  10% 2011-07-12 15:10 91eaa4f6  WEB-INF/lib/drools-core-5.2.0.Final.jar
                    1674737  Defl:N  1601274   4% 2011-07-07 12:55 b5de0b5f  WEB-INF/lib/ecj-3.5.1.jar
                    1114265  Defl:N   987976  11% 2011-05-12 11:27 57d773f1  WEB-INF/lib/guava-r08.jar
                      102661  Defl:N    80043  22% 2011-07-07 12:54 b67dd2a4  WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar
                       61504  Defl:N    56482   8% 2011-07-21 10:31 92d0520b  WEB-INF/lib/i18nlog-1.0.10.jar
                    1472606  Defl:N  1320427  10% 2011-07-21 10:31 0084c472  WEB-INF/lib/infinispan-core-5.0.0.CR7.jar
                      546379  Defl:N   489412  10% 2011-07-21 10:38 7810d5c7  WEB-INF/lib/jboss-common-core-2.2.17.GA.jar
                       47399  Defl:N    41460  13% 2011-07-21 10:31 ac044dbb  WEB-INF/lib/jboss-logging-3.0.0.Beta5.jar
                       12623  Defl:N    10267  19% 2011-07-21 10:38 77d0c4ba  WEB-INF/lib/jboss-logging-spi-2.1.0.GA.jar
                      231287  Defl:N   203688  12% 2011-07-21 10:31 76154858  WEB-INF/lib/jboss-marshalling-1.3.0.CR9.jar
                       80863  Defl:N    74890   7% 2011-07-21 10:31 1074f519  WEB-INF/lib/jboss-marshalling-river-1.3.0.CR9.jar
                       10899  Defl:N     7710  29% 2011-07-21 10:31 b580639d  WEB-INF/lib/jboss-transaction-api-1.0.1.GA.jar
                    2135793  Defl:N  2028099   5% 2011-07-21 10:31 ade69d61  WEB-INF/lib/jgroups-2.12.0.Final.jar
                      543011  Defl:N   456324  16% 2011-07-12 14:02 f915bdef  WEB-INF/lib/joda-time-1.6.1.jar
                       15071  Defl:N    12479  17% 2011-04-04 11:31 a1e02acb  WEB-INF/lib/jta-1.1.jar
                      161455  Defl:N   122304  24% 2011-07-12 15:10 55c0bc93  WEB-INF/lib/knowledge-api-5.2.0.Final.jar
                      358085  Defl:N   324832   9% 2011-04-04 11:37 8c574f28  WEB-INF/lib/log4j-1.2.12.jar
                      713433  Defl:N   657365   8% 2011-07-12 15:10 3e88a598  WEB-INF/lib/mvel2-2.1.0.drools2.jar
                      785998  Defl:N   752200   4% 2011-08-10 10:38 9651a429  WEB-INF/lib/mysql-connector-java-5.1.15.jar
                       27714  Defl:N    18846  32% 2011-07-07 12:54 9718b1ca  WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
                       25717  Defl:N    20670  20% 2011-07-07 12:54 8473b909  WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
                      204093  Defl:N   181695  11% 2011-07-07 12:54 ed9a2ff2  WEB-INF/lib/picketlink-idm-core-1.5.0.Alpha02.jar
                       23055  Defl:N    14694  36% 2011-07-07 12:54 5dfcdff2  WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
                    1627515  Defl:N  1470306  10% 2011-07-07 12:54 e71d8ef4  WEB-INF/lib/primefaces-3.0.M2.jar
                      529064  Defl:N   490198   7% 2011-07-18 14:13 cb9a1aec  WEB-INF/lib/quartz-2.0.1.jar
                        7457  Defl:N     5972  20% 2011-07-18 14:13 cdac3310  WEB-INF/lib/quartz-jboss-2.0.1.jar
                        7635  Defl:N     5428  29% 2011-07-21 10:31 ed71d5ec  WEB-INF/lib/rhq-pluginAnnotations-3.0.1.jar
                       87436  Defl:N    66158  24% 2011-08-10 08:35 a81af8bc  WEB-INF/lib/richfaces-components-api-4.1.0-20110810.102951-86.jar
                    2535098  Defl:N  2300779   9% 2011-08-10 08:35 19d59d1a  WEB-INF/lib/richfaces-components-ui-4.1.0-20110810.103247-86.jar
                      136501  Defl:N   115014  16% 2011-08-09 07:31 07620cc6  WEB-INF/lib/richfaces-core-api-4.1.0-20110809.100314-76.jar
                      424256  Defl:N   391295   8% 2011-08-09 07:31 d38c2118  WEB-INF/lib/richfaces-core-impl-4.1.0-20110809.100458-74.jar
                       15808  Defl:N    12066  24% 2011-07-07 12:54 cbb7cd31  WEB-INF/lib/sac-1.3.jar
                       91540  Defl:N    81205  11% 2011-07-25 08:27 6d5bdd9e  WEB-INF/lib/seam-config-xml-3.0.1-20110723.041850-8.jar
                       55966  Defl:N    44907  20% 2011-07-07 12:54 d81b0cc2  WEB-INF/lib/seam-international-3.0.0.Final.jar
                      119223  Defl:N   103690  13% 2011-07-18 08:58 fb1581b3  WEB-INF/lib/seam-persistence-3.0.1-20110711.040751-17.jar
                       33716  Defl:N    23689  30% 2011-07-18 08:58 3a591eab  WEB-INF/lib/seam-security-api-3.0.1-20110624.041806-12.jar
                      153633  Defl:N   139858   9% 2011-07-18 08:58 267a0105  WEB-INF/lib/seam-security-impl-3.0.1-20110624.041853-12.jar
                       58187  Defl:N    50707  13% 2011-08-10 08:35 36b79b91  WEB-INF/lib/seam-servlet-3.0.1-20110810.040934-8.jar
                       28502  Defl:N    21792  24% 2011-08-10 08:35 a7cacfb1  WEB-INF/lib/seam-servlet-api-3.0.1-20110810.040906-8.jar
                      397907  Defl:N   343667  14% 2011-07-07 12:54 7f34b227  WEB-INF/lib/seam-solder-3.0.0.Final.jar
                       25496  Defl:N    22183  13% 2011-07-14 12:55 1a95d60b  WEB-INF/lib/slf4j-api-1.6.1.jar
                      148627  Defl:N   138829   7% 2011-07-12 15:16 3e8b388d  WEB-INF/lib/stringtemplate-3.2.1.jar

                    • 7. Re: Failed to inject entityManager in @FacesConverter
                      lightguard

                      Are you deploying on Tomcat?


                      It also looks like you have some duplicates of some of the jars. For example seam-servlet and seam-serlet-api. The API jar is bundled with the seam-servlet jar.

                      • 8. Re: Failed to inject entityManager in @FacesConverter
                        jee4hire
                        I examined the contents of the jars included in the war:

                           58187 Defl:N 50707 13% 2011-08-10 08:35 36b79b91 WEB-INF/lib/seam-servlet-3.0.1-20110810.040934-8.jar
                           28502 Defl:N 21792 24% 2011-08-10 08:35 a7cacfb1 WEB-INF/lib/seam-servlet-api-3.0.1-20110810.040906-8.jar

                        The are different.  Here are the listings of the contents:

                        #################################################################
                        File: seam-servlet-3.0.1-20110810.040934-8.jar

                             0 Wed Aug 10 00:09:26 PDT 2011 META-INF/
                           704 Wed Aug 10 00:09:24 PDT 2011 META-INF/MANIFEST.MF
                             0 Wed Aug 10 00:09:20 PDT 2011 META-INF/services/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/support/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/exception/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/exception/handler/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/config/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/logging/
                             0 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/beanManager/
                          1073 Wed Aug 10 00:09:20 PDT 2011 META-INF/beans.xml
                           108 Wed Aug 10 00:09:20 PDT 2011 META-INF/services/javax.enterprise.inject.spi.Extension
                            68 Wed Aug 10 00:09:20 PDT 2011 META-INF/services/org.jboss.weld.extensions.beanManager.BeanManagerProvider
                          3409 Wed Aug 10 00:09:20 PDT 2011 META-INF/web-fragment.xml
                        12842 Wed Aug 10 00:09:20 PDT 2011 META-INF/DEPENDENCIES.txt
                        11357 Wed Aug 10 00:09:20 PDT 2011 META-INF/LICENSE.txt
                          1671 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/AbstractServletEventBridge.class
                           972 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ImplicitServletObjectsHolder$1.class
                           779 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ImplicitServletObjectsHolder$InternalServletContextEvent.class
                           783 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ImplicitServletObjectsHolder$InternalServletRequestEvent.class
                           791 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ImplicitServletObjectsHolder$InternalServletResponseEvent.class
                           777 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ImplicitServletObjectsHolder$InternalHttpSessionEvent.class
                          6292 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ImplicitServletObjectsHolder.class
                          4342 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ServletEventBridgeListener.class
                          2912 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ServletEventBridgeFilter.class
                          2265 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/event/ServletEventBridgeServlet.class
                          1690 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/support/ServletLogger.class
                           687 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/support/ServletMessages.class
                          3689 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/support/ServletLogger_$logger.class
                          1978 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/support/ServletMessages_$bundle.class
                          1365 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/TemporalConverters.class
                          4556 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/CookieParamProducer.class
                          4001 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/RequestParamProducer.class
                          4217 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/HeaderParamProducer.class
                          7516 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/RedirectBuilderImpl.class
                           482 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/TypedParamValue.class
                          2108 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/http/ImplicitHttpServletObjectsProducer.class
                           574 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/exception/handler/ExceptionResponses.class
                          3474 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/exception/handler/ExceptionResponseServiceHandler.class
                          3098 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/exception/CatchExceptionFilter.class
                          1779 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/ServletExtension$TypedParamProducerBlueprint.class
                        12811 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/ServletExtension.class
                          1517 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/ImplicitServletObjectsProducer.class
                          1492 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/config/CharacterEncodingConfig.class
                           533 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/logging/TypedMessageLogger.class
                           533 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/logging/TypedMessageBundle.class
                          3210 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/logging/TypedMessageBundleAndLoggerProducers.class
                          7594 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/logging/TypedMessageBundleAndLoggerExtension.class
                           811 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/beanManager/ServletContextAttributeProvider$1.class
                          1506 Wed Aug 10 00:09:22 PDT 2011 org/jboss/seam/servlet/beanManager/ServletContextAttributeProvider.class
                             0 Wed Aug 10 00:09:26 PDT 2011 META-INF/maven/

                             0 Wed Aug 10 00:09:26 PDT 2011 META-INF/maven/org.jboss.seam.servlet/
                             0 Wed Aug 10 00:09:26 PDT 2011 META-INF/maven/org.jboss.seam.servlet/seam-servlet/
                        12876 Wed Aug 10 00:06:40 PDT 2011 META-INF/maven/org.jboss.seam.servlet/seam-servlet/pom.xml
                           128 Wed Aug 10 00:09:26 PDT 2011 META-INF/maven/org.jboss.seam.servlet/seam-servlet/pom.properties
                        ##############################################################################################
                        File: seam-servlet-api-3.0.1-20110810.040906-8.jar

                             0 Wed Aug 10 00:07:20 PDT 2011 META-INF/
                           682 Wed Aug 10 00:07:18 PDT 2011 META-INF/MANIFEST.MF
                             0 Wed Aug 10 00:07:16 PDT 2011 org/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/literal/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/exception/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/exception/handler/
                             0 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/literal/
                          1073 Wed Aug 10 00:07:16 PDT 2011 META-INF/beans.xml
                           265 Wed Aug 10 00:07:16 PDT 2011 META-INF/DEPENDENCIES.txt
                        11357 Wed Aug 10 00:07:16 PDT 2011 META-INF/LICENSE.txt
                           749 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/StartedLiteral.class
                           791 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/WillPassivateLiteral.class
                           777 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/InitializedLiteral.class
                           875 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/HttpMethodLiteral.class
                           777 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/DidActivateLiteral.class
                           763 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/DestroyedLiteral.class
                           983 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/literal/PathLiteral.class
                           483 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/Started.class
                           520 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/HttpMethod.class
                           495 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/WillPassivate.class
                           491 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/Initialized.class
                           487 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/Destroyed.class
                           491 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/DidActivate.class
                           508 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/event/Path.class
                           518 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/DefaultValue.class
                           930 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/literal/RequestParamLiteral.class
                           924 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/literal/HeaderParamLiteral.class
                           924 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/literal/CookieParamLiteral.class
                           630 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/RequestParam.class
                           628 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/CookieParam.class
                           733 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/RedirectBuilder.class
                           628 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/HeaderParam.class
                           924 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/HttpSessionStatus.class
                           516 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/ContextPath.class
                          3096 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/http/HttpServletRequestContext.class
                           510 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/exception/handler/SendErrorPage.class
                           589 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/exception/handler/SendHttpError.class
                          1727 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/ServletRequestContext.class
                          2024 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/WebApplication.class
                           734 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/literal/WebRequestLiteral.class
                           509 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/WebRequest.class
                           509 Wed Aug 10 00:07:16 PDT 2011 org/jboss/seam/servlet/ServerInfo.class
                             0 Wed Aug 10 00:07:20 PDT 2011 META-INF/maven/
                             0 Wed Aug 10 00:07:20 PDT 2011 META-INF/maven/org.jboss.seam.servlet/
                             0 Wed Aug 10 00:07:20 PDT 2011 META-INF/maven/org.jboss.seam.servlet/seam-servlet-api/
                          2497 Wed Aug 10 00:06:40 PDT 2011 META-INF/maven/org.jboss.seam.servlet/seam-servlet-api/pom.xml
                           132 Wed Aug 10 00:07:18 PDT 2011 META-INF/maven/org.jboss.seam.servlet/seam-servlet-api/pom.properties
                        • 9. Re: Failed to inject entityManager in @FacesConverter
                          jee4hire
                          I removed the extra jars from the war.
                          The result is still the same. Failed to inject entityManager and log in the following.
                          How can I solve this problem?

                          The output: ***log: null, entityManager: null.

                          @FacesConverter("entityFileConverter")
                          public class FileConverter implements Converter, Serializable {
                            @Inject private EntityManager entityManager;
                            @Inject private Logger log;
                           
                            @Override
                            public Object getAsObject(FacesContext context, UIComponent component, String value) {
                              Long id = Long.valueOf(value);
                              System.out.println("***log: " + log + ", entityManager: " + entityManager);
                              return entityManager.find(File.class, id);
                            }

                            @Override
                            public String getAsString(FacesContext context, UIComponent component, Object value) {
                              return ((File)value).getId().toString();
                            }
                          }


                          env:
                          jboss-as-7.0.0.Final
                          Linux omega 2.6.32-33-generic-pae #71-Ubuntu SMP Wed Jul 20 18:46:41 UTC 2011 i686 GNU/Linux
                          Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)

                          lean war:
                            445288  Defl:N   421452   5% 2011-07-12 15:16 3684c6c5  WEB-INF/lib/antlr-2.7.7.jar
                            897071  Defl:N   858346   4% 2011-07-12 15:16 a1635c95  WEB-INF/lib/antlr-3.3.jar
                            163650  Defl:N   149460   9% 2011-07-12 15:16 e8acd98f  WEB-INF/lib/antlr-runtime-3.3.jar
                            608376  Defl:N   554163   9% 2011-07-14 12:55 4bb8e85b  WEB-INF/lib/c3p0-0.9.1.1.jar
                            269014  Defl:N   245020   9% 2011-06-20 14:42 0d19c92a  WEB-INF/lib/commons-net-3.0.1.jar
                            253950  Defl:N   241386   5% 2011-05-12 11:27 f758d70e  WEB-INF/lib/cssparser-0.9.5.jar
                            988489  Defl:N   902079   9% 2011-07-12 15:16 22c8db9d  WEB-INF/lib/drools-compiler-5.2.0.Final.jar
                          1902276  Defl:N  1719856  10% 2011-07-12 15:10 91eaa4f6  WEB-INF/lib/drools-core-5.2.0.Final.jar
                          1674737  Defl:N  1601274   4% 2011-07-07 12:55 b5de0b5f  WEB-INF/lib/ecj-3.5.1.jar
                          1114265  Defl:N   987976  11% 2011-05-12 11:27 57d773f1  WEB-INF/lib/guava-r08.jar
                            543011  Defl:N   456324  16% 2011-07-12 14:02 f915bdef  WEB-INF/lib/joda-time-1.6.1.jar
                             15071  Defl:N    12479  17% 2011-04-04 11:31 a1e02acb  WEB-INF/lib/jta-1.1.jar
                            161455  Defl:N   122304  24% 2011-07-12 15:10 55c0bc93  WEB-INF/lib/knowledge-api-5.2.0.Final.jar
                            358085  Defl:N   324832   9% 2011-04-04 11:37 8c574f28  WEB-INF/lib/log4j-1.2.12.jar
                            713433  Defl:N   657365   8% 2011-07-12 15:10 3e88a598  WEB-INF/lib/mvel2-2.1.0.drools2.jar
                            785998  Defl:N   752200   4% 2011-08-10 10:38 9651a429  WEB-INF/lib/mysql-connector-java-5.1.15.jar
                             27714  Defl:N    18846  32% 2011-07-07 12:54 9718b1ca  WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
                             25717  Defl:N    20670  20% 2011-07-07 12:54 8473b909  WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
                            204093  Defl:N   181695  11% 2011-07-07 12:54 ed9a2ff2  WEB-INF/lib/picketlink-idm-core-1.5.0.Alpha02.jar
                             23055  Defl:N    14694  36% 2011-07-07 12:54 5dfcdff2  WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
                          1627515  Defl:N  1470306  10% 2011-07-07 12:54 e71d8ef4  WEB-INF/lib/primefaces-3.0.M2.jar
                            529064  Defl:N   490198   7% 2011-07-18 14:13 cb9a1aec  WEB-INF/lib/quartz-2.0.1.jar
                             87600  Defl:N    66425  24% 2011-08-11 07:26 a0d3d055  WEB-INF/lib/richfaces-components-api-4.1.0-20110811.102420-90.jar
                          2535262  Defl:N  2306588   9% 2011-08-11 07:26 d9032275  WEB-INF/lib/richfaces-components-ui-4.1.0-20110811.102642-90.jar
                            136496  Defl:N   114969  16% 2011-08-11 07:26 520c0153  WEB-INF/lib/richfaces-core-api-4.1.0-20110811.100316-78.jar
                            424252  Defl:N   391268   8% 2011-08-11 07:26 103f6869  WEB-INF/lib/richfaces-core-impl-4.1.0-20110811.100515-76.jar
                             15808  Defl:N    12066  24% 2011-07-07 12:54 cbb7cd31  WEB-INF/lib/sac-1.3.jar
                             91540  Defl:N    81205  11% 2011-07-25 08:27 6d5bdd9e  WEB-INF/lib/seam-config-xml-3.0.1-20110723.041850-8.jar
                             55966  Defl:N    44907  20% 2011-07-07 12:54 d81b0cc2  WEB-INF/lib/seam-international-3.0.0.Final.jar
                            119223  Defl:N   103690  13% 2011-07-18 08:58 fb1581b3  WEB-INF/lib/seam-persistence-3.0.1-20110711.040751-17.jar
                             33716  Defl:N    23689  30% 2011-07-18 08:58 3a591eab  WEB-INF/lib/seam-security-api-3.0.1-20110624.041806-12.jar
                            153633  Defl:N   139858   9% 2011-07-18 08:58 267a0105  WEB-INF/lib/seam-security-impl-3.0.1-20110624.041853-12.jar
                             58187  Defl:N    50707  13% 2011-08-10 08:35 36b79b91  WEB-INF/lib/seam-servlet-3.0.1-20110810.040934-8.jar
                             28502  Defl:N    21792  24% 2011-08-10 08:35 a7cacfb1  WEB-INF/lib/seam-servlet-api-3.0.1-20110810.040906-8.jar
                            397907  Defl:N   343667  14% 2011-07-07 12:54 7f34b227  WEB-INF/lib/seam-solder-3.0.0.Final.jar
                             25496  Defl:N    22183  13% 2011-07-14 12:55 1a95d60b  WEB-INF/lib/slf4j-api-1.6.1.jar
                            148627  Defl:N   138829   7% 2011-07-12 15:16 3e8b388d  WEB-INF/lib/stringtemplate-3.2.1.jar
                          • 10. Re: Failed to inject entityManager in @FacesConverter
                            jee4hire
                            Also, the contents of the following jars are different:


                            Archive:  antlr-2.7.7.jar
                            Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
                            --------  ------  ------- ---- ---------- ----- --------  ----
                                   0  Defl:N        2   0% 2006-09-06 11:15 00000000  META-INF/
                                  70  Defl:N       70   0% 2006-09-06 11:15 57a18252  META-INF/MANIFEST.MF
                                   0  Stored        0   0% 2006-09-06 11:15 00000000  antlr/
                                1235  Defl:N      685  45% 2006-09-06 11:15 c57d5459  antlr/ActionElement.class
                                   0  Stored        0   0% 2006-09-06 11:15 00000000  antlr/actions/
                                   0  Stored        0   0% 2006-09-06 11:15 00000000  antlr/actions/cpp/
                               31796  Defl:N    11324  64% 2006-09-06 11:15 a410d83c  antlr/actions/cpp/ActionLexer.class
                                1036  Defl:N      495  52% 2006-09-06 11:15 f125a30e  antlr/actions/cpp/ActionLexerTokenTypes.class
                                   0  Stored        0   0% 2006-09-06 11:15 00000000  antlr/actions/csharp/
                               32774  Defl:N    11333  65% 2006-09-06 11:15 61b0a8b1  antlr/actions/csharp/ActionLexer.class
                                1039  Defl:N      499  52% 2006-09-06 11:15 f6eb3a50  antlr/actions/csharp/ActionLexerTokenTypes.class
                                   0  Stored        0   0% 2006-09-06 11:15 00000000  antlr/actions/java/
                            ...

                            ################################################################################
                            Archive:  antlr-3.3.jar
                            Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
                            --------  ------  ------- ---- ---------- ----- --------  ----
                                   0  Stored        0   0% 2010-11-30 12:46 00000000  META-INF/
                                 124  Defl:N      102  18% 2010-11-30 12:46 96df5512  META-INF/MANIFEST.MF
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/analysis/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/ActionScript/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/C/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/CPP/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/CSharp2/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/CSharp3/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/Delphi/
                                   0  Stored        0   0% 2010-11-29 17:55 00000000  org/antlr/codegen/templates/Java/
                            ....
                            • 11. Re: Failed to inject entityManager in @FacesConverter
                              lightguard

                              If you're deploying on AS7 it certainly seems like you have way too many jars in there.

                              • 12. Re: Failed to inject entityManager in @FacesConverter
                                jee4hire

                                Could you please be more specific.
                                Then, I can test your assertion, and then relay the results to you.
                                Thanks.

                                • 13. Re: Failed to inject entityManager in @FacesConverter
                                  lightguard

                                  Pretty much anything that starts with jboss or hibernate (and any of those transitive dependencies) you don't need.


                                  Try this instead


                                    445288 Defl:N 421452 5% 2011-07-12 15:16 3684c6c5 WEB-INF/lib/antlr-2.7.7.jar -- not sure what uses this
                                    897071 Defl:N 858346 4% 2011-07-12 15:16 a1635c95 WEB-INF/lib/antlr-3.3.jar -- not sure what uses this
                                    163650 Defl:N 149460 9% 2011-07-12 15:16 e8acd98f WEB-INF/lib/antlr-runtime-3.3.jar -- not sure what uses this
                                    253950 Defl:N 241386 5% 2011-05-12 11:27 f758d70e WEB-INF/lib/cssparser-0.9.5.jar
                                    988489 Defl:N 902079 9% 2011-07-12 15:16 22c8db9d WEB-INF/lib/drools-compiler-5.2.0.Final.jar
                                   1902276 Defl:N 1719856 10% 2011-07-12 15:10 91eaa4f6 WEB-INF/lib/drools-core-5.2.0.Final.jar
                                   1674737 Defl:N 1601274 4% 2011-07-07 12:55 b5de0b5f WEB-INF/lib/ecj-3.5.1.jar -- not sure what uses this
                                   1114265 Defl:N 987976 11% 2011-05-12 11:27 57d773f1 WEB-INF/lib/guava-r08.jar
                                    543011 Defl:N 456324 16% 2011-07-12 14:02 f915bdef WEB-INF/lib/joda-time-1.6.1.jar
                                    161455 Defl:N 122304 24% 2011-07-12 15:10 55c0bc93 WEB-INF/lib/knowledge-api-5.2.0.Final.jar -- not sure what uses this
                                    713433 Defl:N 657365 8% 2011-07-12 15:10 3e88a598 WEB-INF/lib/mvel2-2.1.0.drools2.jar
                                    785998 Defl:N 752200 4% 2011-08-10 10:38 9651a429 WEB-INF/lib/mysql-connector-java-5.1.15.jar
                                     27714 Defl:N 18846 32% 2011-07-07 12:54 9718b1ca WEB-INF/lib/picketlink-idm-api-1.5.0.Alpha02.jar
                                     25717 Defl:N 20670 20% 2011-07-07 12:54 8473b909 WEB-INF/lib/picketlink-idm-common-1.5.0.Alpha02.jar
                                    204093 Defl:N 181695 11% 2011-07-07 12:54 ed9a2ff2 WEB-INF/lib/picketlink-idm-core-1.5.0.Alpha02.jar
                                     23055 Defl:N 14694 36% 2011-07-07 12:54 5dfcdff2 WEB-INF/lib/picketlink-idm-spi-1.5.0.Alpha02.jar
                                   1627515 Defl:N 1470306 10% 2011-07-07 12:54 e71d8ef4 WEB-INF/lib/primefaces-3.0.M2.jar
                                    529064 Defl:N 490198 7% 2011-07-18 14:13 cb9a1aec WEB-INF/lib/quartz-2.0.1.jar
                                     87600 Defl:N 66425 24% 2011-08-11 07:26 a0d3d055 WEB-INF/lib/richfaces-components-api-4.1.0-20110811.102420-90.jar
                                   2535262 Defl:N 2306588 9% 2011-08-11 07:26 d9032275 WEB-INF/lib/richfaces-components-ui-4.1.0-20110811.102642-90.jar
                                    136496 Defl:N 114969 16% 2011-08-11 07:26 520c0153 WEB-INF/lib/richfaces-core-api-4.1.0-20110811.100316-78.jar
                                    424252 Defl:N 391268 8% 2011-08-11 07:26 103f6869 WEB-INF/lib/richfaces-core-impl-4.1.0-20110811.100515-76.jar
                                     15808 Defl:N 12066 24% 2011-07-07 12:54 cbb7cd31 WEB-INF/lib/sac-1.3.jar -- not sure what uses this
                                     91540 Defl:N 81205 11% 2011-07-25 08:27 6d5bdd9e WEB-INF/lib/seam-config-xml-3.0.1-20110723.041850-8.jar
                                     55966 Defl:N 44907 20% 2011-07-07 12:54 d81b0cc2 WEB-INF/lib/seam-international-3.0.0.Final.jar
                                    119223 Defl:N 103690 13% 2011-07-18 08:58 fb1581b3 WEB-INF/lib/seam-persistence-3.0.1-20110711.040751-17.jar
                                     33716 Defl:N 23689 30% 2011-07-18 08:58 3a591eab WEB-INF/lib/seam-security-api-3.0.1-20110624.041806-12.jar
                                    153633 Defl:N 139858 9% 2011-07-18 08:58 267a0105 WEB-INF/lib/seam-security-impl-3.0.1-20110624.041853-12.jar
                                     58187 Defl:N 50707 13% 2011-08-10 08:35 36b79b91 WEB-INF/lib/seam-servlet-3.0.1-20110810.040934-8.jar
                                     28502 Defl:N 21792 24% 2011-08-10 08:35 a7cacfb1 WEB-INF/lib/seam-servlet-api-3.0.1-20110810.040906-8.jar
                                    397907 Defl:N 343667 14% 2011-07-07 12:54 7f34b227 WEB-INF/lib/seam-solder-3.0.0.Final.jar
                                    148627 Defl:N 138829 7% 2011-07-12 15:16 3e8b388d WEB-INF/lib/stringtemplate-3.2.1.jar -- not sure what uses this



                                  If you can tell me what uses the jars I wasn't sure about I'll tell you if you need them.

                                  • 14. Re: Failed to inject entityManager in @FacesConverter
                                    jee4hire
                                    The jars that you marked are dependencies that I did not explicitly include:

                                    pom.xml:

                                    <?xml version="1.0" encoding="UTF-8"?>
                                    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
                                      <modelVersion>4.0.0</modelVersion>
                                      <groupId>com.app</groupId>
                                      <artifactId>app</artifactId>
                                      <version>1.0-0</version>
                                      <packaging>war</packaging>
                                      <name>An applcation</name>
                                      <description>An application</description>
                                      <properties>
                                        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                                        <maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
                                        <jboss.home>${env.JBOSS_HOME}</jboss.home>
                                       </properties>

                                      <repositories>
                                        <repository>
                                          <id>snapshots-jboss-org</id>
                                          <name>JBoss Snapshots</name>
                                          <url>http://snapshots.jboss.org/maven2/</url>
                                          <layout>default</layout>
                                        </repository>

                                        <repository>
                                          <id>jboss-public-repository</id>
                                          <name>JBoss Repository</name>
                                          <url>http://repository.jboss.org/nexus/content/groups/public</url>
                                          <releases>
                                          </releases>
                                          <snapshots>
                                            <enabled>false</enabled>
                                          </snapshots>
                                        </repository>

                                        <repository>
                                          <id>prime-repo</id>
                                          <name>Prime Technology Maven Repository</name>
                                          <url>http://repository.prime.com.tr/</url>
                                          <layout>default</layout>
                                        </repository>
                                      </repositories>

                                      <pluginRepositories>
                                        <pluginRepository>
                                          <id>jboss-public-repository</id>
                                          <name>JBoss Repository</name>
                                          <url>http://repository.jboss.org/nexus/content/groups/public</url>
                                          <releases>
                                          </releases>
                                          <snapshots>
                                            <enabled>false</enabled>
                                          </snapshots>
                                        </pluginRepository>
                                      </pluginRepositories>

                                      <dependencies>
                                        <dependency>
                                          <groupId>mysql</groupId>
                                          <artifactId>mysql-connector-java</artifactId>
                                          <version>5.1.15</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.jboss.seam.servlet</groupId>
                                          <artifactId>seam-servlet</artifactId>
                                          <version>3.0.1-SNAPSHOT</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.quartz-scheduler</groupId>
                                          <artifactId>quartz</artifactId>
                                          <version>2.0.1</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>joda-time</groupId>
                                          <artifactId>joda-time</artifactId>
                                          <version>1.6.1</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.jboss.seam.security</groupId>
                                          <artifactId>seam-security-impl</artifactId>
                                          <version>3.0.1-SNAPSHOT</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.drools</groupId>
                                          <artifactId>drools-core</artifactId>
                                          <version>5.2.0.Final</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.drools</groupId>
                                          <artifactId>drools-compiler</artifactId>
                                          <version>5.2.0.Final</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.jboss.seam.persistence</groupId>
                                          <artifactId>seam-persistence</artifactId>
                                          <version>3.0.1-SNAPSHOT</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.jboss.seam.config</groupId>
                                          <artifactId>seam-config-xml</artifactId>
                                          <version>3.0.1-SNAPSHOT</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.primefaces</groupId>
                                          <artifactId>primefaces</artifactId>
                                          <version>3.0.M2</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>commons-net</groupId>
                                          <artifactId>commons-net</artifactId>
                                          <version>3.0.1</version>
                                        </dependency>

                                        <dependency>
                                          <groupId>org.richfaces</groupId>
                                          <artifactId>richfaces-bom</artifactId>
                                          <version>4.0.0.Final</version>
                                          <scope>import</scope>
                                          <type>pom</type>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.richfaces.ui</groupId>
                                          <artifactId>richfaces-components-ui</artifactId>
                                          <version>4.1.0-SNAPSHOT</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.richfaces.core</groupId>
                                          <artifactId>richfaces-core-impl</artifactId>
                                          <version>4.1.0-SNAPSHOT</version>
                                        </dependency>
                                        <dependency>
                                          <groupId>org.jboss.seam.solder</groupId>
                                          <artifactId>seam-solder</artifactId>
                                          <version>3.0.0.Final</version>
                                        </dependency>

                                        <!-- JSR-303 (Bean Validation) Implementation -->
                                        <!-- Provides portable constraints such as @Email -->
                                        <!-- Hibernate Validator is shipped in JBoss AS 7 -->
                                        <dependency>
                                          <groupId>org.hibernate</groupId>
                                          <artifactId>hibernate-validator</artifactId>
                                          <version>4.1.0.Final</version>
                                          <scope>provided</scope>
                                          <exclusions>
                                            <exclusion>
                                            <groupId>org.slf4j</groupId>
                                            <artifactId>slf4j-api</artifactId>
                                            </exclusion>
                                          </exclusions>
                                        </dependency>

                                        <!-- Needed for running tests (you may also use TestNG) -->
                                        <dependency>
                                          <groupId>junit</groupId>
                                          <artifactId>junit</artifactId>
                                          <version>4.8.1</version>
                                          <scope>test</scope>
                                        </dependency>

                                        <!-- Optional, but highly recommended -->
                                        <!-- Arquillian allows you to test enterprise code such as EJBs and
                                          Transactional(JTA) JPA from JUnit/TestNG -->
                                        <dependency>
                                          <groupId>org.jboss.arquillian.junit</groupId>
                                          <artifactId>arquillian-junit-container</artifactId>
                                          <version>1.0.0.CR1</version>
                                          <scope>test</scope>
                                        </dependency>

                                        <!-- Include the JBoss' Java EE 6 APIs -->
                                        <!-- JBoss distributes a complete set of Java EE 6 APIs including a
                                          Bill of Materials (BOM). A BOM specifies the versions of a "stack" (or a
                                          collection) of artifacts. We use this here so that we always get the correct
                                          versions of artifacts. Here we use the jboss-javaee-web-6.0 stack (you can
                                          read this as the JBoss stack of the Java EE 6 Web Profile APIs), and we use
                                          version 2.0.0.Beta1 which is the latest release of the stack. You can actually
                                          use this stack with any version of JBoss AS that implements Java EE 6, not
                                          just JBoss AS 7! -->
                                        <dependency>
                                          <groupId>org.jboss.spec</groupId>
                                          <artifactId>jboss-javaee-web-6.0</artifactId>
                                          <version>2.0.0.Final</version>
                                          <type>pom</type>
                                          <scope>provided</scope>
                                        </dependency>
                                      </dependencies>

                                      <build>
                                        <!-- Maven will append the version to the finalName (which is the name
                                          given to the generated war, and hence the context root) -->
                                        <finalName>${project.artifactId}</finalName>
                                        <plugins>
                                          <!-- Compiler plugin enforces Java 1.6 compatibility and activates
                                            annotation processors -->
                                          <plugin>
                                            <artifactId>maven-compiler-plugin</artifactId>
                                            <version>2.3.1</version>
                                            <configuration>
                                              <source>1.6</source>
                                              <target>1.6</target>
                                            </configuration>
                                          </plugin>

                                          <plugin>
                                            <artifactId>maven-war-plugin</artifactId>
                                            <version>2.1.1</version>
                                            <configuration>
                                              <!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
                                              <failOnMissingWebXml>false</failOnMissingWebXml>
                                            </configuration>
                                          </plugin>
                                        </plugins>
                                      </build>

                                      <profiles>
                                        <profile>
                                          <!-- The default profile skips all tests, though you can tune it
                                            to run just unit tests based on a custom pattern -->
                                          <!-- Seperate profiles are provided for running all tests, including
                                            Arquillian tests that execute in the specified container -->
                                          <id>default</id>
                                          <activation>
                                            <activeByDefault>true</activeByDefault>
                                          </activation>
                                          <build>
                                            <plugins>
                                              <plugin>
                                                <artifactId>maven-surefire-plugin</artifactId>
                                                <version>2.4.3</version>
                                                <configuration>
                                                  <skip>true</skip>
                                                </configuration>
                                              </plugin>
                                                <!-- The JBoss AS plugin deploys your war to a local JBoss
                                                  AS container -->
                                                <!-- To use, set the JBOSS_HOME environment variable and run:
                                                  mvn package jboss-as:deploy -->
                                              <plugin>
                                                <groupId>org.jboss.as.plugins</groupId>
                                                <artifactId>jboss-as-maven-plugin</artifactId>
                                                <version>7.0.0.Final</version>
                                              </plugin>
                                            </plugins>
                                          </build>
                                        </profile>
                                         
                                        <profile>
                                          <!-- An optional Arquillian testing profile that executes tests
                                            in your JBoss AS instance -->
                                          <!-- This profile will start a new JBoss AS instance, and execute the
                                            test, shutting it down when done -->
                                          <!-- Run with: mvn clean test -Parq-jbossas-managed -->
                                          <id>arq-jbossas-managed</id>
                                          <dependencies>
                                            <dependency>
                                              <groupId>org.jboss.as</groupId>
                                              <artifactId>jboss-as-arquillian-container-managed</artifactId>
                                              <version>7.0.0.CR1</version>
                                              <scope>test</scope>
                                            </dependency>
                                          </dependencies>
                                        </profile>
                                         
                                        <profile>
                                          <!-- An optional Arquillian testing profile that executes tests
                                            in a remote JBoss AS instance -->
                                          <!-- Run with: mvn clean test -Parq-jbossas-remote -->
                                          <id>arq-jbossas-remote</id>
                                          <dependencies>
                                            <dependency>
                                              <groupId>org.jboss.as</groupId>
                                              <artifactId>jboss-as-arquillian-container-remote</artifactId>
                                              <version>7.0.0.CR1</version>
                                              <scope>test</scope>
                                            </dependency>
                                          </dependencies>
                                        </profile>
                                      </profiles>
                                    </project>
                                    1 2 3 Previous Next