IBM Worklight - Custom Authentication - ibm-mobilefirst

When trying to authenticate an adapter using custom authenticator and login module, I am facing the following exception.
[ERROR ] FWLST0003E: ========= Failed starting project /CustomAuth [project CustomAuth]
Error creating bean with name 'taskManager' defined in URL [wsjar:file:/D:/worklight_workspace/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'worklightAuthenticationService' while setting bean property 'authenticationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklightAuthenticationService' defined in URL [wsjar:file:/D:/worklight_workspace/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Cannot create inner bean 'com.worklight.core.auth.impl.LoginConfigurationServiceBean#7cffa209' of type [com.worklight.core.auth.impl.LoginConfigurationServiceBean] while setting bean property 'loginConfigurationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.worklight.core.auth.impl.LoginConfigurationServiceBean#7cffa209' defined in URL [wsjar:file:/D:/worklight_workspace/WorklightServerConfig/shared/resources/worklight-jee-library-6.1.0.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Class 'com.mypackage.MyCustomLoginModule' defined in login module 'CustomLoginModule' in the authentication configuration file doesn't exist.
[AUDIT ] CWWKZ0001I: Application CustomAuth started in 0.948 seconds.
[ERROR ] SRVE0315E: An execption occurred: com.ibm.ws.webcontainer.webapp.WebAppErrorReport: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: java.lang.RuntimeException: Class 'com.mypackage.MyCustomLoginModule' defined in login module 'CustomLoginModule' in the authentication configuration file doesn't exist.
at com.worklight.core.auth.impl.AuthenticationFilter.verifyServletInitialized(AuthenticationFilter.java:300)
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
Caused by: javax.servlet.ServletException: Worklight Console initialization failed.Logged Exception: java.lang.RuntimeException: Class 'com.mypackage.MyCustomLoginModule' defined in login module 'CustomLoginModule' in the authentication configuration file doesn't exist.
... 5 more
Could you help me?

Seems that your project war does not contain your java classes for some reason. I am not sure why, need more information on that, but I think that by deleting your bin folder and rebuilding all artifact you will be able to solve this issue.

Look your JDK version between your generated binary app and your Worklight server version. You can check if the binary is generated in Windows or Unix based operative system and redeploy your app taking the server operative system as a base for your binary app.

Need to write their own java class for custom authentication. These java class will act like authenticator and challenger while writing a custom authentication method.
Please find the documentation for the HTTP based custom authentication.

Related

Weblogic Deployment issue due to NameAlreadyBoundException - after upgraded weblogic from 10.3.6 to Weblogic 12cR2

My application currently working under weblogic 10.3 with Java 1.6.
Now we are trying to deploy same application to weblogic 12cR2 & java 1.8, below is the error we are facing.
Unable to bind Business Interface to the JNDI name: Gen4CServlet_warcontact_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactSession to RemoteContactession. Another EJB has already bound an interface to that name.; remaining name 'ejb/Contact#com/ce'. NestedException Message is :[EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactSession to RemoteContactSession. Another EJB has already bound an interface to that name."
weblogic.application.ModuleException: Unable to bind Business Interface to the JNDI name: iLinqGen4CGEServlet_warcontactge_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactGESession to RemoteContactGESession. Another EJB has already bound an interface to that name.; remaining name 'ejb/Contact#com/hh/cc/ce'. NestedException Message is :[EJB:011224]Unable to bind the interface com.hh.cc.ce.RemoteContactSession to RemoteContactSession. Another EJB has already bound an interface to that name.
at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:212)
at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:207)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
According to Oracle KM Unable To Bind Business Interface To The JNDI Name javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind (Doc ID 2254400.1), this can be due to Class-Path entry in MANIFESF.MF file. Try to remove the same redeploy the application.

JasperReports Server 6.1.1 LDAP SSO

I tried this tutorial, to get SSO working with JasperReports Server (JRS) 6.1.1 but I get the following Error in the JRS log:
2017-01-10 15:04:11,174 ERROR ContextLoader,localhost-startStop-1:331 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterChainProxy' defined in ServletContext resource
[/WEB-INF/applicationContext-security-web.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError:
com/jaspersoft/jasperserver/multipleTenancy/DefaultMultiTenancyConfiguration
I don't know exactly what multi tenancy means, something like I could use several domains?
And the JRS won't start anymore, what did I wrong?

Glassfish Bean Validation weird error

I am using bean validation in my application. When there is no constraint validation errors everything works nicely. Every time there is a validation error, Glassfish throws the following exception:
Caused by: java.lang.ClassNotFoundException: javax.validation.groups.Default: java.net.MalformedURLException: Unknown protocol: osgi
at com.sun.corba.ee.impl.util.JDKBridge.loadClassM(JDKBridge.java:325)
at com.sun.corba.ee.impl.util.JDKBridge.loadClass(JDKBridge.java:228)
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.loadClass(Util.java:640)
at com.sun.corba.ee.impl.util.RepositoryId.getClassFromType(RepositoryId.java:628)
at com.sun.corba.ee.impl.orbutil.RepIdDelegator.getClassFromType(RepIdDelegator.java:169)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readClass(CDRInputStream_1_0.java:1439)
The bean-validation.jar is present in glassfish/modules folder. The startup doesn't throw any exceptions regarding validation.
PS. Note that we are using remote beans with CORBA.
Reproducable on GlassFish 3.1.2.2 and 3.1.1.
I traced this problem to serialization of the ConstraintValidationException through CORBA. Somehow the bean-validation module is not loaded properly with osgi and the javax.validation.groups.Default class is missing. I made a quick workaround so that the ConstraintValidationException is intercepted and never sent through CORBA. Instead the validation error information is gathered in a custom Exception class that can be actually serialized through the services.

Hornetq with apache naming JNDI

I tried to put Apache JNDI for Hornetq according to these blog : http://wash-inside-out.blogspot.com/2010/08/hornetq-jms-integration-with-tomcat.html. but I'm getting this error now :
Deployment "Naming" is in error due to: javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is java.lang.ClassNotFoundException: org.apache.naming.java.javaURLContextFactory ]
How to find out which jar file has that class?
According to this search result in FindJar, naming-factory-5.5.23.jar is the one that contains that class. Beware that the dependency scope is test in the example you provided. Are you doing the lookup in non test code?

OSB WLS Initialisation issue

facing some strange behavior in OSB, i have configured WLS with MQ in client mode, i am doing some minor test to check the connection, i have created a proxy service to read the message from Q1 and a Business Service(BS) to route it to Q2. The issue is the proxy is able to read the message but the BS is throwing this:
JMSPool BEA-169807 There was an error while making the initial connection to the JMS resource named ALSB_JMS_SessionPool_491704821 from within an EJB or a servlet. The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSPool:169803]JNDI lookup of the JMS connection factory AKBConnFact failed: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory
Note: The classpath or the domain/lib folder contains the RefFSContextFactory class
Any ideas gang..? TIA
The answer is this is a bug in OSB which needs to be reported.
As a workaround you need to individually set the jars in the weblogic classpath in your domain/server/bin folder. just go through the link below for more details:
http://forums.oracle.com/forums/thread.jspa?threadID=2135523&start=0&tstart=0