Purujit Saha

Ranch Hand
+ Follow
since Nov 01, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Purujit Saha

Deepak Bala wrote:Your trust store must contain both CA certificates. My guess is that your trust store contains your CA certificate but not thwate's. The default trust store contains thwate's CA but not yours. You are swapping these keystores for each call

Use 'keytool -list' to list all certs in the keystore to verify this. The verbose option (-v i think) can also come in handy



Thanks for the reply.
Actually my CA certificate is from thwate which has been used on production service box & since JDK by default trust thwate's certificate, i do not need to set any certificate key on the client side.
But in case of devl service instance we have used a test certificate & thats why to trust each other we need to use a certificate key on client side when our client tries to connect devl service. And thats why we set those 6 system properties runtime.
13 years ago
We are having a web service test client through which we can connect and generate reports from multiple web services instances(Devl / Preprod / Production).
On the service side, in development instance, we are using "self-signed certificate" using keystore type JKS. In Production server, we are using certificate from CA.

The web service is running in Development and in Production.
Now we have developed single test client with a drop down selection for different web services. For example, if we select "Development", the request will go the development web service and if we select "Production", the request will go to Production web service.

Now while connecting to Develpment service, we are settings the below certificates details Because we are using the self signed certificate.
System.setProperty("javax.net.ssl.keyStore",keyStoreFileLocation);
System.setProperty("javax.net.ssl.keyStorePassword",keyStorePassword);
System.setProperty("javax.net.ssl.keyStoreType", keyStoreType);
System.setProperty("javax.net.ssl.trustStoreType",trustStoreType);
System.setProperty("javax.net.ssl.trustStore",trustStoreFileLocation);
System.setProperty("javax.net.ssl.trustStorePassword",trustStorePassword);

We are clearing the System properties using the System.clearProperty() while pointing to Production service. because in Production we are using the CA certificate from Thawte so these details are not required at all and JRE (java 5) is pre configured to support that CA certificate.

We are using Resin-2.1.12, axis1.2 and java5.

Now the problem is
(1) for the first time, when we send the request to Production Service URL, the report gets generated. For the next time when we are running against Development, it's giving below certificate error.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

(2) Now restart resin and run the test client against Developemnt service URL, here report gets generated and for the next time, run the test client against Production, it's giving the certificate error.
So for the 2nd request, it always gives the error irrespective of the web service instance selected.

On request we can share the code also if required.
So, if any of you can put some light on this, should be appreciated. ....thanks in advance.
13 years ago
I have installed the Apache 2.2.4 on solaries 5.10
Standalone apche is running fine. I can retrieve pages from htdocs.
But i am not been able to retrieve anything from cgi-bin, getting error code 500.

I have already written this in httpd.conf file

ScriptAlias /cgi-bin/ /usr/local/apache/share/cgi-bin/
<Directory /usr/local/apache/share/cgi-bin>
Options ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>


Can any body suggest what specific thing needs to be done with apache 2.2.4
[ April 26, 2007: Message edited by: Purujit Saha ]
18 years ago
Hi,

I am using apache webserver 2.2.4 and apache-tomcat 5.5.23 on Solaries 5.10.
I have installed both of them successfully.
Both the server are running standalone. Apache configures at 61696 port and tomcat at 61697 port.
I am using JK connector (tomcat-connectors-1.2.22) to connect them.

My Configuration details are,

1. I have added the following line in apache config file [apache_home/conf/httpd.conf]

Include /mfg/hnp/apache-tomcat-5.5.23/conf/auto/mod_jk.conf

2. I have also added the following lines in Tomcat config file [tomcat_home/conf/server.xml)

<Listener className="org.apache.jk.config.ApacheConfig" modJk="<apache_home>/modules/mod_jk.so" />

<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />

and also

<Engine name="Catalina" defaultHost="p10dvl">
<Host name="p10dvl" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false"
xmlNamespaceAware="false">
<Listener className="org.apache.jk.config.ApacheConfig" append="true" forwardAll="false"

modJk="/mfg/hnp/apache-2.2.4/modules/mod_jk.so" />

</Host>
</Engine>


3. [<tomcat_home>/conf/jk/workers.properties]

# BEGIN workers.properties
worker.list=ajp13
worker.ajp13.port=8009
# change this line to match apache ServerName and Host name in server.xml
worker.ajp13.host=p10dvl
worker.ajp13.type=ajp13
# END workers.properties


Now when i start the tomcat and apache subsequently,

the file has been created by tomcat server [ <Tomcat_home>/conf/auto/mod_jk.conf]

======================================
<IfModule !mod_jk.c>
LoadModule jk_module "<apache_home>/modules/mod_jk.so"
</IfModule>

JkWorkersFile "<tomcat_home>/conf/jk/workers.properties"
JkLogFile "<tomcat_home>/logs/mod_jk.log"

JkLogLevel emerg

<VirtualHost p10dvl>
ServerName p10dvl

# Static files
Alias /test "apache-tomcat-5.5.23/webapps/test"

<Directory "<tomcat_home>/webapps/hnp">
Options Indexes FollowSymLinks
DirectoryIndex index.html index.htm index.jsp
</Directory>

JkMount /test/*.jspx ajp13
JkMount /test/servlet/* ajp13
JkMount /test/*.jsp ajp13

</VirtualHost>


====================================

i am also getting the following log message from tomcat log file [catalina.out ]

line 1: INFO: Starting Coyote HTTP/1.1 on http-61697
line 2:Apr 24, 2007 9:50:31 AM org.apache.jk.common.ChannelSocket init
line 3:INFO: JK: ajp13 listening on /0.0.0.0:8009
line 4:Apr 24, 2007 9:50:31 AM org.apache.jk.server.JkMain start
line 5:INFO: Jk running ID=0 time=0/125 config=null
line 6:Apr 24, 2007 9:50:31 AM org.apache.catalina.storeconfig.StoreLoader load
line 7:INFO: Find registry server-registry.xml at classpath resource
line 8:Apr 24, 2007 9:50:32 AM org.apache.catalina.startup.Catalina start
line 9:INFO: Server startup in 7769 ms


Specially i am pointing to line 3 [listening on /0.0.0.0:8009 ] and line 5 [config=null] of the log message.

Please let me know if i have configured the apache with tomcat corectly. If not please let me know what else i have to do.

Thanks
Purujit Saha
18 years ago
All of your inputs has helped me to solve my problem.
Thanks to all.
I have a Parent Class which spawns 10 child threads,

class Parent{

public static void main(String[] args) {

int threadWorkerNo = 10;
processStartTime = System.currentTimeMillis();
spawnThreads(threadWorkerNo);

System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");

}

private static void spawnThreads(int number){

for(int i=1;i<=number; i++){
String name = Integer.toString(i);
MigrationWorker th = new MigrationWorker(name);
th.startThread();
}

}
}

Assume the MigrationWorker is a Thread Class which does some work.
now i want the Parent class main method to wait till all the 10 migration workers thread are died.
That means when all the 10 child threads are dead,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& will be printed.

Thanks in advance....

[ April 09, 2007: Message edited by: Purujit Saha ]
[ April 09, 2007: Message edited by: Purujit Saha ]
Please let me know how to write the following expresion in EL , in a jsp

<%=config.getInitParameter("xyz")%>

Thanks
Can anybody explain whats the Difference between getNamedDispatcher() &
getRequestDispatcher() methods of javax.servlet.ServletContext Interface.
Its very nice initiative.
Many many Thnx, & really feel a good & honest job done by u.
Hello Mr Niranjan Deshpande .

This question is the right example that fits your comment.
" no good questions posted these days "
[ December 15, 2005: Message edited by: Purujit Saha ]
The instanceof operator is used to check if an object reference belongs to a certain type or not.
The type can either be an interface or a superclass.

The use of instanceof in java is as follows

Example
------- if(op1 instanceof op2) ....where op1 is a reference of any object & op1 is any class name.



During compile time the JVM will check whether the op1 is of type op2 or not.If it is not of same type then it will through compile time exception;
During runtime it will return true only if the Object which is referenced by op1 is not null & of same type
This will not give any compile time error as you are explicitly type casting it.
So, the compiler will assume that whatever you are doing in explicit type casting is know to & you are responsible for that.so it will over look the error. But in run time it will give error.
public class TestClass
{
// insert declaration of a native method here
}

which of the following is correct,

1. native public void nativeMethod(int i);
2. private native void nativeMethod(int i);
3. protected int native nativeMethod();
4. public abstract native void nativeMethod(int i);
5. native int nativeMethod(int i) {}


Please give answer with explanation.
[ December 14, 2005: Message edited by: Purujit Saha ]

[ December 14, 2005: Message edited by: Purujit Saha ]
[ December 14, 2005: Message edited by: Purujit Saha ]