I'm following the wso2 gmail connector tutorial here but getting the error,
ERROR - MediatorFactoryFinder Unknown mediator referenced by configuration element : {http://ws.apache.org/ns/synapse}gmail
I followed all the steps mentioned, got my gmail credentials and configured the mediators in the sequence.
What am I missing?
The xml,
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="PaymentRequestProcessingSequence" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<property description="Get Email ID" expression="json-eval($.patient.email)" name="email_id" scope="default" type="STRING"/>
<call>
<endpoint key="SettlePaymentEP"/>
</call>
<log description="LogPaymentRequestProcessingSequenceRes" level="full">
<property name="type" value="LogPaymentRequestProcessingSequenceRes"/>
<property expression="get-property("INTERNALREQUESTID")" name="internalrequestID"/>
<property expression="get-property("MessageID")" name="messageID"/>
<property expression="." name="message"/>
</log>
<property description="Get Payment Response" expression="json-eval($.)" name="payment_response" scope="default" type="STRING"/>
<gmail.init>
<userId>myEmail</userId>
<accessToken>theAccessToken</accessToken>
<apiUrl>https://www.googleapis.com/gmail</apiUrl>
<clientId>theClientId</clientId>
<clientSecret>theClientSecret</clientSecret>
<refreshToken>theRefreshToken</refreshToken>
</gmail.init>
<gmail.sendMail>
<to>{$ctx:email_id}</to>
<subject>Payment Status</subject>
<messageBody>{$ctx:payment_response}</messageBody>
</gmail.sendMail>
<drop/>
</sequence>
Stacktrace
ERROR {org.apache.synapse.deployers.LibraryArtifactDeployer} - Deployment of synapse artifact failed for synapse libray at : C:\Program Files\WSO2\Enterprise Integrator\6.4.0\tmp\carbonapps\-1234\1546859692950SampeServicesCompositeApplication_1.0.0.car\gmail-connector_3.0.7\gmail-connector-3.0.7.zip : Error while extracting Synapse Library : gmail-connector-3.0.7.zip {org.apache.synapse.deployers.LibraryArtifactDeployer}
org.apache.synapse.SynapseException: Error while extracting Synapse Library : gmail-connector-3.0.7.zip
at org.apache.synapse.libraries.util.LibDeployerUtils.extractSynapseLib(LibDeployerUtils.java:426)
at org.apache.synapse.libraries.util.LibDeployerUtils.createSynapseLibrary(LibDeployerUtils.java:65)
at org.apache.synapse.deployers.LibraryArtifactDeployer.deploy(LibraryArtifactDeployer.java:60)
at org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deploySynapseLibrary(SynapseAppDeployer.java:355)
at org.wso2.carbon.application.deployer.synapse.SynapseAppDeployer.deployArtifacts(SynapseAppDeployer.java:101)
at org.wso2.carbon.application.deployer.internal.ApplicationManager.deployCarbonApp(ApplicationManager.java:272)
at org.wso2.carbon.application.deployer.CappAxis2Deployer.deploy(CappAxis2Deployer.java:72)
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371)
at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:59)
at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:67)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.runAxisDeployment(CarbonDeploymentSchedulerTask.java:93)
at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTask.run(CarbonDeploymentSchedulerTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\Program%20Files\WSO2\Enterprise%20Integrator\6.4.0\tmp\carbonapps\-1234\1546859692950SampeServicesCompositeApplication_1.0.0.car\gmail-connector_3.0.7\gmail-connector-3.0.7.zip (The system cannot find the path specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at org.apache.synapse.libraries.util.LibDeployerUtils.extract(LibDeployerUtils.java:448)
at org.apache.synapse.libraries.util.LibDeployerUtils.extractSynapseLib(LibDeployerUtils.java:424)
... 23 more
Related
Description : I am trying to transform from xml to json using script mediator in wso2 3.2 api manager. The issue which I am facing is the script mediator method getPayloadXML() is not able to pull out a specific value from xml where it always returns as ReferenceError: "code" is not defined. I tried multiple things but couldn't figure out how to achieve this. Any help from someone would be really appreciable.
Response Mediation
<sequence xmlns="http://ws.apache.org/ns/synapse" name="transform">
<script language="js"><![CDATA[
var envelope = mc.getPayloadXML()..*::fault-code.toString()
var request ={"data":{"success":"true","message":"SuccessFull","faultcode":envelope}};
mc.setPayloadJSON(request);
]]></script>
<log level="full">
<property name="Message" value="UpdatedMessage"/>
</log>
<property name="HTTP_SC" value="200" scope="axis2" />
<property name="messageType" value="application/json" scope="axis2"/>
</sequence>
Original Response
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsa:MessageID>210419-BA7CF-32444</wsa:MessageID>
<wsa:RelatesTo>Test123456</wsa:RelatesTo>
<wsa:To>http://www.w3.org/2005/08/addressing/anonymous</wsa:To>
<wsa:From>
<wsa:Address>some data</wsa:Address>
</wsa:From>
<wsa:Action>some data</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<cbo:response xmlns:abr="url" xmlns:asic="url" client-reference1="A1" response-type="error" version="1.2">
<cbo:error>
<cbo:fault-code>CBOX017</cbo:fault-code>
<cbo:fault-string>User account is inactive.</cbo:fault-string>
<cbo:fault-actor/>
<cbo:detail/>
</cbo:error>
</cbo:response>
</soapenv:Body>
</soapenv:Envelope>
Expected Response (Transform To JSON)
{
"data": {
"success": "true",
"message": "SuccessFull",
"faultcode":CBOX017
}
}
Error Logs
TID: [-1234] [] [2021-04-19 16:14:41,259] ERROR {org.apache.synapse.mediators.bsf.ScriptMediator} - {api:admin--equifaxACNCheck:v1.0.0} The script engine returned an error executing the inlined js script function mediate com.sun.phobos.script.util.ExtendedScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "code" is not defined. (<Unknown Source>#2) in <Unknown Source> at line number 2
at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:68)
at javax.script.CompiledScript.eval(CompiledScript.java:92)
at org.apache.synapse.mediators.bsf.ScriptMediator.mediateForInlineScript(ScriptMediator.java:395)
at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediator.java:290)
at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:258)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate_aroundBody0(APIManagerExtensionHandler.java:73)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:58)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleResponse_aroundBody4(APIManagerExtensionHandler.java:132)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleResponse(APIManagerExtensionHandler.java:120)
at org.apache.synapse.rest.API.process(API.java:371)
at org.apache.synapse.rest.RESTRequestHandler.apiProcessNonDefaultStrategy(RESTRequestHandler.java:144)
at org.apache.synapse.rest.RESTRequestHandler.identifyAPI(RESTRequestHandler.java:164)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:90)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:60)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:331)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:583)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:197)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:285)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "code" is not defined. (<Unknown Source>#2)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3750)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1728)
at org.mozilla.javascript.gen._Unknown_Source__2233._c_script_0(<Unknown Source>:2)
at org.mozilla.javascript.gen._Unknown_Source__2233.call(<Unknown Source>)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.gen._Unknown_Source__2233.call(<Unknown Source>)
at org.mozilla.javascript.gen._Unknown_Source__2233.exec(<Unknown Source>)
at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:55)
... 25 more
TID: [-1234] [] [2021-04-19 16:14:41,267] ERROR {API_LOGGER.admin--equifaxACNCheck} - The script engine returned an error executing the inlined js script function mediate com.sun.phobos.script.util.ExtendedScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "code" is not defined. (<Unknown Source>#2) in <Unknown Source> at line number 2
at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:68)
at javax.script.CompiledScript.eval(CompiledScript.java:92)
at org.apache.synapse.mediators.bsf.ScriptMediator.mediateForInlineScript(ScriptMediator.java:395)
at org.apache.synapse.mediators.bsf.ScriptMediator.invokeScript(ScriptMediator.java:290)
at org.apache.synapse.mediators.bsf.ScriptMediator.mediate(ScriptMediator.java:258)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:109)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate_aroundBody0(APIManagerExtensionHandler.java:73)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:58)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleResponse_aroundBody4(APIManagerExtensionHandler.java:132)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleResponse(APIManagerExtensionHandler.java:120)
at org.apache.synapse.rest.API.process(API.java:371)
at org.apache.synapse.rest.RESTRequestHandler.apiProcessNonDefaultStrategy(RESTRequestHandler.java:144)
at org.apache.synapse.rest.RESTRequestHandler.identifyAPI(RESTRequestHandler.java:164)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:90)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:60)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:331)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:583)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:197)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:285)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "code" is not defined. (<Unknown Source>#2)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3750)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1728)
at org.mozilla.javascript.gen._Unknown_Source__2233._c_script_0(<Unknown Source>:2)
at org.mozilla.javascript.gen._Unknown_Source__2233.call(<Unknown Source>)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.gen._Unknown_Source__2233.call(<Unknown Source>)
at org.mozilla.javascript.gen._Unknown_Source__2233.exec(<Unknown Source>)
at com.sun.phobos.script.javascript.RhinoCompiledScript.eval(RhinoCompiledScript.java:55)
... 25 more
It looks like the ScriptMediator has problem with parsing the fault-code. I think it is because the hyphen - already have meaning in JavaScript and in E4X. Maybe you can use alternate mediation with PayloadFactory like below:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="transform">
<payloadFactory media-type="json">
<format>{"data":{"success":"$1", "message":"$2", "faultcode":"$3"}}</format>
<args>
<arg literal="false" value="true"/>
<arg literal="false" value="SuccessFull"/>
<arg evaluator="xml" expression="//*:fault-code"
literal="false" xmlns:ns="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
<log level="full">
<property name="Message" value="UpdatedMessage"/>
</log>
<property name="HTTP_SC" value="200" scope="axis2" />
</sequence>
The <property name="messageType" value="application/json" scope="axis2"/> shouldn't be needed, because the payload factory should set that.
I am running WSO2 Identity Server 5.7.0. I am deploying a new instance of it in a different environment with a different set of backing databases. In the process of the WSO2 startup, it appears the User Manager Core bundle is failing to start.
The error is:
[2019-07-10 18:30:16,596] ERROR {org.wso2.carbon.user.core.util.DatabaseUtil} - Database Error - The connection attempt failed.
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:454)
at org.postgresql.Driver.connect(Driver.java:256)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:730)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:664)
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:200)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:158)
at org.wso2.carbon.user.core.common.DefaultRealm.populateProfileAndClaimMaps(DefaultRealm.java:442)
at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:124)
at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:264)
at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:102)
at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:115)
at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:72)
at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.postgresql.core.PGStream.<init>(PGStream.java:70)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
... 33 more
[2019-07-10 18:30:16,599] ERROR {org.wso2.carbon.user.core.internal.Activator} - Cannot start User Manager Core bundle
org.wso2.carbon.user.core.UserStoreException: Cannot initialize the realm.
at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:274)
at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:102)
at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:115)
at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:72)
at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: org.wso2.carbon.user.core.UserStoreException: Database Error - The connection attempt failed.
at org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:168)
at org.wso2.carbon.user.core.common.DefaultRealm.populateProfileAndClaimMaps(DefaultRealm.java:442)
at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:124)
at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:264)
... 19 more
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
at org.postgresql.Driver.makeConnection(Driver.java:454)
at org.postgresql.Driver.connect(Driver.java:256)
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:730)
at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:664)
at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:200)
at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
at org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:158)
... 22 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.postgresql.core.PGStream.<init>(PGStream.java:70)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)
... 33 more
It appears that the connections to the databases are initializing successfully before this error appears, so I'm not sure what the issue is.
Here are the logs regarding the datasources:
[2019-07-10 17:48:59,688] DEBUG {org.wso2.carbon.ndatasource.core.internal.DataSourceServiceComponent} - Initializing system data sources...
[2019-07-10 17:48:59,834] DEBUG {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Adding data source: WSO2_CARBON_DB
[2019-07-10 17:48:59,835] DEBUG {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Registering data source: WSO2_CARBON_DB
[2019-07-10 17:49:00,089] DEBUG {org.wso2.carbon.context.internal.CarbonContextDataHolder} - Loading JNDI Initial Context Factory: org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory
[2019-07-10 17:49:00,106] DEBUG {org.wso2.carbon.context.internal.CarbonContextDataHolder} - Unload Tenant Task: org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext$ContextCleanup
Task was registered.
[2019-07-10 17:49:00,190] DEBUG {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Adding data source: WSO2_METRICS_DB
[2019-07-10 17:49:00,191] DEBUG {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Registering data source: WSO2_METRICS_DB
[2019-07-10 17:49:00,255] DEBUG {org.wso2.carbon.context.internal.CarbonContextDataHolder} - Loading JNDI Initial Context Factory: org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory
[2019-07-10 17:49:00,323] DEBUG {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Adding data source: BPS_DS
[2019-07-10 17:49:00,324] DEBUG {org.wso2.carbon.ndatasource.core.DataSourceRepository} - Registering data source: BPS_DS
[2019-07-10 17:49:00,385] DEBUG {org.wso2.carbon.context.internal.CarbonContextDataHolder} - Loading JNDI Initial Context Factory: org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory
[2019-07-10 17:49:00,391] DEBUG {org.wso2.carbon.ndatasource.core.internal.DataSourceServiceComponent} - System data sources successfully initialized
[2019-07-10 17:49:00,392] DEBUG {org.wso2.carbon.ndatasource.core.internal.DataSourceServiceComponent} - ServerConfigurationService acquired
[2019-07-10 17:49:00,393] DEBUG {org.wso2.carbon.ndatasource.core.internal.DataSourceServiceComponent} - DataSourceServiceComponent activated
My question is which configurations are relevant to the step of the process that is failing. Is this an issue with the datasources connection, the LDAP connection, or something else?
Thanks for your help.
Edit:
master-datasources.xml:
<?xml version="1.0" encoding="UTF-8"?>
<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>
<datasources>
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>${master.datasources.url}</url>
<username>${master.datasources.username}</username>
<password>password</password>
<driverClassName>org.postgresql.Driver</driverClassName>
<maxActive>80</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
<testOnBorrow>true</testOnBorrow>
<defaultAutoCommit>true</defaultAutoCommit>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
</datasources>
</datasources-configuration>
user-mgt.xml:
<UserManager xmlns:svns="http://org.wso2.securevault/configuration">
<Realm>
<Configuration>
<AddAdmin>false</AddAdmin>
<AdminRole>admin</AdminRole>
<AdminUser>
<UserName>${user.mgt.admin.username}</UserName>
<Password>placeholder</Password>
</AdminUser>
<!-- By default users in this role sees the registry root-->
<EveryOneRoleName>everyone</EveryOneRoleName>
<Property name="isCascadeDeleteEnabled">true</Property>
<Property name="initializeNewClaimManager">false</Property>
<Property name="dataSource">jdbc/WSO2CarbonDB</Property>
</Configuration>
<UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager">
<Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
<Property name="ConnectionURL">${user.mgt.connection.url}</Property>
<Property name="ConnectionName">${user.mgt.connection.name}</Property>
<Property name="ConnectionPassword">password</Property>
<Property name="AnonymousBind">false</Property>
<Property name="UserSearchBase">${user.mgt.search.base}</Property>
<Property name="UserEntryObjectClass">customer</Property>
<Property name="UserNameAttribute">cn</Property>
<Property name="UserNameSearchFilter">(&(objectClass=top)(cn=?))</Property>
<Property name="UserNameListFilter">(objectClass=top)</Property>
<Property name="UserDNPattern"/>
<Property name="DisplayNameAttribute"/>
<Property name="ReadGroups">true</Property>
<Property name="WriteGroups">true</Property>
<Property name="GroupSearchBase">ou=Groups,dc=cse-renaissance,dc=equifax,dc=com</Property>
<Property name="GroupEntryObjectClass">groupOfNames</Property>
<Property name="GroupNameAttribute">cn</Property>
<Property name="GroupNameSearchFilter">(&(objectClass=groupOfNames)(cn=?))</Property>
<Property name="GroupNameListFilter">(objectClass=groupOfNames)</Property>
<Property name="RoleDNPattern">cn={0},ou=Groups,dc=cse-renaissance,dc=equifax,dc=com</Property>
<Property name="MembershipAttribute">member</Property>
<Property name="BackLinksEnabled">false</Property>
<Property name="UsernameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property>
<Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="UsernameJavaRegExViolationErrorMsg">Username pattern policy violated</Property>
<Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaRegExViolationErrorMsg">Password length should be within 5 to 30 characters</Property>
<Property name="RolenameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property>
<Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="SCIMEnabled">false</Property>
<Property name="IsBulkImportSupported">false</Property>
<Property name="EmptyRolesAllowed">true</Property>
<Property name="PasswordHashMethod">PLAIN_TEXT</Property>
<Property name="MultiAttributeSeparator">,</Property>
<Property name="MaxUserNameListLength">100</Property>
<Property name="MaxRoleNameListLength">100</Property>
<Property name="kdcEnabled">false</Property>
<Property name="defaultRealmName">WSO2.ORG</Property>
<Property name="UserRolesCacheEnabled">true</Property>
<Property name="ConnectionPoolingEnabled">false</Property>
<Property name="LDAPConnectionTimeout">5000</Property>
<Property name="ReadTimeout"/>
<Property name="RetryAttempts"/>
</UserStoreManager>
<AuthorizationManager class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
<Property name="AdminRoleManagementPermissions">/permission</Property>
<Property name="AuthorizationCacheEnabled">true</Property>
<Property name="GetAllRolesOfUserEnabled">false</Property>
</AuthorizationManager>
</Realm>
</UserManager>
The ${user.mgt.connection.url} has the form ldap://DOMAIN:389.
The datasources urls are of the form jbdc:postgresql://DOMAIN:5432/master.
I have verified that I am able to make a connection to the databases and this LDAP instance from the machine this is running on, so it is not a firewall issue.
I have also been able to start up WSO2 with this configuration with a different LDAP and set of databases.
I'm looking for more clarification about which database/LDAP instance that WSO2 is trying to connect to during the realm initialization, so that I can identify which part of the config the issue is with.
Have a look "dataSource" property in user-mgt.xml and you will find JNDI name of the relevant data source search for the same name in master-datasource.xml there you will get corresponding DB connection parameters. You can verify connection by using some external database client. Either LDAP or JDBC you need to have healthy database connection. If you can attache user-mgt.xml and master-datasource.xml after removing sensitive data like DB password exact problem can be tracked.
WSO2 API Manager Version: 2.5.0
I have an Out Mediator that is supposed to do something very simple:
Enrich a property based of uri.var.stackstormexecId (Working)
Set an API Key Header (Working)
Set an Accept: */* Header (Working)
Call (Blocking) HTTP Endpoint that returns an unstructured response (Not Working)
Call HTTP Endpoint that returns a structured response (Working)
The step 4) is done simply to block the sequence, I don't care about its response. That specific endpoint will release the HTTP connection when some southbound work is done, allowing the next Call in 5) to retrieve meaningful information.
The problem is that by setting Accept: */* I'm expecting that the API Gw will handle the unstructured response of the 4) Call, for which its Content-Type is text/event-stream. It is throwing a XML Parser Exception on that Call because there is no associated axis2 message builder associated with this specific Content-Type.
Question: Anyone knows which message builder class should be used and defined in axis2.xml to overcame this?
I'm not sure what it is trying to use, but the exception comes from a getSOAPBuilder, which is certainly not the case. It expects a "<" but gets an "e" (which is the first character of the unstructured response of step 4)):
TID: [-1234] [] [2018-12-18 11:22:08,656] INFO {org.apache.axis2.builder.BuilderUtil} - OMException in getSOAPBuilder {org.apache.axis2.builder.BuilderUtil}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'e' (code 101) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:658)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:206)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:146)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:109)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:351)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:456)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:227)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.sendReceive(BlockingMsgSender.java:490)
at org.apache.synapse.message.senders.blocking.BlockingMsgSender.send(BlockingMsgSender.java:382)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:88)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:85)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:511)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:384)
at org.apache.synapse.endpoints.HTTPEndpoint.send(HTTPEndpoint.java:85)
at org.apache.synapse.mediators.builtin.CallMediator.handleBlockingCall(CallMediator.java:164)
at org.apache.synapse.mediators.builtin.CallMediator.mediate(CallMediator.java:119)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:108)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:70)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.mediate(APIManagerExtensionHandler.java:66)
at org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler.handleResponse(APIManagerExtensionHandler.java:87)
at org.apache.synapse.rest.API.process(API.java:323)
at org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:90)
at org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:56)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:303)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:570)
at org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:193)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:263)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'e' (code 101) in prolog; expected '<'
at [row,col {unknown-source}]: [1,1]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:639)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2052)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
... 38 more
TID: [-1234] [] [2018-12-18 11:22:08,894] INFO {org.apache.axis2.builder.BuilderUtil} - Remaining input stream :[event: st2.execution.output__create
data: {"timestamp": "2018-12-18T11:22:08.654318Z", "runner_ref": "local-shell-script", "output_type": "stdout", "action_ref": "package.action", "data": "id: 5c18d85ca832cb61d235c1d4\n", "id": "5c18d860a832cb6079e87993", "execution_id": "5c18d85ba832cb61d235c1d1"}
My objective is simply to Call this endpoint, wait for it to respond, ignore the response and move on with the sequence.
The sequence code:
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="someseq.xml" trace="disable" xmlns="http://ws.apache.org/ns/synapse">
<enrich>
<source clone="true" type="body"/>
<target property="stackOutput" type="property"/>
</enrich>
<property expression="$ctx:stackOutput/id" name="uri.var.stackstormexecId" scope="default" type="STRING"/>
<header name="St2-Api-Key" scope="transport" value="somekey"/>
<header name="Accept" scope="transport" value="*/*"/>
<call blocking="true">
<endpoint>
<http method="get" uri-template="http://somehost/v1/executions/{uri.var.stackstormexecId}/output"/>
</endpoint>
</call>
<header name="St2-Api-Key" scope="transport" value="somekey"/>
<header name="Accept" scope="transport" value="application/json"/>
<call>
<endpoint>
<http method="get" uri-template="http://somehost/v1/executions/{uri.var.stackstormexecId}"/>
</endpoint>
</call>
<respond/>
</sequence>
The problem was happening because the Content-Type of the call response is text/event-stream, which is not defined out of the box by WSO2 API Manager axis2 message builder.
I try to add a sequence which contains a java script mediator as below :
"<sequence name="response">
<script language="js">
mc.setPayloadXML(
<greeting>Hello World</greeting>
);
</script>
<header name="To" action="remove"/>
<property name="messageType" value="application/json" scope="axis2"/>
<property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
<property name="RESPONSE" value="true"/>
<send/>
<log level="full"/>
</sequence>"
*Howerver,it occurs a error once I press the Update Button,the whole function stack is shown in the log, I check the jar "bsf-all,3.0.0.wso2v2" and it really contains the missing class and the jar is shown in the bundles info "bsf-all,3.0.0.wso2v2,../plugins/bsf-all_3.0.0.wso2v2.jar,4,true" :*
"com/sun/phobos/script/javascript/RhinoScriptEngineFactory {org.apache.axis2.rpc.receivers.RPCMessageReceiver}
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at ......
Caused by: java.lang.NoClassDefFoundError: com/sun/phobos/script/javascript/RhinoScriptEngineFactory
at org.apache.synapse.mediators.bsf.ScriptMediator.initScriptEngine(ScriptMediator.java:475)
at org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:341)
at org.apache.synapse.mediators.bsf.ScriptMediator.(ScriptMediator.java:146)
at org.apache.synapse.mediators.bsf.ScriptMediatorFactory.createSpecificMediator(ScriptMediatorFactory.java:105)
at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:91)
at org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:223)
at org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren(AbstractListMediatorFactory.java:41)
at org.apache.synapse.config.xml.SequenceMediatorFactory.createSpecificMediator(SequenceMediatorFactory.java:87)
at org.apache.synapse.config.xml.AbstractMediatorFactory.createMediator(AbstractMediatorFactory.java:91)
at org.wso2.carbon.mediation.configadmin.ConfigurationValidator.validateSequence(ConfigurationValidator.java:90)
at org.wso2.carbon.mediation.configadmin.ConfigurationValidator.validate(ConfigurationValidator.java:73)
at org.wso2.carbon.mediation.configadmin.ConfigAdmin.validateConfiguration(ConfigAdmin.java:180)
... 61 more
Caused by: java.lang.ClassNotFoundException: com.sun.phobos.script.javascript.RhinoScriptEngineFactory
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
atorg.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoa ..
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 73 more"
I look up the solution about the same issue you given to other person https://wso2.org/jira/browse/ESBJAVA-1685 but it doesn't take effect.And I search Google for the question for a long time ,someone said the error has been fixxed or it is something wrong with OSGI Frame when it sets up,but others has the same problem with me still stick in it , so please give us a complete solution about how to use script mediator in WSO2 AM 1.5,tks a lot !
There is an issue with the bsf jar which we use to provide scripting engine..As an alternative way, you can use enrich/payload factory mediator to achieve above task
I'm getting the following error when I start WSO2 Identity Server 4.1.0:
[2013-02-27 17:00:33,192] ERROR {org.wso2.carbon.identity.mgt.IdentityMgtEventListener} - Error while init identity listener
org.wso2.carbon.user.core.UserStoreException: User store is operating in read only mode. Cannot write into the user store.
at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.doSetUserClaimValue(ReadOnlyLDAPUserStoreManager.java:1293)
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.setUserClaimValue(AbstractUserStoreManager.java:823)
at org.wso2.carbon.identity.mgt.IdentityMgtEventListener.<init>(IdentityMgtEventListener.java:68)
at org.wso2.carbon.identity.mgt.internal.IdentityMgtServiceComponent.activate(IdentityMgtServiceComponent.java:89)
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)
...
That means that WSO2 is trying to write in the ldap, but i've configured it to be read only:
<UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager">
<Property name="ReadOnly">true</Property>
<Property name="MaxUserNameListLength">100</Property>
<Property name="ConnectionURL">ldaps://xxxx:636</Property>
<Property name="ConnectionName">uid=xxx,ou=xx,dc=xx,dc=xx,dc=x</Property>
<Property name="ConnectionPassword">xxxxxx</Property>
<Property name="passwordHashMethod">SHA</Property>
<Property name="UserSearchBase">ou=xx,dc=x,dc=xx,dc=xx</Property>
<Property name="UserNameListFilter">(objectClass=person)</Property>
<Property name="UserNameAttribute">uid</Property>
<Property name="ReadLDAPGroups">true</Property>
<Property name="GroupSearchBase">ou=xx,dc=xx,dc=xx,dc=xx</Property>
<Property name="GroupNameListFilter">(objectClass=posixGroup)</Property>
<Property name="GroupNameAttribute">cn</Property>
<Property name="MembershipAttribute">memberUid</Property>
<Property name="UserRolesCacheEnabled">true</Property>
<Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
<Property name="maxFailedLoginAttempt">0</Property>
</UserStoreManager>
Am I missing something?
Your read-only user store should contain the 'admin' user, which is specified in the realm configuration section at the top of user-mgt.xml.
<AdminUser>
<UserName>admin</UserName>
<Password>admin</Password>
</AdminUser>
Since it could not be found, WSO2 IS is trying to write it.