Nischit Shetty

Greenhorn
+ Follow
since Feb 21, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nischit Shetty

After some reasearch, I was able to perform the S4u2self and s4u2proxy using java 8. Surpised that atleast one example should have been provided by Oracle documentation. Anyhow, I am now moving to next stage. Now another scenario that I have to handle is cross-domain kerberos certificate delegation. From the java 8 documentation that I have seen so far, it infers that currently cross-realm is not supported. Is it still true?
8 years ago
I am trying to use S4U2Proxy and S4U2Self introduced in Java 8. Unfortunately I was not successfull in finding those many examples. My requirement is the client would send its certificate. I should then delegate (using kerberos) his request, connect to KDC, get the TGT, get the service ticket to contact another server on user's behalf and then finally contact the actual service by providing the service ticket. If you have a working example for some dummy client and server, it would be great.

I have a code base which does the following -
1) Using JaaS, the service which is supposed to impersonate successfully logs into to KDC.
2) I now have the JAAS subject. It cantains the kerberos ticket (TGT and alll).
3) within the scope of the scope of the "subject", I am now running the below code. But it fails with an error "Invalid option setting in ticket request. (101)". Obviously there is a basic issue in my that I am missing. This error is occuring even before a request is made to KDC.



Obviously there will be questions about how the SPN has been set in the KDC? Whether that service account is authorized for delegation? Has the right SPN been assigned to that service account? When the user "monkey" denies all sort of delegation? etc etc. Right now I feel I have made the right settings in KDC. My problem is the above is occuring even before it hits the KDC. Any valid inputs will help.
8 years ago
I am sorry that I am replying to one of the oldest thread. Long time back I had found a solution in another forum. Wish I could recall and paste that link.

I have tested the solution provided by them on Websphere 6.1 and websphere 7 and it works.

1) No need to have commons-logging.properties in the classpath. No need to change the class loading policy to PARENT_LAST.
2) Under META-INF/services, create a file by name "org.apache.commons.logging.LogFactory". The content of file should be just "org.apache.commons.logging.impl.Log4jFactory"
3) Now comes the most important part. Websphere 6.1 and 7.0 still uses apache-commons-logging "1.0.3" version.
a) In Websphere 6.1, go to <WEBSPHERE INSTALLED FOLDER>/plugins and open the jar "com.ibm.ws.runtime_6.1.0.jar". It contains the commons logging file
b) Download apache commons logging 1.0.3 version from its archived website. Open the downloaded jar. When you compare the contents with the jar file of Websphere you will find that the downloaded version of apache commons logging has the below extra files
- org.apache.commons.logging.impl.Log4JCategoryLog.class
- org.apache.commons.logging.impl.Log4jFactory.class
- org.apache.commons.logging.impl.Log4JLogger.class
- org.apache.commons.logging.impl.LogKitLogger.class
All other files are common files in both websphere and apache library.
c) Now from the downloaded apache commons logging jar, delete the common files. Only retain the above mentioned file. Once you are done, you will basically have a stripped version of apache commons logging 1.0.3. Put this stripped jar in WEB-INF/lib
d) You are all set, restart the server.
4) In Websphere 7.0, the apache commons logging can be found at <WEBSPHERE INSTALLED FOLDER>/plugins/com.ibm.ws.prereq.commons-logging.jar. All other activities will be similar to the one explained above
5) With this approach, we are not changing core library file of Websphere. Neither we are changing the class loading policies.

As I mentioned above, this solution was found in some forum which I am unable to recall. I have basically tried to provide as much information as I can. I had done the above activities in one of my previous project and was successful.
11 years ago
I am big fan of JSF and have worked in the past. I just love them. I simply love Primefaces with Mojarra or myfaces implementation.
Now, we have a new requirement to build a fresh web based application for high user and transaction base application. Peak time or concurrent users can be 1500.
We will be using Websphere 7.5 or above.

Well it all sounds exciting but this new requirement makes me to think for some time. The end user should like application performance as well. We have certain NFR to meet.
Unfortunately, I never got a chance to use JSF with high user based application. In the past I have used it for a max of 500 users.
Now my question is will JSF fit here?
It might sound vague to answer as performance of the application is not determined by one framework, a host of other factors play a crucial role too. I dont want to get into a situation where in after the whole application is built, we find JSF as the bottleneck.
Any members have used JSF for such high user base? How were the results? Any inputs based on your practical experience with high user base application will be greatly useful.
11 years ago
JSF
What you are trying to attempt will not work. The moment you start using JSF tags / components, any reference to a bean or object, JSF tries to look within its context, facesconfig. It does not go outside its perimeter.
If your intention is to all call a servlet by clicking a link within a page rendered by JSF, use regualr HTML tags or call a managed bean and then forward to a servlet
11 years ago
JSF
Hi - Can you please elaborate if you are using 2 implementations of JSF? Any UI specific components such as prime faces / rich faces being used?
11 years ago
JSF
Hi Nakul - In all probabilities you are using App server MQ connection pooling right?
Can you please let me know the configuration that you have made on MQ connection pooling?
While publishing and subscribing messages, are you using sync messaging?
What is the time out period?
Do you send reply queue name along with correlation id or you create a dynamic reply queue at runtime?
11 years ago
Check your task manager. If there is a process called "Javaw", kill it. then start the tomcat using eclipse
11 years ago
Ideally your idea is correct. You have to perform more of trial and error approach to figure out what is being passed as part of request header.

If you have generated your stubs using Axis, try to do the following instead of the approach that you are following -
Sample1InterfaceService service = new Sample1InterfaceServiceLocator();
Sample1Interface stub = service.getSample1();
(Sample1SoapBindingStub)stub)._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY, domain + "\\" + username);
((Sample1SoapBindingStub)stub)._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY, password);
stub.getGreeting(someinput);


Although I do not find any fault in your code, just experiment a different approach and check for result.
12 years ago
Most of framework would do the job that we required to do. So I will take the decision based on the application server or web server that I am using. If I am using something like Websphere, I would chose Axis 2. Using other web service frameworks in Websphere will not be a easy task to integrate. I had to do lot of work arounds to make CXF run on websphere. You will find similar issues while using Metro on websphere.
So choose the one that best fits your infrastructure.
12 years ago
Rajesh - you have to employ trial and error technique to resolve your issue.

If you have the webservice URL, call it on your browser. Do you see any response? Does it say the webservice is up and running?
If not, I am guessing the below possible scenarios

1) Verify if the webservice is running at the specified port?
2) Verify if the webservice has to undergo form based authentication, basic authentication, etc
3) Check if the firewalls are not causing any issue (In your case i believe this is not a problem, but still check it out)
4) Are you the only one consuming this service? Any other app is using it? If so find out what they are doing?
12 years ago
Hi Rajesh - Please invoke the webservice using SOAP UI or Firefox SOA plugin. these tools will act like a client and test whether the inteneded webservice is working. From the looks of the stack trace, it looked like you have no permission to invoke the service.
12 years ago
If I am not wrong, basic authentication information is sent as part of request header.
Your request header will contain an element as follow "Authorization: Basic bHdzc3J2MXQ6bHdzQGszeTE="

Refer the last section of my post Basic Auth. It will give a code snippet while using Axis client.
12 years ago
We have requirement to call a webservice hosted by webMethods. I have tried using multiple ways of calling this service and each it fails stating my credentials are wrong.
I have tried following steps


1) Using SOAP, provided the WSDL, credentials, the SOAP UI put as log as below


Tue Feb 07 22:11:28 EST 2012:DEBUG:<< "HTTP/1.0 401 [ISS.0084.9001] Invalid credentials[\r][\n]"
Tue Feb 07 22:11:28 EST 2012:DEBUG:<< "HTTP/1.0 401 [ISS.0084.9001] Invalid credentials[\r][\n]"
Tue Feb 07 22:11:28 EST 2012:DEBUG:<< "WWW-Authenticate: Basic realm="webMethods"[\r][\n]"
Tue Feb 07 22:11:28 EST 2012:DEBUG:<< "Connection: Close[\r][\n]"
Tue Feb 07 22:11:28 EST 2012:DEBUG:<< "Content-Length: 0[\r][\n]"

2) Using SOA Client, I tried invoking it by providing the SOAP message and http header looking as below:

Authorization: Basic R0xEU1JWMVQ6NyNyc3BvaTQx2a
SOAPAction: {namespace}/{methodname}
Content-Type: text/xml
authtype=basic#realm=webMethods
WWW-Authenticate: Basic realm="webMethods"

It failed stating my credentials are incorrect.

3) Tried running a servlet with a regular http call



It failed with an exception as below

[2/7/12 22:50:36:801 EST] 00000021 SystemErr R java.io.IOException: Server returned HTTP response code: 401 for URL: webserviceurl
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1236)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.net.ssl.www2.protocol.https.b.getInputStream(b.java:49)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.TestServlet.postURL(TestServlet.java:146)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.TestServlet.doPost(TestServlet.java:117)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.TestServlet.doGet(TestServlet.java:54)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[2/7/12 22:50:36:817 EST] 00000021 SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
[2/7/12 22:50:36:987 EST] 00000021 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)


4) Tried using Apache HTTP client with java code looking as below



The above code failed with return error code as "401" which means unauthorized

5) Tried making a call by building Axis client stubs as below




It failed stating with below exception


AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)[ISS.0084.9001] Invalid credentials
faultActor:
faultNode:
faultDetail:
{}:return code: 401

{http://xml.apache.org/axis/}HttpErrorCode:401

(401)[ISS.0084.9001] Invalid credentials
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.TestServlet.doPost(TestServlet.java:109)
at com.TestServlet.doGet(TestServlet.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)


I am not sure if there is anything missing. Can you please help me troubleshooting this problem?
12 years ago