2013-03-14 81 views
0

我使用的是NetBeans 7.3,Glassfish 3.1.2.2和Maven。當部署應用程序到GlassFish,我得到以下日誌:爲什麼我的Web應用程序在Glassfish中連續部署兩次?

Launching GlassFish on Felix platform 
INFO: Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2.2 (build 5) 
INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry 
INFO: Grizzly Framework 1.9.50 started in: 3ms - bound to [0.0.0.0:3700] 
INFO: Grizzly Framework 1.9.50 started in: 15ms - bound to [0.0.0.0:8181] 
INFO: Grizzly Framework 1.9.50 started in: 27ms - bound to [0.0.0.0:8080] 
INFO: Grizzly Framework 1.9.50 started in: 8ms - bound to [0.0.0.0:4848] 
INFO: Grizzly Framework 1.9.50 started in: 1ms - bound to [0.0.0.0:7676] 
INFO: The Admin Console is already installed, but not yet loaded. 
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080] 
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181] 
INFO: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848] 
INFO: WEB0171: Created virtual server [server] 
INFO: WEB0171: Created virtual server [__asadmin] 
INFO: WEB0172: Virtual server [server] loaded default web module [] 
INFO: core.start_container_done 
INFO: SEC1002: Security Manager is OFF. 
INFO: SEC1010: Entering Security Startup Service 
INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper. 
INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created. 
INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created. 
INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created. 
INFO: SEC1011: Security Service(s) Started Successfully 
WARNING: DPL8027: Ignore WEB-INF/sun-web.xml in archive /C:/Users/Tiago Peres/Documents/NetBeansProjects/playground-websockets/target/playground-websockets-1.0-SNAPSHOT/, as GlassFish counterpart runtime xml WEB-INF/glassfish-web.xml is present in the same archive. 
INFO: WELD-000900 1.1.8 (Final) 
INFO: HV000001: Hibernate Validator 4.3.0.Final 
INFO: Activating CDI extension for Spring Data JPA repositories. 
INFO: PWC1412: WebModule[null] ServletContext.log():No Spring WebApplicationInitializer types detected on classpath 
INFO: Inicializando Mojarra 2.1.6 (SNAPSHOT 20111206) para o contexto '/playground-websockets' 
INFO: Monitoring jndi:/server/playground-websockets/WEB-INF/faces-config.xml for modifications 
INFO: Refreshing org[email protected]1a4ffb5b: startup date [Thu Mar 14 14:11:17 BRT 2013]; root of context hierarchy 
INFO: Loading XML bean definitions from URL [jndi:/server/playground-websockets/WEB-INF/beans.xml] 
INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning 
INFO: JSR-330 'javax.inject.Named' annotation found and supported for component scanning 
INFO: Overriding bean definition for bean 'loginService': replacing [Generic bean: class [com.playground.core.service.impl.LoginServiceImpl]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/C:/Users/Tiago%20Peres/Documents/NetBeansProjects/playground-websockets/target/playground-websockets-1.0-SNAPSHOT/WEB-INF/lib/playground-core-1.0-SNAPSHOT.jar!/com/playground/core/service/impl/LoginServiceImpl.class]] with [Generic bean: class [com.playground.core.service.impl.LoginServiceImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jndi:/server/playground-websockets/WEB-INF/beans.xml]] 
INFO: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
INFO: Loaded JDBC driver: com.mysql.jdbc.Driver 
INFO: Bean 'dataSource' of type [class org.springframework.jdbc.datasource.DriverManagerDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Bean 'persistenceProvider' of type [class org.hibernate.ejb.HibernatePersistence] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Bean 'jpaVendorAdapter' of type [class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Bean 'jpaDialect' of type [class org.springframework.orm.jpa.vendor.HibernateJpaDialect] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: persistence-websockets.xml should be located inside META-INF directory; cannot determine persistence unit root URL for class path resource [persistence-websockets.xml] 
INFO: Building JPA container EntityManagerFactory for persistence unit 'playground-websockets' 
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final} 
INFO: HHH000412: Hibernate Core {4.1.6.Final} 
INFO: HHH000206: hibernate.properties not found 
INFO: HHH000021: Bytecode provider name : javassist 
INFO: HHH000204: Processing PersistenceUnitInfo [ 
    name: playground-websockets 
    ...] 
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider 
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory 
INFO: HHH000397: Using ASTQueryTranslatorFactory 
INFO: HHH000229: Running schema validator 
INFO: HHH000102: Fetching database metadata 
INFO: HHH000261: Table found: playground.gametitle 
INFO: HHH000037: Columns: [id, playedtimes, name, maximumnumberofplayers, rating, launchdate] 
INFO: HHH000261: Table found: playground.player 
INFO: HHH000037: Columns: [id, nickname, facebookid] 
INFO: HHH000261: Table found: playground.score 
INFO: HHH000037: Columns: [id, playedtimes, gametitle_id, victories, losses, player_id, points] 
INFO: HHH000261: Table found: playground.hibernate_sequence 
INFO: HHH000037: Columns: [next_val] 
INFO: Bean 'entityManagerFactory' of type [class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Pre-instantiating singletons in org.s[email protected]56983a92: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,scoreRepositoryImpl,scoreRepository,gameTitleRepositoryImpl,gameTitleRepository,playerRepositoryImpl,playerRepository,org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor#0,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0,invitationRepositoryImpl,loggedPlayerRepository,queueRepositoryImpl,roomRepositoryImpl,invitationServiceImpl,loginService,queueServiceImpl,roomServiceImpl,dataSource,entityManagerFactory,persistenceProvider,jpaDialect,jpaVendorAdapter,org.springframework.transaction.config.internalTransactionAspect,transactionManager,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#1,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#1,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy 
INFO: Using JTA UserTransaction: [email protected] 
INFO: Using JTA TransactionManager: [email protected] 
INFO: Using JTA TransactionSynchronizationRegistry: com.su[email protected]c91aca4 
INFO: ***MyWebSocketApplication registered successfully in the Servlet*** 
INFO: ***LoginApplication registered successfully in the Servlet*** 
INFO: WEB0671: Loading application [playground-websockets] at [/playground-websockets] 
INFO: CORE10010: Loading application playground-websockets done in 21.807 ms 
INFO: GlassFish Server Open Source Edition 3.1.2.2 (5) hora de inicialização : Felix (1.296ms), serviços de inicialização(23.324ms), total(24.620ms) 
INFO: Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false 

然後它開始爲「澤西申請」再次做的一切。

INFO: Initiating Jersey application, version 'Jersey: 1.11.1 03/31/2012 06:49 PM' 
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080] 
INFO: Grizzly Framework 1.9.50 started in: 2ms - bound to [0.0.0.0:8080] 
INFO: REST00001: Listening to REST requests at context: /management/domain 
INFO: The Admin Console is already installed, but not yet loaded. 
INFO: The Admin Console is starting. Please wait. 
INFO: JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://Tiago-PC:8686/jndi/rmi://Tiago-PC:8686/jmxrmi 
INFO: Inicializando Mojarra 2.1.6 (SNAPSHOT 20111206) para o contexto '' 
WARNING: DPL8027: Ignore WEB-INF/sun-web.xml in archive /C:/Users/Tiago Peres/Documents/NetBeansProjects/playground-websockets/target/playground-websockets-1.0-SNAPSHOT/, as GlassFish counterpart runtime xml WEB-INF/glassfish-web.xml is present in the same archive. 
INFO: WEB0671: Loading application [__admingui] at [/] 
INFO: CORE10010: Loading application __admingui done in 2.489 ms 
INFO: The Admin Console application is loaded. 
INFO: Activating CDI extension for Spring Data JPA repositories. 
INFO: PWC1412: WebModule[null] ServletContext.log():No Spring WebApplicationInitializer types detected on classpath 
INFO: Inicializando Mojarra 2.1.6 (SNAPSHOT 20111206) para o contexto '/playground-websockets' 
INFO: Monitoring jndi:/server/playground-websockets/WEB-INF/faces-config.xml for modifications 
INFO: Refreshing org[email protected]2b58140c: startup date [Thu Mar 14 14:11:40 BRT 2013]; root of context hierarchy 
INFO: Loading XML bean definitions from URL [jndi:/server/playground-websockets/WEB-INF/beans.xml] 
INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning 
INFO: JSR-330 'javax.inject.Named' annotation found and supported for component scanning 
INFO: Overriding bean definition for bean 'loginService': replacing [Generic bean: class [com.playground.core.service.impl.LoginServiceImpl]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/C:/Users/Tiago%20Peres/Documents/NetBeansProjects/playground-websockets/target/playground-websockets-1.0-SNAPSHOT/WEB-INF/lib/playground-core-1.0-SNAPSHOT.jar!/com/playground/core/service/impl/LoginServiceImpl.class]] with [Generic bean: class [com.playground.core.service.impl.LoginServiceImpl]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jndi:/server/playground-websockets/WEB-INF/beans.xml]] 
INFO: JSR-330 'javax.inject.Inject' annotation found and supported for autowiring 
INFO: Loaded JDBC driver: com.mysql.jdbc.Driver 
INFO: Bean 'dataSource' of type [class org.springframework.jdbc.datasource.DriverManagerDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Bean 'persistenceProvider' of type [class org.hibernate.ejb.HibernatePersistence] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Bean 'jpaVendorAdapter' of type [class org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Bean 'jpaDialect' of type [class org.springframework.orm.jpa.vendor.HibernateJpaDialect] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: persistence-websockets.xml should be located inside META-INF directory; cannot determine persistence unit root URL for class path resource [persistence-websockets.xml] 
INFO: Building JPA container EntityManagerFactory for persistence unit 'playground-websockets' 
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final} 
INFO: HHH000412: Hibernate Core {4.1.6.Final} 
INFO: HHH000206: hibernate.properties not found 
INFO: HHH000021: Bytecode provider name : javassist 
INFO: HHH000204: Processing PersistenceUnitInfo [ 
    name: playground-websockets 
    ...] 
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider 
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect 
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory 
INFO: HHH000397: Using ASTQueryTranslatorFactory 
INFO: HHH000229: Running schema validator 
INFO: HHH000102: Fetching database metadata 
INFO: HHH000261: Table found: playground.gametitle 
INFO: HHH000037: Columns: [id, playedtimes, name, maximumnumberofplayers, rating, launchdate] 
INFO: HHH000261: Table found: playground.player 
INFO: HHH000037: Columns: [id, nickname, facebookid] 
INFO: HHH000261: Table found: playground.score 
INFO: HHH000037: Columns: [id, playedtimes, gametitle_id, victories, losses, player_id, points] 
INFO: HHH000261: Table found: playground.hibernate_sequence 
INFO: HHH000037: Columns: [next_val] 
INFO: Bean 'entityManagerFactory' of type [class org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
INFO: Pre-instantiating singletons in org.s[email protected]6bbeacbf: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,playerRepositoryImpl,playerRepository,gameTitleRepositoryImpl,gameTitleRepository,scoreRepositoryImpl,scoreRepository,org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor#0,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0,invitationRepositoryImpl,loggedPlayerRepository,queueRepositoryImpl,roomRepositoryImpl,invitationServiceImpl,loginService,queueServiceImpl,roomServiceImpl,dataSource,entityManagerFactory,persistenceProvider,jpaDialect,jpaVendorAdapter,org.springframework.transaction.config.internalTransactionAspect,transactionManager,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#1,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#1,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy 
INFO: Using JTA UserTransaction: [email protected] 
INFO: Using JTA TransactionManager: [email protected] 
INFO: Using JTA TransactionSynchronizationRegistry: com.su[email protected]c91aca4 
INFO: ***MyWebSocketApplication registered successfully in the Servlet*** 
INFO: ***LoginApplication registered successfully in the Servlet*** 
INFO: WEB0671: Loading application [playground-websockets] at [/playground-websockets] 
INFO: playground-websockets foi implantado com sucesso em 19.620 milissegundos. 
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181] 
INFO: Grizzly Framework 1.9.50 started in: 2ms - bound to [0.0.0.0:8181] 

我不明白爲什麼應用程序也必須部署到澤西島。我沒有任何Restfull服務,爲什麼我需要它?我可以刪除它嗎?怎麼樣?

在此先感謝您的任何答案。

+0

我收到以下運行時錯誤,我認爲這種雙重部署可能是導致它的原因:WebappClassLoader無法加載資源[org.springframework.aop.framework.AdvisedSupport $ MethodCacheKey],因爲它尚未啓動,或已經停止。 – 2013-03-14 18:14:01

回答

2

您從日誌中的第一個摘錄顯示Glassfish啓動。如果應用程序之前已部署,Glassfish會在啓動時加載它。

第二個序列是將您的應用程序的當前版本(由Oracle Glassfish插件驅動)部署到Glassfish中。它不會跟蹤Glassfish停止/啓動時部署哪個Web應用程序的版本 - 因此它只是重新發布它。

如果Glassfish在您發佈更新時仍然運行,它應該只發布一次。

+1

謝謝你的回答!我昨天發現的解決方案是在停止glassfish之前總是取消部署應用程序,但我不知道它爲什麼起作用。當我到家時,我會嘗試在不關閉服務器的情況下執行我的項目,這似乎比「執行,測試,取消部署,停止,編譯,執行...」容易得多。如果有效,我會將答案標記爲正確。謝謝:) – 2013-03-15 16:39:18

+1

當我嘗試重新發布我的應用程序時,我從Spring Data JPA中得到一個錯誤,但由於我沒有遇到我通常在重新部署時遇到的任何問題,所以我將此答案標記爲正確。 – 2013-03-15 17:17:30