当前位置: 首页 > 知识库问答 >
问题:

无法在HQL查询创建中加载类

桂志诚
2023-03-14

在将glassfish升级到4版本并将hibernate升级到4.3.5之后,我在类加载方面遇到了一个奇怪的问题。

所以,我创造了这样的HQL:

选择新列表(s.id,s.name,s.serviceGroup.id,s.serviceGroup.name,count(t.id),sum(COALESCE(t.dealerFeeActual,0)t.sum))FROM GroupTransaction gt JOIN gt。事务t JOIN t.service s WHERE 1=1 AND(t.date

当我调用em.createQuery时,它抛出异常:

![2014-04-27T22:56:29.757 0600][玻璃鱼4.0][警告][] [javax.enterprise.system.util] [tid: _ThreadID=156 _ThreadName=http-listener-1(1)] [timeMillis: 1398617789757] [levelValue: 900] [[ ASURLClassLoader EarLibClassLoader : doneCall = true doneSnapshot = ASURLClassLoader.done() call ON EarLibClassLoader : urlSet = [URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/javaconfig-1.4.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/slf4j-api-1.6.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-io-2.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/httpclient-4.1.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/async-http-client-1.7.0.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/collections-generic-4.01.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/httpcore-4.2-alpha2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jboss-logging-3.1.3.GA.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jdom.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/smslib-v3.5.0.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/lib/log4j-1.2.16.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/lib/jsmpp-2.1.0.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/lib/commons-net-2.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/lib/slf4j-api-1.6.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/lib/slf4j-log4j12-1.6.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-logging-1.1.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jboss-transaction-api_1.2_spec-1.0.0.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/hibernate-commons-annotations-4.0.4.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-codec-1.4.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/log4j-1.2.16.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jboss-archive-browsing.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/httpasyncclient-4.0-alpha3.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/cglib-2.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/dom4j-1.6.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/poi-3.9.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/ehcache-core-2.4.3.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/pduutils.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-collections-3.2.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/httpcore-nio-4.2-alpha2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/hibernate-core-4.3.5.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/itextpdf-5.1.0.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/netty-3.2.7.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/hibernate-ehcache-4.3.5.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-exec-1.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/httpclient-cache-4.1.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/antlr-2.7.7.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/hibernate-entitymanager-4.3.5.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/hibernate-jpa-2.1-api-1.0.0.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/javassist-3.18.1-GA.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/kaptcha-2.3.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/slf4j-log4j12-1.6.1.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/json.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jsmpp-2.1.0.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/javadbf-0.4.0.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jdom-2.0.5.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/httpmime-4.1.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/backport-util-concurrent.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/jandex-1.1.0.Final.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-net-2.2.jar, URLEntry : file:/home/ash/projects/ermak2/dist/gfdeploy/ermak2/lib/commons-httpclient-3.1.jar]

doneCalled = false Parent -

AT 星期日 4 月 27 日 22:44:57 KGT 2014 BY :[java.lang.Thread.getStackTrace(Thread.java:1588), com.sun.enterprise.loader.ASURLClassLoader.done(ASURLClassLoader.java:216), com.sun.enterprise.loader.ASURLClassLoader.preDestroy(ASURLClassLoader.java:184), org.glassfish.javaee.full.deployment.EarClassLoader.preDestroy(EarClassLoader.java:114), org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:260),org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:210), com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle .java:482), com.sun.enterprise.v3.server.ApplicationLifecycle .deploy(ApplicationLifecycle .java:219), org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491), com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527),com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523), java.security.AccessController.doPrivileged(Native Method), javax.security.auth.Subject.doAs(Subject.java:356), com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522), com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546), com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423),com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108), com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762), com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674), com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534), com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224),org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297), com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246), org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191), org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168), org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189),org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206), org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136), org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114), org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77), org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838), org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113), org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115), org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55), org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135), org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564), org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544), java.lang.Thread.run(Thread.java:744)] 父级 -

这样的例外在message^的每一个领域都被逐项抛出好几次

从以下堆栈跟踪调用done后,请求查找类s.name

另一个查询有效,实体查找也有效。这个问题只发生在一个SessionBean上。

共有1个答案

令狐新翰
2023-03-14

好的,我只需要等待java 8的GF4正式发布。目前这一切都正常。

 类似资料:
  • 问题内容: 有没有一种方法可以在HQL中创建一个Distinct查询。通过使用“ distinct”关键字或其他某种方法。我不确定distinct是否是HQL的有效键,但是我正在寻找与SQL关键字“ distinct”等效的HQL。 问题答案: 这是我们使用的hql的片段。(名称已更改,以保护身份)

  • 这个问题可能有答案……但对于使用postgresql数据库的openbravo来说并没有答案。 我有openbravo 3.0框架。在我的窗口中,我有两个日期字段,即fromdate和todate。要求是我必须编写一个hql where子句来根据当前日期过滤记录。日期字段是没有时区的时间戳。 意思是fromdate 和迄今为止 我浏览了这个链接,将hql where子句编写为 当我打开此窗口时,我

  • 问题内容: 当我们必须使用 在Hibernate中,它们之间有什么区别? 问题答案: createQuery: http://docs.jboss.org/hibernate/core/3.6/reference/zh- CN/html/objectstate.html#objectstate- querying http://docs.jboss.org/hibernate/core/3.6/r

  • 我在使用Python弹性搜索访问数据时遇到了一个问题。我正在得到 尝试使用时出错 我的弹性搜索版本6.5。4,python版本3.7。2.

  • 我正在运行以下内容,作为HQL查询where子句的一部分: 当我在SQL Management studio中运行它时,它运行得很好,但是当我通过eclipse运行它时,我得到了以下错误: 引起:java.lang.NullPointerExceptionorg.hibernate.dialect.function.CastFunction.render(CastFunction.java:55)

  • 我正在使用文件IO动态创建一个文件, FileOutputStream fos=新的FileOutputStream(“sample.txt”); 并尝试加载样本。使用getClass()创建txt。getResourceAsStream(“sample.txt”)在另一个类中,它无法加载文件,而如果我在eclipse中刷新项目,它可以加载文件,getResourceStream是否缓存文件?,我