2010-08-21 25 views
1

Je ne peux pas sembler obtenir une application Web en cours d'exécution avec le plugin GlassFish embarqué:Maven Plugin Embarqués Glassfish - ne démarre pas

Configuration du plugin:

<plugin> 
       <groupId>org.glassfish</groupId> 
       <artifactId>maven-embedded-glassfish-plugin</artifactId> 
       <version>${glassfish.version}</version> 
       <configuration> 
        <port>${http.port}</port> 

        <autoDelete>true</autoDelete> 
        <app>${project.build.directory}/${maven.war.final.name}</app> 
        <containerType>web</containerType> 
        <!-- 
        <goalPrefix>glassfish</goalPrefix> 

        <configFile>${project.build.directory}/${finalName}/WEB-INF/domain.xml</configFile> 

        <instanceRoot>${project.build.directory}/glassfish/${glassfish.version}</instanceRoot> 
        <installRoot>${project.build.directory}/glassfish/${glassfish.version}</installRoot> 
        --> 

        <!-- 
        <contextRoot>test</contextRoot> 
        --> 
       </configuration> 
      </plugin> 

Configuration:

<properties> 
     <finalName>${project.artifactId}-${project.version}</finalName> 
     <maven.war.final.name>${finalName}.war</maven.war.final.name> 
     <http.port>80</http.port> 
     <glassfish.version>3.0</glassfish.version> 
    </properties> 

Ligne de commande:

mvn clean package embedded-glassfish:run 

Sortie:

INFO: GlassFish v3 (74.2) startup time : Embedded(323ms) startup services(323ms) total(646ms) 
Aug 21, 2010 2:04:10 PM com.sun.enterprise.transaction.JavaEETransactionManagerSimplified initDelegates 
INFO: Using com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate as the delegate 
Aug 21, 2010 2:04:11 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run 
INFO: JMXStartupService: JMXConnector system is disabled, skipping. 
Aug 21, 2010 2:04:11 PM AppServerStartup run 
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started 
Aug 21, 2010 2:04:11 PM org.hibernate.validator.util.Version <clinit> 
INFO: Hibernate Validator null 
Aug 21, 2010 2:04:11 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA 
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver. 
Aug 21, 2010 2:04:16 PM com.sun.common.util.logging.LoggingConfigImpl openPropFile 
INFO: Cannot read logging.properties file. 
Aug 21, 2010 2:04:16 PM com.sun.enterprise.web.WebContainer createHttpListener 
INFO: Created HTTP listener embedded-listener on port 80 
Aug 21, 2010 2:04:16 PM com.sun.enterprise.web.WebContainer configureHttpServiceProperties 
WARNING: pewebcontainer.invalid_http_service_property 
Aug 21, 2010 2:04:16 PM com.sun.enterprise.web.WebContainer createHosts 
INFO: Created virtual server server 
Aug 21, 2010 2:04:16 PM com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules 
INFO: Virtual server server loaded system default web module 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.SecurityLifecycle <init> 
INFO: security.secmgroff 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.ssl.SSLUtils checkCertificateDates 
SEVERE: java_security.expired_certificate 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.SecurityLifecycle onInitialization 
INFO: Security startup service called 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.PolicyLoader loadPolicy 
INFO: policy.loading 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate 
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created. 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate 
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file.FileRealm successfully created. 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate 
INFO: Realm certificate of classtype com.sun.enterprise.security.auth.realm.certificate.CertificateRealm successfully created. 
Aug 21, 2010 2:04:18 PM com.sun.enterprise.security.SecurityLifecycle onInitialization 
INFO: Security service(s) started successfully.... 
classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/) 
SharedSecrets.getJavaNetAccess()[email protected] 
Aug 21, 2010 2:04:20 PM org.jboss.weld.bootstrap.WeldBootstrap <clinit> 
INFO: WELD-000900 SNAPSHOT 
Aug 21, 2010 2:04:20 PM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA 
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver. 
nullID: /mnt/projects/github.com/prettyfaces-tests/gfembed4134153095470013496tmp/applications/prettyfaces-demo-0.0.1-SNAPSHOT/ CLASSES: [class de.chkal.prettytest.WelcomeBean, class de.chkal.prettytest.GreetingBean, class de.chkal.prettytest.WelcomeBean2] 

Aug 21, 2010 2:04:20 PM com.sun.faces.config.ConfigureListener contextInitialized 
INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/prettyfaces-demo-0.0.1-SNAPSHOT' 
Aug 21, 2010 2:04:22 PM com.sun.enterprise.web.WebApplication start 
INFO: Loading application prettyfaces-demo-0.0.1-SNAPSHOT at /prettyfaces-demo-0.0.1-SNAPSHOT 
Hit ENTER to redeploy, X to exit 

Netstat -an | grep 80 ne répertorie rien:

netstat -an | grep :80 

Cette configuration a fonctionné pour moi dans le passé, je ne vois pas de messages du journal ou des exceptions. Qu'est-ce que je rate?

Répondre

0

Je n'ai pas l'explication complète (et je suis trop paresseux pour trouver la cause réelle du problème ce soir), mais il semble que le maven-glassfish-embedded-plugin n'aime pas le port 80, il fonctionne seulement avec, disons, 8080 . En passant, je vous recommande d'utiliser la version 3.0.1.

<properties> 
    <finalName>${project.artifactId}-${project.version}</finalName> 
    <maven.war.final.name>${finalName}.war</maven.war.final.name> 
    <http.port>8080</http.port> 
    <glassfish.version>3.0.1</glassfish.version> 
</properties> 
+1

Cool, je vais vérifier maintenant. Je suppose que cela a du sens, je suis sous Linux, il y a des ports en dessous d'un certain nombre qui sont privilégiés et requièrent un superutilisateur pour écouter sur ces ports. Cela pourrait être dans cette fourchette, essayez 8080. –

+0

Doux, c'était tout. Je vais essayer de garder cela à l'esprit lorsque j'utiliserai le port 80 à l'avenir. –

+1

@Walter Cela doit être, les ports inférieurs à 1024 nécessitent des privilèges root. J'aurais dû penser que c'était à cause de ça. –