Colm Dickson

Ranch Hand
+ Follow
since Apr 04, 2009
Merit badge: grant badges
For More
N.Ireland
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Colm Dickson

Hi all.

I have a standalone Java websocket client that connects to a server and processes the messages returned. This is using the Tyrus-standalone-client 1.13.jar. I have 2 test endpoints. One which is a simple connection and another which requires an api key to be added in the before request method when the connection is established. Both these work standalone. When I deploy to Weblogic however, only the simple connect that does not require an api key , works. The other one fails with a deployment exception : "The HTTP request to initiate the the websocket connection failed"

So I know the handshake works for both connections in my standalone class but why would only one of them work in the Weblogic deployment? Has anyone seen this before?

I'm running Weblogic 12.1.3.

The error stack is as follows

8 years ago
Hi all.

I have a websocket java client connecting to a server to read back the messages from that server. The onMessage method does appear to be obtaining the messages from the server but I noticed an issue when I added further code within the same method. In my case I wanted to log the messages to a database but noticed the database code was not being executed. I removed the database code and put in some println debug and found out that they were not always being executed or that some were but others were not.I also added a for loop which too should complete but stops before the end at differing points, I have the onError and onClose methods implemented and they are not being fired by any error or socket closure. I have included the client code below. Has anyone else encountered this? I'm running jdk 7 and I'm really puzzled by this.
thanks.


Hi .

Thanks for replying. I have included some of my test class below as a sample.

I can connect to a local websocket running on my machine using thsi test class (and replacing the URI of course) but I have a requirement to connect to another websocket which requires SSL.
I don't know what I have to do in order to do this so I only have my attempt below in the "this.config= section". I don't know what approach to take using the standard javax.websocket api. I hope someone can point me in the right direction.

Thanks.
C

Hi all.

I have been trying to find out exactly how I can set up a configurator instance to tell the client end point that I wish to connect using SSL.

I think I have to set the properties with a Map of type String, ArrayList<String> but I am struggling knowing what exactly to pass when it comes to SSL.


Does anyone know or have an example of this?

Thanks,

C.
Hi. Thanks for replying. Well I would have preferred a binary download but apache have released recent versions up to a 3.0 (as of 2013) now but have stopped the binary downloads so I'm stuck with the source which they recommend for new projects. I thought too it was a missing semi colon from some source file but who knows where! I will however try with a lower version of maven to see what the outcome is.

If anyone else has recent experience of this please let me know.

Thanks, Colm.
Hello all,

I am starting out the Apache cocoon which I'd like to use for document processing but I'm having a real problem trying to get the 'your first cocoon application using maven2' working on my windows machine from the Apache cocoon website. (cocoon.apache.org/2.2/1159_1_1.html)

I have maven installed, which I am also new to and it works when I run 'mvn --version' to verify that it is installed.




So I have a directory called C:\cocoon and as per the instructions, I have ran the following command from this directory


I have chosen option 2 as per the guide and the defaults as shown below

Define value for groupId: : com.mycompany
Define value for artifactId: : myBlock1
Define value for version: 1.0-SNAPSHOT: : 1.0.0
Define value for package: : com.mycompany.myBlock1

After this has completed , I move into the myBlock1 folder and try to run the mvn jetty:run command which fails with the error 'Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project myBlock1:Compilation failure


I cannot get to the bottom of this. I hope someone else has met this and has been able to get an answer to this. I'm using jdk1.6.0_24 but I have also met the same error on 1.7

Hope you can help

Thanks,

Colm
Hi all.

I'm reading blob data from a stored database blob and I'm dumping it out to a file. The blob could be anything but in this case it contains text. I noticed that when I create the file on disk it appears to read itself again so that I end up with a file that has the original content and then some more of the original content appended onto the end of it as if it has started to dump the content out a second time.

I played about with the buffer size starting from 255 which I started with and as I reduced the buffer size I noticed that i was getting less repetition. Eventually , when I lowered it down to a size of 5, the output was perfect with no repetition.

Can anyone explain why this is and what, in general, I need to set the buffer to?

The snippet below is what I used originally which gives me the problem.



When I change the array size to 5 as in

The output is fine.

Any ideas?

Thanks,

Colm
11 years ago
Hi and thanks for replying.

I see what you mean now. My understanding of the question made me think it was 'order by first name, last name' much in the same way a select from database would return if ordered that way(which happens to be the way the natural sort from arraylist occurs) . So , what it's asking for is two results, the original list sorted two ways, first by first name and then by last name as in your example?

Thanks again.

C
11 years ago
Hi all.

My query is not on how this is achieved but on the ordering of the names.
Using the Collections class alone ordering can be achieved as I would expect (by first and then last name) though I know a more involved approach is required.
So given the names list, can someone leave an brief example of what the resultant list should be like? I'm now confused in thinking that the ordering is different to how I perceive it to be?
Are the surnames supposed to be incorporated with the first names so that there is one list ordered be it a first name or surname.

A sample of the desired output (not the code!) will send me on my way again!

Thanks

C
11 years ago
Hello.

Just a suggestion which may be of no use to you but on occasion I have wanted to use Java to to check and see what applications and process were running on my system and I was able to use the Runtime class and the exec method to execute a comand to return a list of the running processes and then read the stream returned to see if what I was looking for existed. if it wasn't there, I could then say it was not running and show a message/create an email alert/log the error....

12 years ago
Hello again.

I managed to find a way to do this after much searching. I used a <fo:marker/> embedded within the template where I needed to get my data from. In this I could build up my formatted block containing the details I needed and these details changed as the data in the template was processed. You define the marker and give it a name using

then wherever you want to retrieve the marker in the document you call

In my case, I called this in my static content on the xsl-region-end
e.g.


I hope this is of some use to anyone else requiring the same although if other methds exist please let me know.
Hello all.

I have a problem with an xsl translation to create an FO file for pdf conversion. The body of my document is a table that loops over transaction records and it works and outputs fine. My real problem is that I want a summary block in the xsl-region-end part of the page(top right).This is static for every page but my issue is that the summary depends on content in the body. For example, balance one has its transactions displayed in the table and then I move to a new page and show transaction for the next balance name also in the table but i want my summary to change at the top summarising the transactions on the balance that the table in the body is processing. Is there any way for me to do this?

Thanks,

Colm
Thanks Tim,

I'll have a look.

Regards,

Colm
Hi all.
I am using apache fop on a linux server, using the command line to convert my xml to pdf using my xsl file which I wrote using an xml editor. Can anyone point me in the direction of where to start if I want to add a security certificate to my pdf so that anyone reading knows it is from a trusted source? Will I have to use a java program to transform and create the pdf rather that the fop command line in order to do this? Also, I'm interested in embedding a bardcode in the pdf too. If anyone has suggestions or links or how to do this using my current method or if I have to approach it a different way then I'd be glad to hear from you.

Thanks,
Colm