我不知道ContainerBaCommand的来源,但这是我的错误:
我首先必须将javax.jar(具有servlet)类添加到C:\ JEE6SDKglassfish3 \ glassfish \ lib \ endorsed目录中,这给了我一个新的错误,在这里:
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
最佳答案
我认为“ ContainerBaCommand ”实际上是 ContainerBase.addChild (these guys had a similar problem)。我认为有时Java标准输出和标准错误会在控制台上混合在一起。
我假设您正在使用类似app-server-ant.xml的东西。您的Ant错误似乎表明“ asadmin ”现在用于部署应用程序的语法已更改。因此,我认为您需要从当前任务重新编写部署任务:
<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>
关于jakarta-ee - 我需要帮助弄清楚为什么Ant会给我这个错误消息(设置Java Pet Store)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7355416/