batuk chatuk

Greenhorn
+ Follow
since Dec 29, 2006
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 batuk chatuk

Ohh.. so can I make some change in the configuration of log4j itself sothat i dont get these??? or is this default implementation of log4j??
14 years ago
Hi,

I am using an applet which downloads jar files to the client machine cache. in those jar files I have log4j-1.2.7.jar and commons-logging.jar... log4j will be used to show only "ERROR" on client console.. but when my applet loads first time in the browser, it makes call to server for below mentioned classes which are not available in log4j jar.. i dont understand from where this call is made and how can I remove it..


HEAD http://test.server.com/upload/log4j.xml 404 Not Found
HEAD http://test.server.com/upload/log4j.xml404 Not Found
HEAD http://test.server.com/upload/log4j.properties404 Not Found
HEAD http://test.server.com/upload/log4j.properties404 Not Found
GET http://test.server.com/upload/org/apache/log4j/ConsoleAppenderBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/ConsoleAppenderBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/WriterAppenderBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/WriterAppenderBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/AppenderSkeletonBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/AppenderSkeletonBeanInfo.class 404 Not Found
GET http://test.server.com/upload/java/lang/ObjectBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/PatternLayoutBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/PatternLayoutBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/LayoutBeanInfo.class 404 Not Found
GET http://test.server.com/upload/org/apache/log4j/LayoutBeanInfo.class 404 Not Found
GET http://test.server.com/upload/commons-logging.properties 404 Not Found
GET http://test.server.com/upload/META-INF/services/org.apache.commons.logging.LogFactory 404 Not Found

Also this happens again when i close the browser and start again...

i think it may have something to do with the log4j.conf file which is like below...
:::::::::::::::
log4j.logger.com.asite = ERROR,stdout,R

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d [%t] %-5p - %m%n0
log4j.logger.AssemblyLine.myAL=ERROR, CONSOLE
log4j.logger.EventHandler.myEH=ERROR, CONSOLE
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%5p [%t] (%C:%L) - %m%n
log4j.appender.R.Target=System.err
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.rootCategory=ERROR, stdout ,R
log4j.appender.stdout.Threshold=ERROR
log4j.appender.CONSOLE.Threshold=ERROR

log4j.logger.com.elink.jbe=ERROR,stdout,R

:::::::::::::::::::::

can anyone give some idea...

thanks..

[ December 19, 2007: Message edited by: batuk chatuk ]

[ December 19, 2007: Message edited by: batuk chatuk ]
[ December 21, 2007: Message edited by: batuk chatuk ]
14 years ago
Yes.. I can use JSSE directly. but then i decided to go with the StrictSSLProtocolSocketFactory implementation from Apache. I could run the app with this. I dowwnloaded the source and put the contrib package in my classpath and got it working.

But the problem is that in commons-httpclient.jar they dont provide this class (I checked all the versions) and I want to have the jar from the trusted source. So there should be a different jar for the contrib package of this class.

does anyone know from where can I find that jar?? I guess Apache should be providing that.

thnks
I m trying to implement SSL for HTTPClient(a desktop app that talks with the server. Server is configured to handle https request)

I found 3 ways of doing this but i m not getting how to implement them. Like how can we get a security prompt on a desktop app ???(no browser involved..)

heres the link .. http://commons.apache.org/httpclient/sslguide.html

The call i make from HTTPClient is like this...

PostMethod postMethod = getPostMethodObject("http:/abc/mycontroller");

postMethod.addParameter("userId", userNameText);
postMethod.addParameter("orgId", orgIdText);
postMethod.addParameter("password", passwordText);
postMethod.addParameter("isContinue", isContinue);
HttpClient httpClient = new HttpClient();
int status = httpClient.executeMethod(postMethod);

how can i mae all such requests to https???

Please help.
Thanks
Hi i am using Castor 0.9.5 to convert ArrayLists of objects into XML and writing that into a file.

Because of large number of data i decided to split the arraylists and convert them with castor(XMLConverter.convert() was not working for large data ) and write in file in chunks..

But because of multiple times conversion "<?xml version="1.0" encoding="ISO-8859-1"?><array-list> " String comes in all chunks which i cant have in the file more than once....

Is there a way out of this?? i m stuck and need a help...

regards
For 100K records or more the above code didnt work on my machine.. ( i had kept JVM Heap size to Max. 1300K.. )
The reason was the XMLConverter was not able to convert that much data into XML So i wrote the code to divide all the ArrayLists in chunks and then convert them and write them into the same file..

FileWriter fw = new FileWriter(new File("foo.xml , true);

the flag in the constructor is for Appending the new data to same file..
and so file can be generated without any trouble..

Best Regards
14 years ago
Its Done!!!

File writing is happening totally with all data at a time in above code..
So this is the answer to better and memory friendly code...

xmlSource = xmlConverter.convert(obj);
BufferedReader bufferedReader = new BufferedReader(xmlSource.getReader());
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(f)));
int count = 0;
int buffer=1024;
char[] c1=new char[buffer];
while((count = bufferedReader.read(c1, 0, buffer)) != -1){
pw.write(c1, 0, count);
}
pw.flush();
pw.close();
14 years ago
to test the application we are first of all keeping a dummy XML which will have output parameters as per given input for a specific function.

Now we call that function with same input paras and then take the output object. This object is matched with the Unmarshalled Object of the dummy XML.

So this will be a testcase for our application and if Objects dont match it will return False.. This way all functions of particular class can be tested and any changes that affect the functional part will be easily detected...

Thanks.
thanks!!!

File f = new File("foo.xml");
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(f)));
pw.write(xmlConverter.getXML(obj));

Using BW does speed up the process by almost 40%, although the PC remains in a numb state during that time..but it does work..

I m afraid this solution is not gonna be enough as there are around 100k entries on Production env at max.. ( I checked above sol. on 50000 records..)

Is there any possibility that i split the records and then in chunks i add them in "same file". (dont want to create more than 1 XML for one page..)

Thanks again...
14 years ago
I am converting an object (ArrayList) in XML and then storing that XML as a file on local machine. When there are large number of data, the XML takes too long to write in a File or doesnt write at all (gives some exception).

xmlSource = xmlConverter.convert(object); // object here is no.of ArrayLists..

FileWriter fw = new FileWriter(f);
fw.write(xmlConverter.getXML());

fw.write() takes too much time. Is there any other way which doesnt eat up so much memory ???
14 years ago
I am writing JUnit testcases for my application. In the application there are complex VOs (Value objects) and TO objects which have arrayLists.Now i create an dummy XML from the dummy data, unmarshall it to create dummy object and then Compare it to the above actual object.

For comparing simple objects which have primitive types (int,String,..) i can unmarshall the dummy XML to object and compare it. (with reflection API)
Same thing i am not able to do when there are Arraylists and arraylists within arraylists in an object.. When I try to unmarshall that, i dont get the converted object in proper format.

Is there any way I can unmarshal complex objects with 3 to 4 hierarchies so I can compare them and test???
I am writing the JUnit testcases for my application. In the application there are complex VOs (Value objects) and TO objects which have arrayLists.Now i create an dummy XML from the dummy data, unmarshall it to create dummy object and then Compare it to the above actual object.

For comparing simple objects which have primitive types i can unmarshall the dummy XML to object and compare it. (with refletion API)
Same thing i am not able to do when there are Arraylists and arraylists within arraylists in an object.. When I try to unmarshall that, i dont get the converted object in proper format.

Is there any way I can unmarshal complex objects with 3 to 4 hierarchies so I can compare them and test???