Bulk user import failing on wso2 identity server 5.11.0 with java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap - wso2-identity-server

WSO2 Identity Server : 5.11.0
I am facing below error in logs while importing users using bulk import.
{org.apache.axis2.rpc.receivers.RPCMessageReceiver} - org/apache/commons/collections4/ListValuedMap java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap
at org.wso2.carbon.user.mgt.bulkimport.ExcelUserBulkImport.createWorkbook(ExcelUserBulkImport.java:135)
at org.wso2.carbon.user.mgt.bulkimport.ExcelUserBulkImport.addUserList(ExcelUserBulkImport.java:59)
at org.wso2.carbon.user.mgt.UserRealmProxy.bulkImportUsers(UserRealmProxy.java:2208)
at org.wso2.carbon.user.mgt.UserAdmin.bulkImportUsers(UserAdmin.java:563)
... 80 more
**Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections4.ListValuedMap cannot be found by poi_3.17.0.wso2v1**
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:512)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:423)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:415)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 84 more

I tried out user bulk import with WSO2 - Identity Server version 5.11.0 with H2 and I could not reproduce any errors as such. But according to what I see there could be a missing dependency refer stackoverflow comment. You can download that missing jar file, add it to <IS_HOME>/repository/components/lib folder and try the scenario again after server restart. Furthermore you can validate any other issues regarding this scenario through the docs.

Related

WSO2 Identity server Error starting LDAP server

installed Wso2 as shown in wso2 documentation, changed the default db to mssql and now i keep getting errors on trying to restart the server
it is running on ubuntu
ERROR {org.wso2.carbon.apacheds.impl.ApacheLDAPServer} - Error starting LDAP server.
org.apache.directory.shared.ldap.exception.LdapConfigurationException: ERR_171 Failed to bind an LDAP service (10,389) to the service registry.
at org.apache.directory.server.ldap.LdapServer.startNetwork(LdapServer.java:582)
ERROR {org.wso2.carbon.user.core.common.DefaultRealm} - nullType class java.lang.reflect.InvocationTargetException
org.wso2.carbon.user.core.UserStoreException: nullType class java.lang.reflect.InvocationTargetException
at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:395)
at org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:222)
at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:127)
at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:264)
at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:102)
[
2019-08-26 15:59:40,317] 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)
i have put bits of the errors i get when starting the server
please can anyone help i am new to this
Could you check if you have followed the steps given in this guide when changing the default DB to MSSQL?
[1] https://docs.wso2.com/display/ADMIN44x/Changing+to+MSSQL

Problems running wso2ei sample 904 - kafka inbound endpoint

I trying out sample 904 for WSO2 EI and following the sample guidelines.
Still I'm getting the following error when starting up the runtime:
[2018-05-12 19:54:45,960] [] INFO - KAFKAMessageListener Creating Kafka Consumer Connector...
[2018-05-12 19:54:45,977] [] INFO - MediationStatisticsComponent Global Message-Flow Statistic Reporting is Disabled
Exception in thread "Thread-18" java.lang.NoClassDefFoundError: com/typesafe/scalalogging/Logger$
at kafka.utils.Log4jControllerRegistration$.<init>(Logging.scala:25)
at kafka.utils.Log4jControllerRegistration$.<clinit>(Logging.scala)
at kafka.utils.Logging.$init$(Logging.scala:47)
at kafka.utils.VerifiableProperties.<init>(VerifiableProperties.scala:27)
at kafka.consumer.ConsumerConfig.<init>(ConsumerConfig.scala:110)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAMessageListener.createKafkaConsumerConnector(KAFKAMessageListener.java:56)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAPollingConsumer.poll(KAFKAPollingConsumer.java:145)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKAPollingConsumer.execute(KAFKAPollingConsumer.java:116)
at org.wso2.carbon.inbound.endpoint.protocol.kafka.KAFKATask.taskExecute(KAFKATask.java:48)
at org.wso2.carbon.inbound.endpoint.common.InboundRunner.run(InboundRunner.java:108)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.typesafe.scalalogging.Logger$ cannot be found by kafka_2.12_1.1.0_1.0.0
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)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 11 more
Don't know my options and I ran out of ideas. Any help would be appreciated.
Versions:
jre 1.8.0_161
wso2ei 6.2.0
kafka 2.12-1.1.0
zookeeper 3.4.12
Looks like it cannot find the "Logger" class. Are you sure you copied all of the required libs to /lib (also the one mentioned in the notes section of wso2 documentation if needed)?
What you could try is to start EI with osgi console enabled and check if the class is there. The following link might help.
OSGI
What you could also do is to open/extract the imported jar's and see if there's the class inside.

Migrate Web Service from Tomcat to Wildly

I am trying to migrate a SOAP Web service that works well with Tomcat but gives following error with JBoss:
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:163)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)
at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:79)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539)
at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:119)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:120)
at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:66)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:156)
... 5 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:186)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
... 13 more
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://schemas.xmlsoap.org/soap/https.
at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:170)
... 16 more
I did try to remove from standalone.xml after which the web service started working but after doing this my another web service that was made with jboss stopped so i have to retain this module in standalone.xml.
I removed these errors by regenerating the webservice by wsdl and JAXB artifacts.

Startup Errors for Version 5.2 of WSO2 Identity Server

I have downloaded the latest version of wso2 identity server (5.2). However during the startup process I am getting the following errors.
[2016-10-26 09:50:27,563] INFO {org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer} - Deployed webapp: StandardEngine[Catalina].StandardHost[localhost].StandardContext[/wso2].File[D:\wso2is-5.2.0\bin\..\repository\deployment\server\webapps\wso2.war]
java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
java.security.KeyStoreException: failed to extract any certificates or private keys - maybe bad password?
[2016-10-26 09:50:29,074] ERROR {org.jaggeryjs.scriptengine.engine.RhinoEngine} -
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at org.apache.commons.ssl.SSL.<init>(SSL.java:154)
at org.apache.commons.ssl.SSLClient.<init>(SSLClient.java:60)
at org.apache.commons.ssl.HttpSecureProtocol.<init>(HttpSecureProtocol.java:55)
at org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory.<init>(EasySSLProtocolSocketFactory.java:94)
at org.jaggeryjs.hostobjects.xhr.XMLHttpRequestHostObject.<init>(XMLHttpRequestHostObject.java:84)
... 113 more
Caused by: java.lang.NullPointerException
at org.apache.commons.ssl.TrustMaterial.<init>(TrustMaterial.java:127)
at org.apache.commons.ssl.TrustMaterial.<init>(TrustMaterial.java:118)
at org.apache.commons.ssl.TrustMaterial.<clinit>(TrustMaterial.java:108)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.commons.ssl.KeyMaterial
at org.apache.commons.ssl.SSL.<init>(SSL.java:154)
at org.apache.commons.ssl.SSLClient.<init>(SSLClient.java:60)
It is a vanilla version of the server and I haven't made any kind of configuration changes. I am running on JDK 1.8. Can someone tell me what the resolution will be. I tried including "not-yet-commons-ssl-0.3.10.jar" and that didnt help.
Regards
Ranjith Madhavan
I recently got this exception, it was due to the fact that i donot have /lib/security/cacerts and /lib/security/jssecacerts in my jre.

WSO2 ESB: JAR file with callback handler not loading

I am trying to setup a proxy service that hides the security of a back end service, following the tutorial found here.
For the password callback handler I follow the instructions found here.
All pretty basic and straightforward.
I compiled the PWCBHandler class into a JAR file and put it in the esbhome\repository\components\lib folder together with all the JAR files from wss4j-1.6.15\lib.
I see no warnings or errors during startup of the ESB. However when I test the proxy service, I get the following error in the log:
org.apache.axis2.AxisFault: Error in obtaining a token
at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:76)
at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
...
Caused by: org.apache.rampart.RampartException: Error in obtaining a token
at org.apache.rampart.util.RampartUtil.getToken(RampartUtil.java:779)
at org.apache.rampart.util.RampartUtil.getIssuedToken(RampartUtil.java:675)
...
Caused by: org.apache.rampart.RampartException: Cannot load password callback class: PWCBHandler
at org.apache.rampart.util.RampartUtil.getPasswordCB(RampartUtil.java:144)
at org.apache.rampart.util.RampartUtil.getPasswordCB(RampartUtil.java:118)
at org.apache.rampart.util.RampartUtil.getToken(RampartUtil.java:723)
...
... 26 more
Caused by: java.lang.ClassNotFoundException: PWCBHandler
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)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
... 26 more
Caused by: java.lang.ClassNotFoundException: PWCBHandler
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)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.apache.ws.security.util.Loader.loadClass(Loader.java:200)
at org.apache.ws.security.util.Loader.loadClass(Loader.java:163)
at org.apache.rampart.util.RampartUtil.getPasswordCB(RampartUtil.java:142)
... 28 more
[2014-06-16 15:56:23,103] WARN - FaultHandler ERROR_CODE : 0
[2014-06-16 15:56:23,103] WARN - FaultHandler ERROR_MESSAGE : Unexpected error during sending message out
[2014-06-16 15:56:23,103] WARN - FaultHandler ERROR_DETAIL : org.apache.synapse.SynapseException: Unexpected error during sending message out
at org.apache.synapse.core.axis2.Axis2Sender.handleException(Axis2Sender.java:170)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:69)
...
In other words, the ESB and Rampart know about the PWCBHandler class but it cannot load / access it.
At this point I have no ideas where to look further. Is there a way where I can check which JAR files were loaded during startup? What might prohibit the loading of the PWCBHandler JAR?
Thanks for your feedback,
Olivier
Thanks to the answer from Rajeev I got confirmation the class was not loading.
I recreated the JAR file with the class added to a package and after restarting the server a bundle for the JAR was created.
It looks like custom classes need to be added to a package for Carbon to create a bundle from it.
I know, I know, classes should always be added to a package, but I am not a Java hero and did not want to bother with the dirs and such.
Lessons learned! :)