开发者

Deployment error while running jsp in NetbeansIDE 6.0

开发者 https://www.devze.com 2023-03-05 17:49 出处:网络
Deployment error: Access to Tomcat server has not been authorized. Set the correct username and password with the \"manager\" role in the Tomcat customizer in the Server Manager.
Deployment error:
Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.lang.IllegalStateException: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
        at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:390开发者_Go百科)
        at org.netbeans.modules.tomcat5.TomcatManager.modules(TomcatManager.java:623)
        at org.netbeans.modules.tomcat5.TomcatManager.getAvailableModules(TomcatManager.java:434)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.getAvailableTMIDsMap(TargetServer.java:319)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:275)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:224)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:221)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:343)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:131)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:468)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:148)
        ... 16 more
Caused by: org.netbeans.modules.tomcat5.AuthorizationException
        at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:391)
        ... 26 more
BUILD FAILED (total time: 20 seconds)


Edit the /conf/tomcat-users.xml and add role manager with username manager and password of your choice (manager, tomcat, or whatever).

If Eclipse requires you to enter the admin username and password to deploy, then by all means enter it once you have it set.


Check the tomcat-users.xml of the "Catalina Base" directory. Right-click Apache Tomcat 6.xx (under Servers) and look for the connection tab. There should be a path called Catalina Base. Browse to it and note the credentials set; default is username: ide and password: tomcat-users. Including:

Make sure you set the same credentials in that Servers dialog. Close it and you are ready to ryme!

Hope this helps!


The same server error I had for which I changed the /conf/tomcat-users.xml

STEP 1:

Changing tomcat-users.xml

<tomcat-users>
<role rolename="tomcat"/>
    <role rolename="role1"/>
    <role rolename="manager-gui"/>
    <user password="tomcat" roles="tomcat,manager-gui" username="tomcat"/>
    <user password="tomcat" roles="tomcat,role1" username="both"/>
    <user password="tomcat" roles="role1" username="role1"/>
    <user password="pass" roles="manager-script,admin" username="me"/>
</tomcat-users>

I added two roles manager-script and admin.

You can find the further reference of the roles at Configure Manager

STEP 2:

After adding the role step 2 will be adding those credentials to Netbeans server configuration.

  1. Go to Window -> Services
  2. Select Servers.

Select your tomcat and Right click to see Properties.

Now select Connection Tab. Enter the "username" as me and "password" as pass, as shown below.

Deployment error while running jsp in NetbeansIDE 6.0

0

精彩评论

暂无评论...
验证码 换一张
取 消