gpt4 book ai didi

java - 命名查询 : findByName in JBoss AS7 with Hibernate 3. 6 和 OJdbc6 中的错误

转载 作者:行者123 更新时间:2023-12-02 04:36:49 25 4
gpt4 key购买 nike

我正在尝试将ejb应用程序从OC4J迁移到JBoss AS7,应用程序使用OJdbc 6和Hibernate 3,由于Jboss在Hibernate 4上运行,所以我将JBoss配置为支持Hibernate 3.6。但是,在部署 Ear 时,我在控制台中收到以下错误(应用程序使用 Oracle 11g 作为数据库):

19:23:21,794 INFO  [org.hibernate.cfg.Configuration] (ServerService Thread Pool -- 51) Hibernate Validator not found: ignoring
19:23:21,893 INFO [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 51) HV000001: Hibernate Validator 4.3.2.Final-redhat-1
19:23:22,131 INFO [org.hibernate.cfg.search.HibernateSearchEventListenerRegister] (ServerService Thread Pool -- 51) Unable to find org.hibernate.search.event.F
ullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
19:23:22,146 INFO [org.hibernate.connection.ConnectionProviderFactory] (ServerService Thread Pool -- 51) Initializing connection provider: org.hibernate.ejb.co
nnection.InjectedDataSourceConnectionProvider
19:23:22,160 INFO [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] (ServerService Thread Pool -- 51) Using provided datasource
19:23:23,995 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Database ->
name : Oracle
version : Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option
major : 11
minor : 2
19:23:24,026 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Driver ->
name : Oracle JDBC driver
version : 11.2.0.4.0
major : 11
minor : 2
19:23:24,076 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 51) Using dialect: org.hibernate.dialect.Oracle10gDialect
19:23:24,369 INFO [org.hibernate.transaction.TransactionFactoryFactory] (ServerService Thread Pool -- 51) Transaction strategy: org.hibernate.ejb.transaction.J
oinableCMTTransactionFactory
19:23:24,379 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] (ServerService Thread Pool -- 51) instantiating TransactionManagerLookup: org.jbo
ss.as.jpa.hibernate3.JBossAppServerJtaPlatform
19:23:24,395 INFO [org.hibernate.transaction.TransactionManagerLookupFactory] (ServerService Thread Pool -- 51) instantiated TransactionManagerLookup
19:23:24,401 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Automatic flush during beforeCompletion(): disabled
19:23:24,407 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Automatic session close at end of transaction: disabled
19:23:24,413 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) JDBC batch size: 15
19:23:24,421 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) JDBC batch updates for versioned data: disabled
19:23:24,430 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Scrollable result sets: enabled
19:23:24,436 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) JDBC3 getGeneratedKeys(): disabled
19:23:24,443 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Connection release mode: auto
19:23:24,449 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Default batch fetch size: 1
19:23:24,455 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Generate SQL with comments: disabled
19:23:24,463 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Order SQL updates by primary key: disabled
19:23:24,471 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Order SQL inserts for batching: disabled
19:23:24,478 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
19:23:24,488 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 51) Using ASTQueryTranslatorFactory
19:23:24,494 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Query language substitutions: {}
19:23:24,500 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) JPA-QL strict compliance: enabled
19:23:24,506 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Second-level cache: enabled
19:23:24,511 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Query cache: disabled
19:23:24,518 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
19:23:24,529 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Optimize cache for minimal puts: disabled
19:23:24,535 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Structured second-level cache entries: disabled
19:23:24,547 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Statistics: disabled
19:23:24,553 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Deleted entity synthetic identifier rollback: disabled
19:23:24,559 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Default entity-mode: pojo
19:23:24,566 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Named query checking : enabled
19:23:24,573 INFO [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 51) Check Nullability in Core (should be disabled when Bean Validation is o
n): disabled
19:23:24,600 INFO [org.hibernate.impl.SessionFactoryImpl] (ServerService Thread Pool -- 51) building session factory
19:23:24,610 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [wrapper_materialized_blob] overrides previous : o
rg.hibernate.type.WrappedMaterializedBlobType@1e65667
19:23:24,619 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [materialized_blob] overrides previous : org.hiber
nate.type.MaterializedBlobType@132a704
19:23:24,633 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [blob] overrides previous : org.hibernate.type.Blo
bType@731c20
19:23:24,644 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [java.sql.Blob] overrides previous : org.hibernate
.type.BlobType@731c20
19:23:24,656 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [clob] overrides previous : org.hibernate.type.Clo
bType@13ba11c
19:23:24,671 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [java.sql.Clob] overrides previous : org.hibernate
.type.ClobType@13ba11c
19:23:24,684 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [materialized_clob] overrides previous : org.hiber
nate.type.MaterializedClobType@1ce6a36
19:23:24,696 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [characters_clob] overrides previous : org.hiberna
te.type.PrimitiveCharacterArrayClobType@9f3eba
19:23:24,708 INFO [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 51) Type registration [wrapper_characters_clob] overrides previous : org
.hibernate.type.CharacterArrayClobType@cf3c39
19:23:24,775 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 51) no default (no-argument) constructor for class: com.tmobile.itnetdev
.fixedbuild.vminfra.business.searchresults.VmsearchResultsCMPBean (class must be instantiated by Interceptor)
19:23:24,839 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 51) no default (no-argument) constructor for class: com.tmobile.itnetdev
.fixedbuild.vminfra.business.searchresults.InfEquipmentRoomsCMPBean (class must be instantiated by Interceptor)
19:23:24,863 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 51) no default (no-argument) constructor for class: com.tmobile.itnetdev
.fixedbuild.vminfra.business.searchresults.PmnotificationsCMPBean (class must be instantiated by Interceptor)
19:23:24,883 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 51) no default (no-argument) constructor for class: com.tmobile.itnetdev
.fixedbuild.vminfra.business.searchresults.InfStandortalternativenCMPBean (class must be instantiated by Interceptor)
19:23:24,927 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 51) no default (no-argument) constructor for class: com.tmobile.itnetdev
.fixedbuild.vminfra.business.searchresults.InfAdressenCMPBean (class must be instantiated by Interceptor)
19:23:24,947 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 51) no default (no-argument) constructor for class: com.tmobile.itnetdev
.fixedbuild.vminfra.business.searchresults.VmsearchResultHeadCMPBean (class must be instantiated by Interceptor)
19:23:24,999 INFO [org.hibernate.impl.SessionFactoryObjectFactory] (ServerService Thread Pool -- 51) Not binding factory to JNDI, no JNDI name configured
19:23:25,052 ERROR [org.hibernate.hql.PARSER] (ServerService Thread Pool -- 51) line 1:77: unexpected token: :
19:23:25,058 WARN [org.hibernate.hql.ast.HqlParser] (ServerService Thread Pool -- 51) processEqualityExpression() : No expression to process!
19:23:25,065 ERROR [org.hibernate.impl.SessionFactoryImpl] (ServerService Thread Pool -- 51) Error in named query: findByName: org.hibernate.hql.ast.QuerySyntax
Exception: unexpected token: : near line 1, column 77 [SELECT OBJECT(alt) FROM InfStandortalternativenCMP AS alt WHERE alt.alteName:alternativenname]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:549) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:413) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842) [hibernate-core-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902) [hibernate-entitymanager-3.6.1.Final.jar:3.6.1.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74) [hibernate-entitymanager-3.6.1.Final.jar:3.6
.1.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200) [jboss-as-jpa-7.4.2.Fina
l-redhat-2.jar:7.4.2.Final-redhat-2]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57) [jboss-as-jpa-7.4.2.Final-redhat-2.jar:7.4.2.Final
-redhat-2]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99) [jboss-as-jpa-7.4.2.Final-redhat-2.jar:7.4.2.Final-redh
at-2]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_18]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_18]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_18]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)

19:23:25,238 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 51) MSC000001: Failed to start service jboss.persistenceunit."demo.ear/pegabas
e-fixedbuild-ejb.jar#manager1": org.jboss.msc.service.StartException in service jboss.persistenceunit."demo.ear/demo-fixedbuild-ejb.jar#manager1": javax
.persistence.PersistenceException: [PersistenceUnit: manager1] Unable to build EntityManagerFactory
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_18]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_18]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_18]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: manager1] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:911)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
... 4 more
Caused by: org.hibernate.HibernateException: Errors in named queries: findByName
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:426)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1842)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
... 8 more

19:23:25,459 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "demo.ear" (runtime-name : "demo.ear")
19:23:25,468 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.resources.jdbc.demoManagementDataSource (missing) dependents: [service jboss.naming.context.java.comp.demo
.demo-framework-ejb.demo/framework/PerformanceMeasurementHome.env.jdbc.demoManagementDataSource, service jboss.naming.context.java.comp.demo.peg
abase-framework-ejb.demo/framework/VisualizationEnvironmentHome.env.jdbc.demoManagementDataSource, service jboss.naming.context.java.comp.demo.test-framework-ejb.demo/framework/UseCaseHome.env.jdbc.demoManagementDataSource]
JBAS014777: Services which failed to start: service jboss.persistenceunit."demo.ear/demo-fixedbuild-ejb.jar#manager1": org.jboss.msc.service.Star
tException in service jboss.persistenceunit."demo.ear/demo-fixedbuild-ejb.jar#manager1": javax.persistence.PersistenceException: [PersistenceUnit: manag
er1] Unable to build EntityManagerFactory

19:23:25,628 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
19:23:25,631 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
19:23:25,639 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.3.2.GA (AS 7.4.2.Final-redhat-2) started (with errors) in 24156ms - Started 2
087 of 2232 services (108 services failed or missing dependencies, 99 services are lazy, passive or on-demand)

最佳答案

您的查询似乎有错误,

SELECT OBJECT(alt) FROM InfStandortalternativenCMP AS alt WHERE alt.alteName:alternativenname

应该是

SELECT OBJECT(alt) FROM InfStandortalternativenCMP AS alt WHERE alt.alteName = :alternativenname

关于java - 命名查询 : findByName in JBoss AS7 with Hibernate 3. 6 和 OJdbc6 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30646028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com