Arquillian 和 Tomcat6 问题
我有两个关于 Arquillian 和 Tomcat 的问题:
- 我的 arquillian 测试失败,并显示以下错误消息:
org.jboss.jsfunit.example.hellojsf.HelloJSFTest 已用时间:0 秒 <<<<错误! org.jboss.arquillian.container.spi.ConfigurationException: 无法连接到 Tomcat 管理器。服务器命令 (/deploy?path=%2Ftest) 失败,响应代码 (401) 和 响应消息(非自动)。请确保您提供了 能够访问 Tomcat 管理器的用户的正确凭据 应用。这些凭证可以在 Arquillian 中指定 容器配置为“user”和“pass”属性。用户必须 在 tomcat-users.xml 文件中指定了适当的角色。
仅供参考,我的 arquillian.xml 文件如下:
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
<engine>
<property name="deploymentExportPath">target/</property>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</engine>
<defaultProtocol type="Servlet 2.5" />
<container qualifier="tomcat-remote">
<configuration>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</configuration>
</container>
</arquillian>
我正在尝试为 tomcat 6 调整示例应用程序。任何人都可以帮忙吗?
-Arquillian什么时候支持tomcat 7?
问候,
J.
tomcat-users.xml:
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="admin" password="admin75" roles="manager,admin"/>
</tomcat-users>
I have two questions regarding Arquillian and Tomcat:
-My arquillian tests fail with the following error message:
org.jboss.jsfunit.example.hellojsf.HelloJSFTest Time elapsed: 0 sec
<<< ERROR! org.jboss.arquillian.container.spi.ConfigurationException:
Unable to connect to Tomcat manager. The server command
(/deploy?path=%2Ftest) failed with responseCode (401) and
responseMessage (Non-Autorisé). Please make sure that you provided
correct credentials to an user which is able to access Tomcat manager
application. These credentials can be specified in the Arquillian
container configuration as "user" and "pass" properties. The user must
have appripriate role specified in tomcat-users.xml file.
FYI my arquillian.xml file is as follows:
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
<engine>
<property name="deploymentExportPath">target/</property>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</engine>
<defaultProtocol type="Servlet 2.5" />
<container qualifier="tomcat-remote">
<configuration>
<property name="jmxPort">8099</property>
<property name="user">admin</property>
<property name="pass">admin75</property>
</configuration>
</container>
</arquillian>
I am trying to adapt the sample app for tomcat 6. Can anyone please help?
-When will Arquillian support tomcat 7?
Regards,
J.
tomcat-users.xml:
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="admin" password="admin75" roles="manager,admin"/>
</tomcat-users>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这条消息
表示以下情况之一为 true:
tomcat-users.xml
文件没有admin
用户(您在>arquillian.xml
),admin
用户未映射到 Tomcat 6 中的manager
角色,或者manager-script
Tomcat 7 中的角色。Arquillian 支持 Tomcat 7 作为嵌入式或托管容器。该文档不是最新的(截至目前),但配置参数或多或少与 Tomcat 6 中的嵌入式和托管等效项相同。用于
org. jboss.arquillian.container:arquillian-tomcat-management-7
。截至今天,
1.0.0.CR2
是最新的稳定版本。如果您想针对开发版本进行工作,可以使用1.0.0.Final-SNAPSHOT
。此外,您还可以从
arquillian.xml
文件中省略多个冗余属性。更干净的配置如下所示:This message
indicates that one of the following is true:
tomcat-users.xml
file used by your Tomcat installation does not have theadmin
user (that you've specified inarquillian.xml
),admin
user is not mapped to themanager
role in Tomcat 6, or themanager-script
role in Tomcat 7.Arquillian supports Tomcat 7, as an emebedded or a managed container. The documentation is not up to date (as of now), but the configuration parameters are more or less the same as the embedded and managed equivalents in Tomcat 6. The artifact Id to use for
org.jboss.arquillian.container:arquillian-tomcat-managed-7
.org.jboss.arquillian.container:arquillian-tomcat-embedded-7
.As of today,
1.0.0.CR2
is the latest stable release. You can use1.0.0.Final-SNAPSHOT
, if you want to work against the development build.Also, you can omit several redundant properties from your
arquillian.xml
file. A cleaner configuration would look like: