Vijaishanker bala

Ranch Hand
+ Follow
since Sep 08, 2005
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 Vijaishanker bala

Hi,

In my application, I have extended the com.sun.xml.ws.transport.http.client.HttpTransportPipe (that Jax WS uses by default) to provide a custom TransportPipe which uses apache HttpClient internally as transport. i.e. to process send the WS request and receive the WS response. I have also written an extension to the com.sun.xml.ws.api.pipe.TransportTubeFactory to create and provide my custom TransportPipe. This is being loaded by java's ServiceLoader mechanism, i.e. providing a META-INF/services/fullyqualifiedclassname file which contains the implementation I want to use. 7 out of 10 times, my custom TransportTubeFactory is loaded but the other times, the default TransportTubeFactory is being used. Is there any way to force loading of my custom transport, all the time.

thanks,

vijai
13 years ago
Hi all,

I am trying to encode a String with the content, "Gratulerer! Du har n \u00e5" into norwegian, the \u00e5 which should be replaced by a "å" . I have tried the following,

public static String doEncode(String text) throws IOException{
return new String(text.getBytes(),"ISO-8859-1");
}


public static String doEncode(String text) throws IOException{
CharsetEncoder charSetEncode = Charset.forName("ISO-8859-1").newEncoder();
charSetEncode.reset();
ByteBuffer buffer = ByteBuffer.allocate(text.length());
charSetEncode.encode(CharBuffer.wrap(text.toCharArray()), buffer, true);
return new String(buffer.array());
}

both the above methods return the following, "Gratulerer! Du har n å"

If i replaced ISO-8859-1 with UTF8, I get "Gratulerer! Du har n å"

I run the program with a -Dfile.encoding=UTF8, jvm option so as to emulate the default encoding of glassfish. if the same option were set to use ISO8859_1, i get the expected behavior, but since UTF8 is a superset of ISO8859_1, I was hoping to get the same result. I am not permitted to change the encoding of glassfish, since certain other things on the UI get falsely displayed.

thanks,

vijai
14 years ago
Hi all,
I am using Woodstock 4.1.1 components directly in my webapp deployed on Sun App Server 9.1. I am generating a woodstock table component, wherein the javascript tags are generated for the table but on firefox error console I get a "dojo is not defined" error message and hence no table is generated . I double-checked the javascript.properties and it points to the respective dojo libraries in /META-INF. I tried previously with 4.3 and there I got a "webui is not defined". Could someone help me in what could have possibly gone wrong.
thanks,
vijai
15 years ago
JSF
hi,
I am designing a web application in which lies a module which contains an applet which must receive a file stream from a servlet and attach it as an attachment using outlook(COM and jawin stuff). My problem is with the applet receiving the file stream from the servlet. The file stream coming in is either a zip file or a pdf file...I am using the URLConnection to initiate connection from the applet to the servlet...the code that does the connection is as follows

But in the place where I get the servlet's input stream, i.e. my file stream(zip/pdf), I get a class cast Exception...what could be possibly wrong...the servlet if I call from my browser gives me the file...Should I be casting it to something else?

Thanks

Vijai
hi,

In my web application, I need to provide functionality to enable downloading of a file from the server using a servlet. After having provided that functionality by means of the following code,


I now need to display progress/status as to whats happening on the server side. The file being downloaded is a result of a few operations like generating pdfs and merging them. This takes quite some time and until then the client is left in the dark and all he can does is stare at a blank browser window. So as to enrich user experience I wanted to show progress of the files being merged and also the size of the end file that has been downloaded before it finally opens on the browser window, Is this possible and is there any particular pattern to follow.

Thanks

Vijai
17 years ago
Hi,
I dont know if this is the right place to post this problem. I am designing an enterprise search application. In the application, an Indexer process updates/creates an index in the file system and a web service accesses this updated/created index. My problem is when the webservice is querying the index, I am unable to update it which I guess is typical of the producer/consumer problem. What would be the best work-around for this problem,

Thanks

Vijai
17 years ago
I never thought about having MBeans for each printer queue created dynamically, Henry wong, thanks for the suggestion, I tried that and it worked like a charm, each of the attributes being instance variables of the printerQueue object.
Thanks all for your help, I have managed to solve this problem without the use of having to create variables dynamically.

Vijai
17 years ago
thanks Jeroen, but the queue is a seperate object in itself, which extends ArrayList and also has instance variables, one of which holds the total number of jobs that were processed by the queue since startup of that application (or) since creation of that queue, although I get the number of jobs currently in the queue with the <queueName>.size() method.

Vijai
17 years ago
Sorry for having replied so late. The problem so far, I have several printer queues(a data structure that extends ArrayList and has other parameters like a name,the number of jobs processed by that queue and the average processing time for that queue).
These printer queues are maintained in another ArrayList from which printer jobs maintained by each queue is executed by a Thread pool in a round robim fashion.
Using JMX, I have provided functionalities that enable the end user to add printer queues during execution time. In the JMX console, MC4J(name of the console), I have the possibility to plot graphs based on attributes, in this case,the number of jobs processed by that queue and the average processing time for that queue. The attributes accepted by the JMX console are primitive datatypes and arrays of those.
The Problem's kernel:I was thinking about having int variables, like
int CurrentJobs<queueName> = <some value>;
int AvgProcessingTime<queueName> = <some value>;
which keep getting updated and eventually show up in the JMX console as attributes. This is good for a fixed number of queues, but my problem is when the user adds queues dynamically, which means 2 int variables for that <queueName> need to be created, which can be eventually refreshed and shown up on the console.
Hope this description of my problem helps.

Thanks

Vijai
17 years ago
is it possible to create variable names at runtime, for example, I want to create an int variable with name currentSize+<aQueueName> and initialize it to 0.
so the final variable must look like int currentSizeQueueName1=0;

thanks

vijai
17 years ago
thanks for the reply Stan, I will elaborate on the problem I have, it is a print server application. A JMS queues will hold the print jobs coming in. Each of these print jobs have a printer. So I sort the print jobs coming in,according to the printer and put them in BlockingQueues. Now I am allowed to create 'n' threads, say 4 threads, but the number of BlockingQueues may or may not be equal to 4. Now I need to take these jobs from the BlockingQueue and assign it to each of the 4 threads. But when I assign a job from one of the BlockingQueues, then that will be locked, until the previously assigned job is finished by any of the 4 threads.Hope this description would help.

Thanks
Vijai
In my multithreaded application I am having, say for example 4 BlockedQueues and each of these queues are fed indirectly by a JMS Queue. Each of these 4 BlockedQueues will hold objects that implement interface Runnable. Now I want to have 3 WorkerThreads that will take those objects from the BlockedQueues and run it in them. I have searched for a while regarding tutorials or information in this area but in vain. Since I am new to multithreading I would appreciate if anyone could suggest a source of information or a design pattern which can be used for this problem.

Thanks

Vijai
Hi,
Is it possible to pass arguments/parameters through url when calling a servlet.
for example i want to call a servlet with an argument as follows

matrix/servletName/argument1
matrix/servletName/argument2

matrix/servletName is the mapping path to servlet as provided in web.xml and argument1 & argument2 are the values I need to read inside the servlet.Is this possible. I don't want to pass a certain parameter as request parameters and hence looking up if the above were possible. If this were possible how can I read argument1 and argument2 inside the servlet.

Regards from Hamburg

Vijai
17 years ago
Movie:Sin City
Marv(Mickey Rourke):I don't know why and I don't know how. I never even met you before tonight
But you were a friend and more when I needed one
And when I found out who did it
it won't be quick and quiet like it was with you
It'll be loud and nasty. My kind of kill
And when his eyes go dead, the Hell I send him to will seem like Heaven after what I've done to him

I love you Goldie
----------------
Movie:Sin City
Hartigan(Bruce Willis): (Blowing his arm off)I took of his weapons...(Firing a shot between his legs)...Both of them..
17 years ago
Becks(german)
Astra(german)
l�neburger Pilsener(german)
Hamburger Pilsener(german)
Bitburger or something...
Budweiser-Loved this one the most
Guiness(The old man's beer)
The Darker Beer at Oktober Fest(tastes good but expensive for a beer, unless they had gold in it)
Few other Pilseners
Heinekken
Fosters
Tiger beer
Jever
..and the old favourites
Kingfisher
Blackknight
Kalyani
Bullet
Haywards 5000/2000
Marco Polo(not available in chennai,India but 164kms away at Pondy,India)
Zingaro(Dont know what they put into it,coined a phrase, "Zingaro makes bejaro"->in Tamil)
and several other German local beers which I had no patience to read their names...

Cheers...
17 years ago