5
votes

I'm facing strange error. I use Glassfish 3.1.1 withn jdk7 and since some time I can't login to admin console via web (localhost:4848), I keep getting message Authentication Failed Re-enter your username and password here are logs:

[#|2012-01-16T11:15:37.415+0100|INFO|glassfish3.1.1|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=110;_ThreadName=Thread-2;|User [admin] from host 127.0.0.1 does not have administration access|#]

[#|2012-01-16T11:15:37.446+0100|INFO|glassfish3.1.1|javax.enterprise.system.tools.admin.com.sun.enterprise.container.common|_ThreadID=101;_ThreadName=Thread-2;|User [admin] from host 127.0.0.1 does not have administration access|#]

[#|2012-01-16T11:16:07.008+0100|SEVERE|glassfish3.1.1|org.glassfish.admin.rest.resources.GeneratorResource|_ThreadID=100;_ThreadName=Thread-2;|The log message is null. java.lang.RuntimeException: Cannot find annotation org.glassfish.config.support.Create with value _register-instance on method public abstract com.sun.enterprise.config.serverbeans.Server com.sun.enterprise.config.serverbeans.Servers.getServer(java.lang.String) at org.glassfish.config.support.GenericCrudCommand.getAnnotation(GenericCrudCommand.java:196) at org.glassfish.config.support.GenericCreateCommand.postConstruct(GenericCreateCommand.java:90) at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131) at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91) at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82) at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139) at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76) at org.jvnet.hk2.component.Habitat.getComponent(Habitat.java:796) at com.sun.enterprise.v3.admin.CommandRunnerImpl.getModel(CommandRunnerImpl.java:150) at org.glassfish.admin.rest.generator.ResourcesGeneratorBase.commandIsPresent(ResourcesGeneratorBase.java:315) at org.glassfish.admin.rest.generator.ResourcesGeneratorBase.generateCommandResources(ResourcesGeneratorBase.java:296) at org.glassfish.admin.rest.generator.ResourcesGeneratorBase.generateSingle(ResourcesGeneratorBase.java:100) at org.glassfish.admin.rest.LazyJerseyInit.generateASM(LazyJerseyInit.java:311) at org.glassfish.admin.rest.LazyJerseyInit.getResourcesConfigForManagement(LazyJerseyInit.java:255) at org.glassfish.admin.rest.adapter.RestManagementAdapter.getResourcesConfig(RestManagementAdapter.java:62) at org.glassfish.admin.rest.adapter.RestAdapter.exposeContext(RestAdapter.java:455) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:177) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:722) |#]

[#|2012-01-16T11:16:07.008+0100|SEVERE|glassfish3.1.1|org.glassfish.admin.rest.LazyJerseyInit|_ThreadID=100;_ThreadName=Thread-2;|The log message is null. java.lang.ClassNotFoundException: org.glassfish.admin.rest.resources.generatedASM.DomainResource not found by org.glassfish.admin.rest-service [164] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787) at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at org.glassfish.admin.rest.LazyJerseyInit.getResourcesConfigForManagement(LazyJerseyInit.java:257) at org.glassfish.admin.rest.adapter.RestManagementAdapter.getResourcesConfig(RestManagementAdapter.java:62) at org.glassfish.admin.rest.adapter.RestAdapter.exposeContext(RestAdapter.java:455) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:177) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:722) |#]

[#|2012-01-16T11:16:07.071+0100|INFO|glassfish3.1.1|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=100;_ThreadName=Thread-2;|Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:17 PM'|#]

[#|2012-01-16T11:16:07.086+0100|WARNING|glassfish3.1.1|org.apache.catalina.connector.Request|_ThreadID=111;_ThreadName=Thread-2;|PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called|#]

Username and password are 100% correct, I have no problem login via asadmin cmd.

5
Could not solve this bug for Glassfish 3.1.2.2, tried all answers below. I upgrade to Payara now.jan

5 Answers

18
votes

I had the same issue with GlassFish 4.1, admin password for working via asadmin tool but not via the browser. The problem first came after I imported a new signed server certificate to replacing the existing 's1as' alias in the keystore.jks. After some struggling I figured out the right solution:

sudo asadmin disable-secure-admin
sudo asadmin restart-domain domain1
sudo asadmin enable-secure-admin
sudo asadmin restart-domain domain1

Admin user authentication works again in the browser! :-)

3
votes

I had this problem, and raised a bug with the Glassfish project.

It's fixed in the fresh Glassfish 3.1.2. It was released yesterday.

2
votes

Just for reference of those searching for it: You don't need to install Glassfish 3.1.2 (for those using Linux distribution). The following worked for me:

  1. Open a terminal and cd to the glassfish installation location
  2. ./asadmin stop domain domain1 (or other domains) in order to stop your glassfish server
  3. Go to your browser and flush your cache memory (usually in the History option -> clear recent history)

Now you should be able to login to the admin console.

For those that have the default password yet, maybe you need to change it from admin console. (./asadmin change-admin-password).

0
votes

Thanks, Victor. Saved me a lot of headache.

When using different aliases, specify them on the command line when enabling secure admin again:

asadmin enable-secure-admin --adminalias adtest --instancealias intest

0
votes

I also faced the same problem with 4.0 and 4.1.1.

However, 4.1.2. appears to fix the issue. I installed it (from here), and no login details are requested.