踩了J2EE第一个坑, Oracle Tutorial JavaEE 8 "hello1" Example Failure
-记从C#转战Java的第一篇。
最近在慢慢啃Oracle官方出的J2EE8教程(痛苦脸),跑了第一个示范程序就不慎踩坑。。。
按照教程上一步一步地部署Hello1到Glassfish服务器,什么情况?! 红红的error太刺眼了。

上看下看左看右看,发现问题原来是出在POM文件里,而且是父POM里。比如当前Hello1的路径在我的机器上是C:\Users\KK\ChanDesktop\Java\java_ee_sdk-8\glassfish5\docs\javaee-tutorial\examples\web\jsf\hello1,那么父POM文件在C:\Users\KK\Desktop\Java\java_ee_sdk-8\glassfish5\docs\javaee-tutorial\examples\pom.xml. 一种可行的解决办法就是修改这个pom.xml。那问题倒底是出在哪里呢?Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project hello1: Execution deploy of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy failed: Cannot create configuration. There's no registered configuration for the parameters (container [id = [glassfish5x], type = [installed]], configuration type [existing]). Actually there are no valid types registered for this configuration. Maybe you've made a mistake spelling it? -> [Help 1]To see the full stack trace of the errors, re-run Maven with the -e switch.Re-run Maven using the -X switch to enable full debug logging.For more information about the errors and possible solutions, please read the following articles:[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
1 <properties> 2 <glassfish.home.prefix>c:/</glassfish.home.prefix> 3 <glassfish.executables.suffix>.bat</glassfish.executables.suffix> 4 </properties>
1 <properties> 2 <glassfish.home.prefix>c:/Users/KK/Desktop/Java/java_ee_sdk-8</glassfish.home.prefix> 3 <glassfish.executables.suffix>.bat</glassfish.executables.suffix> 4 </properties>
2. 再Build一次,发现还是不对。搜了一下网上的各种解决方案,需要把cargo plugin的container id改成glassfish4x.
1 <cargo.plugin.version>1.4.4</cargo.plugin.version> 2 <glassfish.domain.name>domain1</glassfish.domain.name> 3 <glassfish.home>${glassfish.home.prefix}/glassfish5</glassfish.home> 4 <integration.container.id>glassfish5x</integration.container.id>
改为:
1 <cargo.plugin.version>1.4.4</cargo.plugin.version> 2 <glassfish.domain.name>domain1</glassfish.domain.name> 3 <glassfish.home>${glassfish.home.prefix}/glassfish5</glassfish.home> 4 <integration.container.id>glassfish4x</integration.container.id>
算是解了个惑,但是还是不是很明白为啥Oracle官方教程里会把这个搞错,也许是我配置的问题,不懂。。。改了这两个地方,终于可以通过啦,大功告成!第一步迈得好不容易,鼓掌。


浙公网安备 33010602011771号