1 Reply Latest reply on Jun 9, 2005 8:06 PM by Derek Chen-Becker

    HAR deployment problem in JBoss 4.0.2

    j. Eduardo Newbie

      When I try to deploy a .har file, it goes ok, but when I try to get the
      SessionFactory with the code:

      InitialContext iniCont = new InitialContext();
      SessionFactory factory = (SessionFactory)
      iniCont.lookup("java:/hibernate/NeoCepSessionFactory");
      System.out.println("Factory: " + factory);
      Session session = factory.getCurrentSession();
      System.out.println("Session: " + session);
      return session;
      


      I always get an null class. The error is the following:

      10:21:31,961 WARN [SessionFactoryObjectFactory] Not found:
      ff80808104140393010414039f190000
      10:21:31,962 INFO [STDOUT] Factory: null
      



      I saw this problem reported in other places by several people, but the only
      one who said that found the solution didn't shared it with the others.
      Any help is welcome.

      My hibernate-service.xml:
      <server>
       <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate3">
       <attribute name="DatasourceName">java:jdbc/NeoCepDS</attribute>
       <attribute name="Dialect">org.hibernate.dialect.PostgreSQLDialect</attribute>
       <attribute name="SessionFactoryName">java:/hibernate/NeoCepSessionFactory</attribute>
       <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
       <property name="QueryCacheEnabled">true</property>
       <attribute name="ShowSqlEnabled">true</attribute>
       <!-- property name="cache.use_second_level_cache">true</property -->
       </mbean>
      </server>
      


      And the initialization log:

      10:21:12,434 INFO [EARDeployer] Init J2EE application: file:/usr/lib/jboss4/server/all/deploy/cep.ear/
      10:21:12,835 INFO [Environment] Hibernate 3.0.2
      10:21:12,844 INFO [Environment] hibernate.properties not found
      10:21:12,851 INFO [Environment] using CGLIB reflection optimizer
      10:21:12,852 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      10:21:13,113 INFO [Hibernate] Using JDBC batch size : null
      10:21:13,134 INFO [Configuration] Searching for mapping documents in jar: cepHibernate.har
      10:21:13,135 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/FaixaLocalidade.hbm.xml
      10:21:13,414 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.FaixaLocalidade -> faixa_localidade
      10:21:13,710 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/GrandeUsuario.hbm.xml
      10:21:13,744 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.GrandeUsuario -> grande_usuario
      10:21:13,748 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/FaixaCaixaPostalComunitaria.hbm.xml
      10:21:13,800 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.FaixaCaixaPostalComunitaria -> faixa_caixa_postal_comunitaria
      10:21:13,801 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/ParidadeLadoSeccionamento.hbm.xml
      10:21:13,839 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.ParidadeLadoSeccionamento -> paridade_lado_seccionamento
      10:21:13,840 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/Bairro.hbm.xml
      10:21:13,862 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.Bairro -> bairro
      10:21:13,864 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/FaixaUf.hbm.xml
      10:21:13,881 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.FaixaUf -> faixa_uf
      10:21:13,883 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/Uf.hbm.xml
      10:21:13,899 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.Uf -> uf
      10:21:13,901 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/VariacaoBairro.hbm.xml
      10:21:13,921 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.VariacaoBairro -> variacao_bairro
      10:21:13,980 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/VariacaoLocalidade.hbm.xml
      10:21:14,010 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.VariacaoLocalidade -> variacao_localidade
      10:21:14,022 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/VariacaoLogradouro.hbm.xml
      10:21:14,056 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.VariacaoLogradouro -> variacao_logradouro
      10:21:14,068 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/CaixaPostalComunitaria.hbm.xml
      10:21:14,111 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.CaixaPostalComunitaria -> caixa_postal_comunitaria
      10:21:14,114 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/Localidade.hbm.xml
      10:21:14,143 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.Localidade -> localidade
      10:21:14,145 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/Pais.hbm.xml
      10:21:14,188 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.Pais -> pais
      10:21:14,193 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/Logradouro.hbm.xml
      10:21:14,205 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.Logradouro -> logradouro
      10:21:14,208 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/FaixaBairro.hbm.xml
      10:21:14,268 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.FaixaBairro -> faixa_bairro
      10:21:14,270 INFO [Configuration] Found mapping documents in jar: gov/pr/celepar/cep/hbm/TipoLocalidade.hbm.xml
      10:21:14,299 INFO [HbmBinder] Mapping class: gov.pr.celepar.cep.pojo.TipoLocalidade -> tipo_localidade
      10:21:14,301 INFO [Configuration] processing extends queue
      10:21:14,301 INFO [Configuration] processing collection mappings
      10:21:14,303 INFO [Configuration] processing association property references
      10:21:14,303 INFO [Configuration] processing foreign key constraints
      10:21:15,184 INFO [NamingHelper] JNDI InitialContext properties:{}
      10:21:15,188 INFO [DatasourceConnectionProvider] Using datasource: java:jdbc/NeoCepDS
      10:21:15,424 INFO [SettingsFactory] RDBMS: PostgreSQL, version: 7.4.7
      10:21:15,425 INFO [SettingsFactory] JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 7.4.5 JDBC3 with SSL (build 216)
      10:21:15,473 INFO [Dialect] Using dialect: org.hibernate.dialect.PostgreSQLDialect
      10:21:15,495 INFO [SettingsFactory] JDBC batch size: 15
      10:21:15,495 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
      10:21:15,498 INFO [SettingsFactory] Scrollable result sets: enabled
      10:21:15,499 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
      10:21:15,499 INFO [SettingsFactory] Aggressive release : enabled
      10:21:15,499 INFO [SettingsFactory] Default batch fetch size: 1
      10:21:15,499 INFO [SettingsFactory] Generate SQL with comments: disabled
      10:21:15,499 INFO [SettingsFactory] Order SQL updates by primary key: disabled
      10:21:15,499 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      10:21:15,521 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      10:21:15,521 INFO [SettingsFactory] Query language substitutions: {}
      10:21:15,567 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JTATransactionFactory
      10:21:15,569 INFO [NamingHelper] JNDI InitialContext properties:{}
      10:21:15,577 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
      10:21:15,577 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
      10:21:15,578 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
      10:21:15,578 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
      10:21:15,578 INFO [SettingsFactory] Automatic flush during beforeCompletion(): enabled
      10:21:15,578 INFO [SettingsFactory] Automatic session close at end of transaction: enabled
      10:21:15,579 INFO [SettingsFactory] Second-level cache: enabled
      10:21:15,579 INFO [SettingsFactory] Query cache: disabled
      10:21:15,579 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
      10:21:15,583 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
      10:21:15,584 INFO [SettingsFactory] Structured second-level cache entries: enabled
      10:21:15,605 INFO [SettingsFactory] Echoing all SQL to stdout
      10:21:15,605 INFO [SettingsFactory] Statistics: disabled
      10:21:15,606 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      10:21:15,610 INFO [SettingsFactory] Default entity-mode: pojo
      10:21:15,813 INFO [SessionFactoryImpl] building session factory
      10:21:18,636 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      10:21:18,637 INFO [NamingHelper] JNDI InitialContext properties:{}
      10:21:18,638 INFO [SessionFactoryImpl] Checking 0 named queries
      10:21:18,640 INFO [Hibernate] SessionFactory successfully built and bound into JNDI [java:/hibernate/NeoCepSessionFactory]
      10:21:18,702 INFO [TomcatDeployer] deploy, ctxPath=/cep, warUrl=file:/usr/lib/jboss4/server/all/deploy/cep.ear/cep.war/
      10:21:19,096 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
      10:21:19,097 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
      10:21:19,791 INFO [EARDeployer] Started J2EE application: file:/usr/lib/jboss4/server/all/deploy/cep.ear/
      10:21:20,557 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
      10:21:21,085 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
      10:21:21,118 INFO [JkMain] Jk running ID=0 time=0/106 config=null
      10:21:21,156 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build:
      CVSTag=JBoss_4_0_2 date=200505022023)] Started in 58s:798ms
      


      Thanks in advance,

      j.