When deploying batchadmin to me my local OC4J server, I get the following exception: Code Block |
---|
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter': Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [org.springframework.batch.admin.jmx.BatchMBeanExporter@4262d5d7] with key 'batchMBeanExporter';
nested exception is java.lang.SecurityException: Unauthorized access from application: batchadmin to MBean: spring.application:name=batchMBeanExporter,type=BatchMBeanExporter
|
ANSWER: Edit the OC4j startup file: ${ORACLE_HOME}/bin/oc4j.cmd Find the following block of code: Code Block |
---|
echo Starting OC4J from %J2EE_HOME% ...
set CMDARGS=-config "%SERVER_XML%"
if "%2%"=="" (
goto oc4j
) else (
echo.
echo Error: The option %2% was not recognized.
goto help
)
|
and change it to the following: Code Block |
---|
echo Starting OC4J from %J2EE_HOME% ...
set CMDARGS=-config "%SERVER_XML%"
if "%2%"=="" (
set JVMARGS=%OC4J_JVM_ARGS% -Doc4j.jmx.security.proxy.off=true -Doc4j.userThreads=true
echo start JMVARGS = %JVMARGS%
goto oc4j
) else (
echo.
echo Error: The option %2% was not recognized.
goto help
)
|
Save the change and restart the OC4J server. |