javax.security.auth.login.LoginException:无法找到LoginModule类:org.jboss.security.ClientLoginModule

时间:2015-07-08 10:47:15

标签: deployment jenkins build jboss5.x

超过3天都无法弄清楚我的詹金斯出了什么问题。

我有Jenkins的工作,从Bitbucket获取源代码并在Jboss 5.1中构建和部署。

但是在部署时我得到了波纹管异常尝试多种解决方案,但我遇到了同样令人讨厌的错误。

堆栈跟踪

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.534 s
[INFO] Finished at: 2015-07-08T03:19:04+05:30
[INFO] Final Memory: 13M/176M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/jobs/SpringHelloWorld/workspace/pom.xml to com.programcreek/HelloWorld/0.0.1-SNAPSHOT/HelloWorld-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/jobs/SpringHelloWorld/workspace/target/HelloWorld.war to com.programcreek/HelloWorld/0.0.1-SNAPSHOT/HelloWorld-0.0.1-SNAPSHOT.war
channel stopped
Deploying /var/lib/jenkins/jobs/SpringHelloWorld/workspace/target/HelloWorld.war to container JBoss 5.x Remote
  The undeployment phase of the redeploy action has failed: org.codehaus.cargo.util.CargoException: Cannot undeploy deployable org.codehaus.cargo.container.deployable.WAR[HelloWorld.war]
ERROR: Build step failed with exception
org.codehaus.cargo.util.CargoException: Cannot deploy deployable org.codehaus.cargo.container.deployable.WAR[HelloWorld.war]
	at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:216)
	at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.redeploy(AbstractDeployer.java:212)
	at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
	at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
	at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
	at hudson.FilePath.act(FilePath.java:989)
	at hudson.FilePath.act(FilePath.java:967)
	at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
	at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1053)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
	at hudson.model.Run.execute(Run.java:1766)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:374)
Caused by: javax.security.auth.login.LoginException: unable to find LoginModule class: org.jboss.security.ClientLoginModule
	at javax.security.auth.login.LoginContext.invoke(LoginContext.java:800)
	at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:690)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:687)
	at javax.security.auth.login.LoginContext.login(LoginContext.java:595)
	at org.codehaus.cargo.tools.jboss.JBossDeployer.getDeploymentManager(JBossDeployer.java:176)
	at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:71)
	at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
	... 17 more
javax.security.auth.login.LoginException: unable to find LoginModule class: org.jboss.security.ClientLoginModule
	at javax.security.auth.login.LoginContext.invoke(LoginContext.java:800)
	at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:690)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:688)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:687)
	at javax.security.auth.login.LoginContext.login(LoginContext.java:595)
	at org.codehaus.cargo.tools.jboss.JBossDeployer.getDeploymentManager(JBossDeployer.java:176)
	at org.codehaus.cargo.tools.jboss.JBossDeployer.deploy(JBossDeployer.java:71)
	at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.deploy(JBoss5xRemoteDeployer.java:212)
	at org.codehaus.cargo.container.spi.deployer.AbstractDeployer.redeploy(AbstractDeployer.java:212)
	at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
	at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
	at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
	at hudson.FilePath.act(FilePath.java:989)
	at hudson.FilePath.act(FilePath.java:967)
	at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
	at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1053)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
	at hudson.model.Run.execute(Run.java:1766)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:537)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:374)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

  

我尝试了多种方法。

  1. 经过大量搜索我发现了什么 jboss lib中缺少jbossx/jbossx-security-client.jar.zip,所以 我下载了jar并粘贴到lib中。 但问题仍然存在 我试图修改login-config.xml,但这对我来说也不起作用。
  2. login-config.xml的内容如下所示。

    <?xml version='1.0'?>
    
    <!-- The XML based JAAS login configuration read by the
    org.jboss.security.auth.login.XMLLoginConfig mbean. Add
    an application-policy element for each security domain.
    
    The outline of the application-policy is:
    <application-policy name="security-domain-name">
      <authentication>
        <login-module code="login.module1.class.name" flag="control_flag">
          <module-option name = "option1-name">option1-value</module-option>
          <module-option name = "option2-name">option2-value</module-option>
          ...
        </login-module>
    
        <login-module code="login.module2.class.name" flag="control_flag">
          ...
        </login-module>
        ...
      </authentication>
    </application-policy>
    
    $Id: login-config.xml 87078 2009-04-09 14:23:47Z bstansberry@jboss.com $
    $Revision: 87078 $
    -->
    
    <policy>
      <!-- Used by clients within the application server VM such as
      mbeans and servlets that access EJBs.
      -->
      <application-policy name="client-login">
        <authentication>
          <login-module code="org.jboss.security.ClientLoginModule"
            flag="required">
             <!-- Any existing security context will be restored on logout -->
             <module-option name="restore-login-identity">true</module-option>
          </login-module>
        </authentication>
      </application-policy>
    
      <!-- Security domains for testing new jca framework -->
      <application-policy name="HsqlDbRealm">
        <authentication>
          <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"
            flag="required">
            <module-option name="principal">sa</module-option>
            <module-option name="userName">sa</module-option>
            <module-option name="password"></module-option>
            <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
          </login-module>
        </authentication>
      </application-policy>
    
      <application-policy name="JmsXARealm">
        <authentication>
          <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule"
            flag="required">
            <module-option name="principal">guest</module-option>
            <module-option name="userName">guest</module-option>
            <module-option name="password">guest</module-option>
            <module-option name="managedConnectionFactoryName">jboss.jca:service=TxCM,name=JmsXA</module-option>
          </login-module>
        </authentication>
      </application-policy>
    
      <!-- A template configuration for the jmx-console web application. This
        defaults to the UsersRolesLoginModule the same as other and should be
        changed to a stronger authentication mechanism as required.
      -->
      <application-policy name="jmx-console">
        <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
            flag="required">
            <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
            <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
          </login-module>
        </authentication>
      </application-policy>
    
      <!-- A template configuration for the web-console web application. This
        defaults to the UsersRolesLoginModule the same as other and should be
        changed to a stronger authentication mechanism as required.
      -->
      <application-policy name="web-console">
        <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
            flag="required">
            <module-option name="usersProperties">web-console-users.properties</module-option>
            <module-option name="rolesProperties">web-console-roles.properties</module-option>
          </login-module>
        </authentication>
      </application-policy>
    
      <!--
        A template configuration for the JBossWS security domain.
        This defaults to the UsersRolesLoginModule the same as other and should be
        changed to a stronger authentication mechanism as required.
      -->
      <application-policy name="JBossWS">
        <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
            flag="required">
            <module-option name="usersProperties">props/jbossws-users.properties</module-option>
            <module-option name="rolesProperties">props/jbossws-roles.properties</module-option>
            <module-option name="unauthenticatedIdentity">anonymous</module-option>
          </login-module>
        </authentication>
      </application-policy>
    
      <!-- The default login configuration used by any security domain that
      does not have a application-policy entry with a matching name
      -->
      <application-policy name="other">
        <!-- A simple server login module, which can be used when the number
        of users is relatively small. It uses two properties files:
        users.properties, which holds users (key) and their password (value).
        roles.properties, which holds users (key) and a comma-separated list of
        their roles (value).
        The unauthenticatedIdentity property defines the name of the principal
        that will be used when a null username and password are presented as is
        the case for an unuathenticated web client or MDB. If you want to
        allow such users to be authenticated add the property, e.g.,
        unauthenticatedIdentity="nobody"
        -->
        <authentication>
          <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
            flag="required"/>
        </authentication>
      </application-policy>
    
    </policy>

    我不知道该怎么办这个文件。 有没有人对此有任何线索?

1 个答案:

答案 0 :(得分:0)

经过大量搜索,我发现Deploy plug-in自我有问题。所以我用另一种方法来做到这一点。既然我们能够构建项目,那么我们剩下的只是在Jboss中部署项目。所以我没有使用deploy plug-in而是使用shell脚本。 &#34; SCP&#34;在Jboss deploy文件夹中复制.war文件,并使用shell脚本重新启动jboss。

完成了