我需要帮助弄清楚为什么 Ant 给我这个错误消息(设置 Java Pet Store)? [英] I need help figuring out why Ant is giving me this error messages(setting up Java Pet Store)?

查看:15
本文介绍了我需要帮助弄清楚为什么 Ant 给我这个错误消息(设置 Java Pet Store)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道 ContainerBaCommand 来自哪里,但这是我的错误:

I have no idea where ContainerBaCommand is coming from, but here's my error:

我首先必须将 javax.jar(其中包含 servlet)类添加到 C:\JEE6SDKglassfish3\glassfish\lib\endorsed 目录中,它给了我一个新的错误,在这里:

I first had to add javax.jar (which has the servlet ) class into the C:\JEE6SDKglassfish3\glassfish\lib\endorsed directory, and it gave me a new error, here:

Buildfile: C:\petstore~svn\trunk\ws\apps\petstore\build.xml

check:

tools:

-pre-deploy:

deploy:
     [exec] Deprecated syntax, instead use:
     [exec] asadmin --user admin --passwordfile c:/JEE6SDKglassfish3/glassfish/samples/bp-project/passwordfile --host localhost --port 4848 deploy [options] ...

     [exec] remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBaCommand deploy failed.
     [exec] se.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener. Please see server.log for more details.

BUILD FAILED
C:\petstore~svn\trunk\ws\bp-project\app-server-ant.xml:382: exec returned: 1

Total time: 47 seconds

安装文件夹中的所有文件:http://tinyurl.com/3gbb6o4

All the files in the setup folder: http://tinyurl.com/3gbb6o4

非常感谢马克!

推荐答案

我认为ContainerBaCommand"实际上是 ContainerBase.addChild (这些人也有类似的问题).我认为有时 Java 标准输出和标准错误会在控制台上混淆.

I think the "ContainerBaCommand" is actually ContainerBase.addChild (these guys had a similar problem). I think sometimes Java standard output and standard errors get all mixed up on the console.

我假设你正在使用这样的东西 app-server-ant.xml.您的 Ant 错误似乎表明asadmin"现在用于部署您的应用程序的语法已更改.因此,我认为您需要根据当前的情况重新编写部署任务:

I assume you are using something like this app-server-ant.xml. Your Ant error seems to be suggesting that the syntax that "asadmin" now uses to deploy your application has changed. I therefore think you need to re-write your deploy task from what it is currently:

<exec executable="${asadmin}" failonerror="${failonerror}">
  <arg line=" deploy "/>
  <arg line=" --user ${javaee.server.username}" />
  <arg line=" --passwordfile ${javaee.server.passwordfile}" />
  <arg line=" --host ${javaee.adminserver.name}" />
  <arg line=" --port ${javaee.adminserver.port}" />
  <arg line=" --name ${module.name}"/>
  <arg line=" --force=true "/>
  <arg line=" --upload=true "/>
  <arg line=" --precompilejsp "/>
  <arg line=" --dbvendorname ${db.vendorname}"/>
  <arg line="${app.module}" />
</exec>

到:

<exec executable="${asadmin}" failonerror="${failonerror}">
  <arg line=" --user ${javaee.server.username}" />
  <arg line=" --passwordfile ${javaee.server.passwordfile}" />
  <arg line=" --host ${javaee.adminserver.name}" />
  <arg line=" --port ${javaee.adminserver.port}" />
  <arg line=" deploy "/>
  <arg line=" --force=true "/>
  <arg line=" --precompilejsp "/>
  <arg line=" --name ${module.name}"/>
  <arg line=" --upload=true "/>
  <arg line=" --dbvendorname ${db.vendorname}"/>
  <arg line="${app.module}" />
</exec>

我很惊讶您需要将 javax.jar(其中包含 servlet 类)复制到支持的 lib 中.Servlet(和 ServletContextListener 就此而言)是应用服务器非常重要的类.我希望它们已经存在于 Glassfish 类路径中(在 Glassfish 3.1 中,它们位于 ~glassfish/modules/javax.servlet.jar 中).我怀疑将您的 javax.jar 复制到lib/endorsed"会导致比它能够解决的更多问题.

I'm surprised that you needed to copy javax.jar (which has the servlet class) into lib endorsed. The Servlet (and ServletContextListener for that matter) are very important classes for an application server. I would expect them to exist in the Glassfish class path already (in Glassfish 3.1 they are in ~glassfish/modules/javax.servlet.jar). I suspect copying your javax.jar into "lib/endorsed" is causing more problems than it would solve.

我希望这会有所帮助.

这篇关于我需要帮助弄清楚为什么 Ant 给我这个错误消息(设置 Java Pet Store)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆