- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Eclipse STS 3.2.0。这是我到目前为止所做的:
我单独运行 Tomcat,并通过 Tomcat 部署生成的 war。我还粘贴了错误(在 STS 错误报告之后)。
我必须使用 Maven,所以我执行了命令“grails create-pom”,我添加了“pom true”,如下所述: http://grails.org/doc/2.3.x/ref/Command%20Line/create-pom.html
我删除了文件夹:“C:\Users\ch.grails\ivy-cache”、“project\target”,再次运行命令“grails clean”和“grails run-war”,使用同样的错误结果。
A) 这是STS的完整错误报告:
| Environment set to development.....
| Packaging Grails application....
| Compiling 22 source files.....
| Error 2013-05-16 18:50:20,674 [main] ERROR plugins.DefaultGrailsPlugin - This class is not an ArtefactHandler:org.grails.plugin.resources.artefacts.ResourceMapperArtefactHandler
| Error 2013-05-16 18:50:20,678 [main] ERROR plugins.DefaultGrailsPlugin - This class is not an ArtefactHandler:org.grails.plugin.resources.artefacts.ResourcesArtefactHandler
| Error 2013-05-16 18:50:20,718 [main] ERROR plugins.DefaultGrailsPlugin - This class is not an ArtefactHandler:grails.plugin.cache.CacheConfigArtefactHandler
| Compiling 3 GSP files for package [alojamiento]..
| Compiling 4 GSP files for package [databaseMigration]..
| Building WAR file.....
| Done creating WAR target\Alojamiento-0.1.war
| Error java.lang.NullPointerException
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
| Error at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
| Error at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
| Error at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
| Error at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
(...)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeWithGantInstance(GrailsScriptRunner.java:768)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptFile(GrailsScriptRunner.java:566)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:465)
| Error at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching(GrailsScriptRunner.java:416)
| Error at org.grails.ide.api.impl.GrailsConnectorImpl.executeCommand(GrailsConnectorImpl.java:144)
| Error at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run(GrailsProcess.java:126)
| Error at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main(GrailsProcess.java:89)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
| Error at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
| Error Caused by: java.lang.NullPointerException
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.createGroovyObjectGetPropertySite(AbstractCallSite.java:254)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.acceptGroovyObjectGetProperty(AbstractCallSite.java:239)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
| Error at org.grails.plugins.tomcat.TomcatServer.<init>(TomcatServer.groovy:58)
| Error at org.grails.plugins.tomcat.IsolatedWarTomcatServer.<init>(IsolatedWarTomcatServer.groovy:35)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
| Error at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
| Error at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
| Error at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
| Error at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
| Error at org.grails.plugins.tomcat.TomcatServerFactory.createForWAR(TomcatServerFactory.groovy:88)
| Error at org.codehaus.groovy.grails.project.container.GrailsProjectRunner.runWarInternal(GrailsProjectRunner.groovy:151)
| Error at org.codehaus.groovy.grails.project.container.GrailsProjectRunner.runWar(GrailsProjectRunner.groovy:96)
| Error at org.codehaus.groovy.grails.project.container.GrailsProjectRunner$runWar.call(Unknown Source)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
(...)
| Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
| Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
| Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
| Error at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:231)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
| Error at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
| Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
| Error at java.lang.reflect.Method.invoke(Method.java:601)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
| Error at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
| Error at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
| Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
| Error at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
| Error ... 76 more
B) Tomcat 控制台的错误报告已经修复(根据@Sérgio Michels 的回答):
may 16, 2013 6:57:17 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Despliegue del archivo D:\Software\IW-apache-tomcat-7.0.37\webapps\Alojami
ento-0.1.war de la aplicaci¾n web
may 16, 2013 6:57:34 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
2013-05-16 18:57:50,613 [localhost-startStop-1] ERROR context.GrailsContextLoade
r - Error initializing the application: Error creating bean with name 'transact
ionManagerPostProcessor': Initialization of bean failed; nested exception is org
.springframework.beans.factory.BeanCreationException: Error creating bean with n
ame 'transactionManager': Cannot resolve reference to bean 'sessionFactory' whil
e setting bean property 'sessionFactory'; nested exception is org.springframewor
k.beans.factory.BeanCreationException: Error creating bean with name 'sessionFac
tory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean
property 'lobHandler'; nested exception is org.springframework.beans.factory.Bea
nCreationException: Error creating bean with name 'lobHandlerDetector': Invocati
on of init method failed; nested exception is org.springframework.jdbc.support.M
etaDataAccessException: Error while extracting DatabaseMetaData; nested exceptio
n is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of cl
ass 'com.mysql.jdbc.Driver' for connect URL 'jdbc:h2:prodDb;MVCC=TRUE'
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'transactionManagerPostProcessor': Initialization of bean failed; nested
exception is org.springframework.beans.factory.BeanCreationException: Error crea
ting bean with name 'transactionManager': Cannot resolve reference to bean 'sess
ionFactory' while setting bean property 'sessionFactory'; nested exception is or
g.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' whi
le setting bean property 'lobHandler'; nested exception is org.springframework.b
eans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDet
ector': Invocation of init method failed; nested exception is org.springframewor
k.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData;
nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create J
DBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:h2:prodDb;MVCC
=TRUE'
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'transactionManager': Cannot resolve reference to bean 'sessio
nFactory' while setting bean property 'sessionFactory'; nested exception is org.
springframework.beans.factory.BeanCreationException: Error creating bean with na
me 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while
setting bean property 'lobHandler'; nested exception is org.springframework.bea
ns.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetec
tor': Invocation of init method failed; nested exception is org.springframework.
jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; n
ested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDB
C driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:h2:prodDb;MVCC=T
RUE'
(...)
INFO: Server startup in 39571 ms
更新:
C) Tomcat控制台新报错,经@Sérgio Michels修正:
INFO: Despliegue del archivo D:\Software\IW-apache-tomcat-7.0.37\webapps\Alojami
ento-0.1.war de la aplicaci¾n web
may 16, 2013 10:09:12 PM org.apache.catalina.startup.TaglibUriRule body
INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
2013-05-16 22:09:20,376 [localhost-startStop-1] ERROR plugins.DefaultGrailsPlugi
n - This class is not an ArtefactHandler:org.grails.plugin.resources.artefacts.
ResourceMapperArtefactHandler
2013-05-16 22:09:20,381 [localhost-startStop-1] ERROR plugins.DefaultGrailsPlugi
n - This class is not an ArtefactHandler:org.grails.plugin.resources.artefacts.
ResourcesArtefactHandler
2013-05-16 22:09:20,429 [localhost-startStop-1] ERROR plugins.DefaultGrailsPlugi
n - This class is not an ArtefactHandler:grails.plugin.cache.CacheConfigArtefac
tHandler
2013-05-16 22:09:27,435 [localhost-startStop-1] ERROR context.GrailsContextLoade
r - Error initializing the application: HttpServletRequest
java.lang.NoClassDefFoundError: HttpServletRequest
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.getDeclaredMethods(Class.java:1810)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: HttpServletRequest
... 8 more
2013-05-16 22:09:27,439 [localhost-startStop-1] ERROR context.GrailsContextLoade
r - Error initializing Grails: HttpServletRequest
java.lang.NoClassDefFoundError: HttpServletRequest
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.getDeclaredMethods(Class.java:1810)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: HttpServletRequest
... 8 more
may 16, 2013 10:09:27 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
may 16, 2013 10:09:27 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Fall¾ en arranque del Contexto [/Alojamiento-0.1] debido a errores previ
os
更新 2
D) 运行测试后同样失败!
| Tests FAILED - view reports in D:\ch\eclipse_workspaces\IW-grails\Alojamiento\target\test-reports
| Error java.lang.NullPointerException
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
| Error at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
| Error at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
| Error at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
最佳答案
出现第二个错误是因为您没有正确定义数据源:
Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create J DBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:h2:prodDb;MVCC =TRUE'
您正在将 h2
jdbc url 与 MySQL 驱动程序 (com.mysql.jdbc.Driver) 一起使用。
如果您调整您的 DataSource.groovy
,您部署的实例应该可以工作。
关于eclipse - 命令 "grails run-war"抛出错误 java.lang.NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16593443/
当我尝试从 netbeans 构建 ear 项目时,为什么 maven ear 插件会运行 war:war(插件目标) 我的过程: 我右键单击 ear 项目(其中列出了 war 依赖项)并首先清理,然
在 Java EE 环境下,我构建了一个包含多个 JSP 文件的网页。让我们假设包含的 JSP 之一是 header.jsp。可以与 Stackoverflow 使用的非常相似,显示有关用户、链接等的
我想知道使用 maven package phase 创建的 war 文件是否等同于使用 maven war plugin war:war goal 创建的 war 文件。 假设我们有一个像这样的 p
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我想根据配置文件(dev 或 prod)配置属性文件,但是属性文件的位置未正确构造。我在 SO 上找到了类似问题的答案,但这些答案都没有帮助解决这个问题。 我收到的错误如下: Error loadin
我想知道部署的“WAR”文件会分解到 JBoss 7 中的哪个位置?在 JBoss 4.3 中,它会在“tmp”文件夹中的某处爆炸,但我无法找到它在 JBoss 7 中爆炸到的位置。谢谢 最佳答案 它
我想创建一个多模块项目,其中多个模块属于 war 类型。例如 somejars servletsAndJsps springMVCapp angularJsApp 其中 3 个可以作为 WAR 应用程
我必须在单元测试期间测试托管在 Tomcat 上的 Web 服务的代码覆盖率。我将进行手动测试意味着我将在我的 http 请求中传递不同的参数值,并且需要为发送到服务器的每个请求的每个测试用例提供覆盖
我是一个 Jboss Wildfly 8.2 实例我有一个 webapp ROOT.war和另一个 OTHER.war我需要类(class) OtherXYZ.class那是里面 OTHER.war能
因此,在 VPS Ubuntu 服务器上尝试使用 Maven 进行全新安装时出现此错误。 我已经安装了必要的元素来制作它,但仍然无济于事。 root@iHRS:~/hapi-fhir-jpaserve
健身download page只有 standalone.jar 选项,这也是说明的目的。 是否有可能在单独的应用程序服务器上安装 FitNesse,例如 Tomcat?没有直接下载任何 war /耳
我想在 JBoss 4.2 中部署一场 war ,但我无法控制它的目录,所以我无法替换 jsf-impl.jar和 jsf-api.jar . 我的问题是:如何配置war才能依赖于jsf-impl.j
我想在将 war 任务输出部署到存储库之前设置它的文件名。 例如项目名称是 abc最初它会导致 abc-1.0.0-SNAPSHOT.war 但我希望应该有两个生成的内容相同的 war 文件: def
我有一个 Maven pom,它使用 war 。但实际上,我不想构建 war 文件,我只想收集所有依赖的 jar 并创建一个完整的部署目录。 所以我正在运行 war:exploded生成部署目录的目标
注意:我无法将它们打包到 EAR 中。这里有一些限制。 我有 2 个 war 文件。 help.war 和 helpConnect.war 两者都放置在 GlassFish 服务器的同一域中。 从 h
我有一个项目,其中 3 个 war-modules 被打包在一个 ear-module 中。我的问题是每个库 jar 都包含在每个 war 模块以及 ear 模块中,这使得生成的 ear 文件非常大(
我有一个在 artifactory 中发布的第三方打包 war 。我需要创建一个 gradle 作业,它将从 artifactory 中获取 war,将其分解到一个临时目录,将一些自定义库(jars)
我们有一个运行当前 Web 服务的 Apache tomcat 服务器。我们试图部署第二个版本(进行了一些调整),但是当我们复制 war 文件时,第一个版本停止工作。为什么?? 最佳答案 您的 Web
我有几个 tomcat 应用程序,使用 .war 文件部署在 tomcat 中。尽管这些 war 彼此独立,但它们都是更大概念/应用程序的一部分,而且经常,一场 war 需要调用另一场 war 的代码
过去,Web 应用程序的静态资源始终位于 src/main/webapp 下。 最近,Spring Initializr为我创建了一个新的项目布局,因此发现资源应该位于src/main/resourc
我是一名优秀的程序员,十分优秀!