Sarin Kuraganti

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

Recent posts by Sarin Kuraganti

Hi All,

I am trying to externalize the properties outside of a war file as this is an absolute necessity for our application. I found a way in the Spring forum as described below, but that doesn't seem to be working. Can you please let me know how to externalize properties outside of the war file and still refer to those properties in web.xml, applicationContext.xml and XXX-servlet.xml? Thanks in advance for any help or pointers.

I'm using Tomcat 5.5.27 and Spring 2.5

Here's what I've found:




Then in my Spring bean files, I extract the value from JNDI and define and configure the PropertyPlaceholderConfigurer as such:



Hi,

I would like to know the following and would appreciate any of your responses:

1. What is the difference between SOA and Web Services?
2. Where is Web Services going?
3. I know that Web Services can be implemented using Web Logic, Axis and others. But I want to know the actual difference between using Web Logic server to implement Web Services and using Axis to implement Web Services.
4. what are the other java based technologies that can be used to implement web services? What are the advantages and disadvantages of using WebLogic, Axis and others? And in today's IT industry, what is the most adopted and widely used technology to implement Web Services and why? Also which one of these is easier and best to use to implement Web Services?
5. Would getting certified in Web Services help any?

I would like to mould my career and shift to developing Web Services and would like to take some advice from experts like you folks before taking this step. Is my thinking in the right direction?

I would love to take any of your priced suggestions. I am currently a J2EE developer.

Thanks,
sk
17 years ago
Hi All,

Does anybody know how to suppress the line:

"Added SSL_PROVIDER com.sun.net.ssl.internal.ssl.Provider"

I have decompiled all the classes in jsse.jar, jcert.jar and jnet.jar and I have checked the java.security package and other security related packages also, but I am unable to figure out where this statement is coming from.

I have checked the Security.addProvider(Provider) method also, but there are not System.out statements there and other method calls from this method.

Does it come from the Web Server that we use? If so, which files should I check in the web-server.

In the first place is it possible to suppress this statement?

Thanks a lot,
Sarin
18 years ago
Hi All,

Does anybody know how to suppress the line:

"Added SSL_PROVIDER com.sun.net.ssl.internal.ssl.Provider"

I have decompiled all the classes in jsse.jar, jcert.jar and jnet.jar and I have checked the java.security package and other security related packages also, but I am unable to figure out where this statement is coming from.

I have checked the Security.addProvider(Provider) method also, but there are not System.out statements there and other method calls from this method.

Does it come from the Web Server that we use? If so, which files should I check in the web-server.

In the first place is it possible to suppress this statement?

We are using Sun One Server

Thanks a lot,
sarin
18 years ago
Hi All,

Does anybody know how to suppress the line:

"Added SSL_PROVIDER com.sun.net.ssl.internal.ssl.Provider"

I have decompiled all the classes in jsse.jar, jcert.jar and jnet.jar and I have checked the java.security package and other security related packages also, but I am unable to figure out where this statement is coming from.

I have checked the Security.addProvider(Provider) method also, but there are not System.out statements there and other method calls from this method.

Does it come from the Web Server that we use? If so, which files should I check in the web-server.

In the first place is it possible to suppress this statement?

Thanks a lot,
sbk
18 years ago
Hi All,

Does anybody know how to suppress the line:

"Added SSL_PROVIDER com.sun.net.ssl.internal.ssl.Provider"

I have decompiled all the classes in jsse.jar, jcert.jar and jnet.jar and I have checked the java.security package and other security related packages also, but I am unable to figure out where this statement is coming from.

I have checked the Security.addProvider(Provider) method also, but there are no System.out statements there and other method calls from this method.

Does it come from the Web Server that we use? If so, which files should I check in the web-server.

In the first place is it possible to suppress this statement?

Thanks a lot,
sbk
18 years ago
Hi All,

Does anybody know how to suppress the line:

"Added SSL_PROVIDER com.sun.net.ssl.internal.ssl.Provider"

I have decompiled all the classes in jsse.jar, jcert.jar and jnet.jar and I have checked the java.security package and other security related packages also, but I am unable to figure out where this statement is coming from.

I have checked the Security.addProvider(Provider) method also, but there are not System.out statements there and other method calls from this method.

Does it come from the Web Server that we use? If so, which files should I check in the web-server.

In the first place is it possible to suppress this statement?

Thanks a lot,
Sarin
18 years ago
Hi All,

Does anybody know how to disable the <BackSpace> key while entering characters at the unix prompt in Solaris? I have a password prompt and while the user enters his password, I want to disable the <BackSpace> key, such that if the user hits <BackSpace> before he/she finishes typing then it should beep a sound and should not work the way it should work.

Is it possible to disable the <BackSpace> key on Solaris using Java API ? If so how?

I need this info very urgently, any sort of help is greatly appreciated.

Thanks,
sbk
19 years ago
Hi all,

I have a program to read a password from a command line input. I also have another program, a Thread to mask the characters while the user enters the password. The problem is that the program works fine, but after entering a few characters if I press the "backspace" key on the keyboard, it displays all the characters entered until then on the next line on the screen except the last character entered. The main goal of the program is to MASK the characters entered by the user. When I use the backspace or "Del" key, I should be able to delete the most recent character entered by the user while keeping all the previously entered characters masked.

Can anyone tell me why this is happening and how to do it? I am using a modification of the code provided by java.sun.com. But the original code is shown below:

The Password Reader class:

import java.io.*;
import java.util.*;

/**
* This class prompts the user for a password and attempts to mask input with "*"
*/

public class PasswordField {

/**
*@param input stream to be used (e.g. System.in)
*@param prompt The prompt to display to the user.
*@return The password as entered by the user.
*/

public static final char[] getPassword(InputStream in, String prompt) throws IOException {
MaskingThread maskingthread = new MaskingThread(prompt);
Thread thread = new Thread(maskingthread);
thread.start();

char[] lineBuffer;
char[] buf;
int i;

buf = lineBuffer = new char[128];

int room = buf.length;
int offset = 0;
int c;

loop: while (true) {
switch (c = in.read()) {
case -1:
case '\n':
break loop;

case '\r':
int c2 = in.read();
if ((c2 != '\n') && (c2 != -1)) {
if (!(in instanceof PushbackInputStream)) {
in = new PushbackInputStream(in);
}
((PushbackInputStream)in).unread(c2);
} else {
break loop;
}

default:
if (--room < 0) {
buf = new char[offset + 128];
room = buf.length - offset - 1;
System.arraycopy(lineBuffer, 0, buf, 0, offset);
Arrays.fill(lineBuffer, ' ');
lineBuffer = buf;
}
buf[offset++] = (char) c;
break;
}
}
maskingthread.stopMasking();
if (offset == 0) {
return null;
}
char[] ret = new char[offset];
System.arraycopy(buf, 0, ret, 0, offset);
Arrays.fill(buf, ' ');
return ret;
}

public static void main(String argv[]) {
char password[] = null;
try {
password = PasswordField.getPassword(System.in, "Enter your password: ");
} catch(IOException ioe) {
ioe.printStackTrace();
}
if(password == null ) {
System.out.println("No password entered");
} else {
System.out.println("The password entered is: "+String.valueOf(password));
}
}

}

____________________________________________________________________________

The Password Masking Thread:

import java.io.*;

/**
* This class attempts to erase characters echoed to the console.
*/

class MaskingThread extends Thread {
private volatile boolean stop;
private char echochar = '*';

/**
*@param prompt The prompt displayed to the user
*/
public MaskingThread(String prompt) {
System.out.print(prompt);
}

/**
* Begin masking until asked to stop.
*/
public void run() {

int priority = Thread.currentThread().getPriority();
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);

try {
stop = true;
while(stop) {
System.out.print("\010" + echochar);
try {
// attempt masking at this rate
Thread.currentThread().sleep(1);
}catch (InterruptedException iex) {
Thread.currentThread().interrupt();
return;
}
}
} finally { // restore the original priority
Thread.currentThread().setPriority(priority);
}
}

/**
* Instruct the thread to stop masking.
*/
public void stopMasking() {
this.stop = false;
}
}
____________________________________________________________________________

The other question is, I want to know the basic difference between a carriage-return and a newline character. Is it actually possible to insert a carriage-return by using any of the keys on the keyboard? And what is the character representing the backspace character? I am not able to capture the backspace if I use '\b'.
____________________________________________________________________________

Thanks a lot,
Awaiting your response,
Sarin
19 years ago
Thanks Edwin, Naing and Bharat. That was a helpful information.

All the best to Naing and Bharat.
Sarin
Hi All,

I have started reading RMH and finished two units in it. Now I have to start with UDDI unit. I would like to know how important this unit is for SCDJWS. What is the weightage for this unit in the exam, like how many questions can one expect to get in the test from UDDI?

I would also like to know to what extent does RMH cover, from SCDJWS examination point of view. For example, does RMH cover the "Security" section of the exam objectives etc.

Most of the objectives listed by Sun for SCDJWS use phrases such as "develop code", "explain", "describe" etc. Do they really expect what these phrases literally mean? I mean it is an objective exam right? So, I thought using such phrases is a bit confusing.

I need your precious comments and suggestions from all you wonderful people, especially those who have already succeeded in the exam.

Thanks and regards,
Sarin
Hi all,

I have a webservice for encrypting a password such as that provided by the method doProcess() in MyClient class below. Currently this method processes a soap message(not shown in the code snippet) containing the plain text password and prints out the encrypted password to the console using "System.out" as shown by method process() in class EncryptionHandler below.

Now, what I want to do is instead of printing the encrypted password to the console, I want to print it out to a file. As you can see method doProcess() takes an "OutputStream" as one of its arguments. Can anyone tell me how to use one of the sub-classes of OutputStream to print out the encrypted password to a file? I am not that familiar with webservices, so I don't know how the class javax.xml.transform.Transformer works in transforming an input into an output. I hope to receive a quick reply from you experts of Java Web Services.

Thank you.

regards,
sbk


import java.io.InputStream;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerException;

import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
public class MyClient
{

public void doProcess(boolean logoff, OutputStream out)
throws ServiceException, SOAPException, IOException, MalformedURLException, TransformerException
{
...
...
...
...
// Here "is" is an InputStream object which is basically a styleSheet
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer(new StreamSource(is));

transformer.transform(new StreamSource(in), new StreamResult(out));
}
}

public class EncryptionHandler
{
public void process()
{
MyClient eclient = new MyClient();
eClient.doProcess(true, System.out);
}
}
19 years ago
Hello Peter,

Thanks for the reply. Can you tell me exactly how to use JNI to invoke Unix Shell scripts? All I have seen is that JNI can be used to invoke C/C++ code, but could not find how to use JNI in conjunction with Shell scripts. Do you have any clue? Currently I have a script which pulls up the 'rwx' permissions of a file, I want to invoke this script from my java program to get things going. Can you suggest anything to fix this one?

BTW, nice pics on your website.

regards,
Sarin
19 years ago
Hi All,

I wanted to know whether Java provides any API to pull up each and every permission associated with a file.

For example: In Unix, a file has 3 sets of permissions as shown below:

<UserPermissions><GroupPermissions><Others'Permissions>

Example: -rwxrwxrwx

r - for read
w - for write
x - for execute

There are some methods provided in java.io.File, such as canRead() and canWrite(), which help in telling whether a file is readable or writable. But I did not find any API which tells whether a file is 'executable'. Also, I presume the methods above pull up the permissions pertaining to the owner of the file, but not for the group and others part of a Unix File's permissions.

Is there a way to pull up the read/write/executable permissions for all the 3 catergories namely, UserPermissions, GroupPermissions and Others'Permissions.

I appreciate your note on this and appreciate your time too.

regards,
sarin
19 years ago
Hi,

Can someone tell me how to send a "HTML formatted" email using com.sun.mail.smtp.SMTPMessage?

There is a setText() method in SMTPMessage class which defaults to the content-type of "plain/text". I want to know whether we can send out emails in HTML format using SMTPMessage class. If so how? Is there a way to set the content-type to HTML?

I need this info very urgently. I would appreciate if anyone can send a quick response to me.

Thanks a million,
regards,
sbk
19 years ago