This is my first time to write NTLM mediator followed by NTLM Mediator
The mediator project:
Exported Jar and [ESB_HOME]/repository/components/dropins
Proxy service to test:
The mediator seems not work:
Line 73 throw out exception:
You have to put jars into lib ($ESB_HOME/repository/components/lib). Delete jar in the dropins. As ESB start, it will put that jar into dropins folder. Try that.
If not you may have to add three folders as given in documentation[2].
Further references:
[1] https://docs.wso2.com/display/ESB490/Class+Mediator
[2] https://docs.wso2.com/display/ESB490/Places+for+Putting+Custom+Mediators
The issue seems to be related to the mediation logic. The mediator seems to have deployed correctly since there is no ClassNotFound exceptions. To figure out the error you can add logs to the mediator or remote debug the mediator by starting ESB server in debug mode
(./wso2server.sh debug 5005). You should debug the mediate() method. The error that you have got is thrown due to some exception being thrown in your class mediator's mediate() method.
DilshaniS' answer is correct. You have to place your mediator jar in lib folder (also need to delete the existing jar in dropins folder). Following is the reason.
WSO2 products can only load/activate a jar placed in dropins folder only if it is written as an osgi component. In your case, it is just a jar. There are no classes which should be there in a osgi bundle. If it is a normal jar, you have to place it in the repository/components/lib folder. Then, when the server starts, it creates a osgi bundle from that jar and places it in the dropins folder. Then that osgi bundle gets activated and you are able to uses the classes in it.
Related
I'm trying to enable a new post authentication handler in order to use the authenticated user info. I tried to follow this guide: https://docs.wso2.com/display/IS570/Writing+a+Post-Authentication+Handler#WritingaPost-AuthenticationHandler-ByreturningaPostAuthnHandlerFlowStatus using the sample code in https://github.com/wso2/samples-is/tree/master/etc/sample-post-authentication-handler
So I created the jar of sample-post-authentication-handler and i putted it in the dropins server folder, and disclaimer.jsp in the authenticationendpoint folder.
I run the server and I logged with a sample application, but the handler doesn't fire.
I tried to put logs on DisclaimerPostAuthnHandlerServiceComponent and DisclaimerPostAuthenticationHandler, I enabled the log4j log level of the package. In the end, I tried to log with system.out, but I never see in the server log something about the registration of the handler.
I think the DisclaimerPostAuthnHandlerServiceComponent is ignored, so the handler is not registered.
Where I'm wrong?
I'm using wso2 5.7.0 and I'm really new to wso2 and osgi.
Seems you have built the master branch source code https://github.com/wso2/samples-is/tree/master/etc/sample-post-authentication-handler and obtained the jar and tried to use it with IS-5.7.0
But, the samples are available in the master branch might not compatible with the previous releases due to dependency updates.
When I tried the sample-post-authentication-handler jar file built from the master branch, it won't get activated properly in IS-5.7.0. It's in installed state due to the failure of resolving required dependencies.
NOTE: Check the "Useful OSGi commands to debug" section of https://medium.com/p/482f6e5e3ea5 to understand how we can check whether the OSGi bundles are activated or not.
Can you try the sample-post-authentication-handler in tag v1.0.0? It's compatible with Is-5.7.0
https://github.com/wso2/samples-is/tree/v1.0.0/sample-post-authentication-handler/src/main
NewBie here. I am struggling with adding SNMP connector to my ESB project. As per https://docs.wso2.com/display/ESBCONNECTORS/Configuring+SNMP+Inbound+Operations
Step1) I created folders and added files to /home/repository/components/dropins
and home/repository/components/libs
Step2) I then created inbound-endpoint for SNMP in my EI editor.
since my inbound Endpoint editor design layout looked different from wso2 tutorial i mentioned above, I copied Inbound Configuration from tutorial.
Step3) I also went ahead and created sequence as request.xml [took code from tutorial]
When I deployed my Inbound EP and sequence, I am getting
ERROR - GenericEventBasedListener Class org.wso2.carbon.inbound.snmp.SNMPListeningConsumer not found. Please check the required class is added to the classpath.
**java.lang.ClassNotFoundException: org.wso2.carbon.inbound.snmp.SNMPListeningConsumer cannot be found by synapse-core_2.1.7.wso2v80**
What else should I do to get my SNMP files in to classpath? I have restarted my server and SNMP connector is available on the Palette in EI 6.4.0.
The above ClassNotFoundException should be a result of not having the correct classes in the OSGi layer upon server startup due to missing JAR files. The following JAR files should be available in the EI server in the corresponding folders and the server needs to be restarted.
org.apache.synapse.snmp.listen.class-x.x.x.jar - <EI_HOME>/dropins
snmp4j-x.x.x.jar - <EI_HOME>/lib
The dropins directory should contain only the OSGi bundles and the lib directory should have the NON-OSGi bundles. Upon server startup even the NON-OSGi JAR files will be converted to OSGi with a corresponding JAR file in the dropins directory.
The best way to troubleshoot this kind of a ClassNotFoundException is to access the OSGi console of WSO2 carbon-based products. Any unsatisfied constraints of the OSGi bundle can be identified easily with a couple of commands as explained in https://movingaheadblog.blogspot.com/2014/01/how-to-debug-wso2-carbon-products-using.html
I have a question regarding the WSO2 ESB callout mediator using an individual Axis2 configuration file. I would like to have the individual Axis2 configuration to be deployed using a carbon application. Unfortunately the callout mediator doesn't seem to be able to read the Axis2 configuration from the registry. I'm getting an error that the file axis2_blocking_client_proxy.xml can't be resolved when I deploy the carbon application that contains the mediation with my callout mediator.
The deployment works when I Quote a relative file path that points to the configuration file. Does anybody know if there is a way to tweak carbon application files so that distinct resources will be written to a dedicated directory on the WSO2 ESB Server?
Best regards,
Heiko
AFAIU, your requirement is to deploy an axis2 configuration file using a CAR (carbon application) file. This is not a recommended approach. If you need to deploy a configuration file in to the ESB, you can deploy that during the server creation time. CAR files are used to deploy the actual implementation code rather than the static configuration files.
I'm refering to the following article
http://wso2.com/library/articles/2010/10/using-xacml-fine-grained-authorization-wso2-platform/
I would like to use the sample echoService from the WSO2 AS over a secured proxy in WSO2 ESB in combination with the Identity Server for fine-grained authorization. All the settings mentioned on this page seem to work, however I am stuck concerning the client part. I use NetBeans and the given client code, but the .jars in the classpath there have older versions then the ones in the current version of WSO2 IS, so I started to exchange them manually. Now I get some exceptions like
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
and I am stuck again. I just want to test the echoService in this constellation and send some string over the ESB via IS and receive the response(if I have the appropriate role) from the AS, is there not another client or how could I test it else?
Thank you!
I can suggest you 3 options:
Use SoapUI to test the service which is the easiest way to test a web service.
Generate the stub for the service and have stub as the dependency in your client. You can use the WSDL2Java tool that ship with AS. Loging to AS --> Tools in left pane --> WSDL2Java --> Provide the wsdl URL and generate the stub jar.
Generate correct dependency libs. Go to [IS-Home]/bin folder, and issue that command "ant" to run the build.xml, this will copy all required libs to [IS-HOME]/repository/lib/ folder. Have them in your class path.
My application is a war deployed in weblogic 10. In one of my class, I need to make 2 webservice calls A and W. A is based on AXIS2 using wstx-asl-3.2.4.jar, W is based on weblogic webservice using jars in weblogic. I guess due to the conflict between wstx-asl and weblogic stax implementation, they can not be made at the same time.
Here is the detail of the problem:
1. If I remove wstx-asl-3.2.4.jar from web-inf/lib folder,
B is OK but A is faild due to exception: ClassCastException:weblogic.xml.stax.XMLStreamInputFactory
2. If I keep wstx-asl-3.2.4.jar in web-inf/lib folder,
A is OK but B is faild due to the exception:
[java.lang.ExceptionInInitializerError at com.bea.staxb.runtime.internal.BindingContextImpl.createMarshaller(BindingContextImpl.java:65) at weblogic.wsee.bind.runtime.internal.LiteralSerializerContext.(LiteralSerializerContext.java:54) at weblogic.wsee.bind.runtime.internal.RuntimeBindingsImpl.createSerializerContext(RuntimeBindingsImpl.java:152) at weblogic.wsee.bind.runtime.internal.RuntimeBindingsImpl.createSerializerContext(RuntimeBindingsImpl.java:168) at weblogic.wsee.codec.soap11.SerializationContextUtil.createSerializerContext(SerializationContextUtil.java:26) at weblogic.wsee.codec.soap11.SoapEncoder.encodeParts(SoapEncoder.java:179) at weblogic.wsee.codec.soap11.SoapEncoder.encode(SoapEncoder.java:119) at weblogic.wsee.codec.soap11.SoapCodec.encode(SoapCodec.java:128) at weblogic.wsee.ws.dispatch.client.CodecHandler.encode(CodecHandler.java:52) at weblogic.wsee.ws.dispatch.client.CodecHandler.handleRequest(CodecHandler.java:41) at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:123) at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:99) at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:101) at weblogic.wsee.ws.WsStub.invoke(WsStub.java:89) at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:331) at
.........................
Please advise how to make them successful together. Thanks.
in your deployment weblogic.xml file, use the <prefer-web-inf-classes> tag and set it to true for the axis2 call. And set it to false for the weblogic web service.
http://download.oracle.com/docs/cd/E13222_01/wls/docs90/programming/classloading.html#1082452