users@glassfish.java.net

Re: Embedded Glassfish and security questions

From: <forums_at_java.net>
Date: Wed, 27 Apr 2011 02:03:25 -0500 (CDT)

[quote=Bhavanishankar Guest 22]Just a tip here:When using
org.glassfish.embeddable.CommandRunner, the arguments you will pass to its
run method should be same as the how it is passed to asadmin command. In this
case, for example:

commandRunner.run("create-file-user", "--groups=role1", "user1");[/quote]

That doesn't work either:

Console output:

27-Apr-2011 08:47:00
com.sun.enterprise.v3.server.CommonClassLoaderServiceImpl findDerbyClient
INFO: Cannot find javadb client jar file, derby jdbc driver will not be
available by default. 27-Apr-2011 08:47:00
com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy INFO:
Network listener http-listener on port 0 disabled per domain.xml 27-Apr-2011
08:47:00 com.sun.enterprise.v3.services.impl.GrizzlyService
createNetworkProxy INFO: Network listener https-listener on port 0 disabled
per domain.xml 27-Apr-2011 08:47:00
com.sun.enterprise.v3.server.AppServerStartup run INFO: GlassFish Server Open
Source Edition 3.1 (java_re-private) startup time : Embedded (490ms), startup
services(294ms), total(784ms) 27-Apr-2011 08:47:01
org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread
run INFO: JMXStartupService: JMXConnector system is disabled, skipping.
27-Apr-2011 08:47:01 com.sun.enterprise.v3.admin.CommandRunnerImpl
injectParameters *SEVERE: Cannot find userpassword in create-file-user
command model, file a bug* 27-Apr-2011 08:47:01
org.glassfish.admin.mbeanserver.JMXStartupService shutdown INFO:
JMXStartupService and JMXConnectors have been shut down. 27-Apr-2011 08:47:01
com.sun.enterprise.v3.server.AppServerStartup stop INFO: Shutdown procedure
finished 27-Apr-2011 08:47:01 AppServerStartup run INFO: [Thread[GlassFish
Kernel Main Thread,5,main]] exiting
 JUnit stacktrace:

java.lang.Exception: Failed to create user : message
PlainTextActionReporterFAILUREorg.jvnet.hk2.component.
UnsatisfiedDependencyException: injection failed on
com.sun.enterprise.security.cli.CreateFileUser.userpassword with class
java.lang.StringDescription: create-file-user commandCannot find userpassword
in create-file-user command model, file a bug Usage: create-file-user
[--authrealmname <authrealm_name>] [--target target] [--groups
user_groups[:user_groups]*] [-?|--help[=<help(default:false)>]] username at
test.ejb.TestCase.setup(TestCase.java:27) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.jvnet.hk2.component.UnsatisfiedDependencyException: injection
failed on com.sun.enterprise.security.cli.CreateFileUser.userpassword with
class java.lang.String at
org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:155) at
org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:78) at
com.sun.enterprise.v3.admin.CommandRunnerImpl.injectParameters(CommandRunnerImpl.java:259)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:885)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
at
com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at
com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.executeCommand(CommandExecutorImpl.java:118)
at
com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.run(CommandExecutorImpl.java:85)
at test.ejb.TestCase.setup(TestCase.java:25) ... 16 more

--
[Message sent by forum member 'nickdegraeve']
View Post: http://forums.java.net/node/793586