Henrik Engert

Ranch Hand
+ Follow
since Apr 26, 2005
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 Henrik Engert

Thanks!

So it is something that can be done right? Just wanted to post the question so we don't pursue something that is not possible to do.

Again Thanks!
9 years ago
Hi,

We have xml that a client will send to us via a REST service. We would like to digitally sign this xml so we can be certain that it has not been tampered with during transmission. This is what we would like:

1. Client will generate it's own keystore
2. This keystore will then be used in the digital signature of the xml
3. The server side will then validate the signature to make sure no data has been altered.

The question is, is this possible to to it this way?

Any tips on what libraries etc. to use?

Thanks!
9 years ago
Hi,

I have written a small utility to fetch information from tomcat in regards to sessions. The utility will send email if we go above certain thresholds. The problem I have is the number and I can figure out why the numbers show like the show:

This is the explanation about the data taken from jconsole:

Active sessions: Number of sessions at this moment
Total sessions: Total number of sessions created by this manager
Expired sessions: Number of sessions that expired (Does not include explicit invalidations)

These are our number:

Number of active session are: 63
Number of total sessions are: 1357
Number of expired sessions are: 2756

Why are the expired sessions more than the total sessions?

Any ideas?

We are running 2 app servers with a load balancer.
12 years ago
Hi,

I just wonder if anyone knows of any companies in the Austin Texas area that does Swing development?

Thanks
15 years ago
Thanks. I am exhausted right now. My brain is pounding....and it's not from the beer I am holding...
Hi,

Just wanted to let everyone know that I passed the SCWCD test with a score of 71%. Though the score is probably not that great, I am satisfied with the score, and I could not have done better with the amount of studying I have done.

First of all. I had no prior experience with Servlets and JSP. I am however an experienced AWT/Swing/Java developer.

This is how I prepared for the exam:

1. I spent about 2 hours per day for around 4 weeks. I intensed the studying the closer I got to the test, and the last few days I studied around 4 hours per day.
2. I read the Head First Servlets and JSP book. This is a great book that has tons of information. I read that book about 3 times.
3. I read Marc Peabody's notes on J2EE patterns. Thank you for those notes. I scored 100% on J2EE patterns just like his notes said!!
4. I took the HFSJ books mock exam. I only score 35/69 there which made me realize I needed to study some more...This was one week before the exam. I did not take any other practice exams.

I did not do anything else other than this.

Now I am going to get a pizza and drink som beer and strong cider to celebrate.

Take care!

/Henrik Engert
That worked a little bit better. It actually inserted the values correctly.

But now I can't select the Pilots radio.

I thought it would handle the following call for me:



When I look at the tables in DBVisualizer I don't see any connection between the Pilto table and the Radio table. No id refers to the Radio table at all.

The pilot mapping xml now has the following line of code:



and the Radio mapping xml now has the following line of code:



Any ideas?

Thanks.
I have based my code from the "Beginning Hibernate (Apress)" book.

If one object contains another object (one-to-one relationship) should Hibernate handle the inserts into both tables?
Hi,

I am creating a small application for myself and I am trying to insert a Radio object into the database through the Pilot Object. It is a one-to-one relationship. It seems to insert the data, since I can list the pilots and their radios after insert. But if I run the app again the pilots don't have any Radios, they are NULL. I use PilotDAO to insert data like this:



I use Derby database. The pilots stick to the tables but not the radios.

I have the following:

POJO's:

Person:



Pilot:



Radio:



Hibernate mapping:






[ February 14, 2007: Message edited by: Henrik Engert ]
I am able to load one image at a time IF I know the image name, which comes from a database. But I would like to load them all once and for all.

I would like to load the images just like you list what files are in a directory, but these are in a JAR file....

Anybody else have an idea?
15 years ago
Hi,

I was wondering if there is an easy way to load images from a JAR file?

For example if the images are located in the following package:

com/foo/images

Inside images there are say 20 images, but there could be more.

How can I loop through these images in an easy way?
15 years ago
Hi,

We have an application where the user uses a receipt printer which has rolls of paper. They also have regular printers attached to the PC. The standard printer is NOT the receipt printer.

If the above scenario is true and the user selects to print a receipt with the receipt printer the standard paper that is chosen is A4 and not the standard rollsize of 80 x 297 mm from the receipt printer. Therefore the printing is all messed up, stuff ends up outside the paper. BUT if the user sets it's receipt printer as the standard printer everything works fine, it choses 80 x 297 mm.

When the printDialog appears the user can select 80 x 297 mm and then it works, or else A4 is preselected (if the regular printer is standard for example inkjet or laser).

This is the code we use:



Any clues why it behaves like this?

[ February 08, 2007: Message edited by: Henrik Engert ]
[ February 09, 2007: Message edited by: Henrik Engert ]
15 years ago
Thanks.

I did suspect that I was running in memory only, but I thought as soon as I added the "file" in the hibernate.cfg.xml file that it would actually write the data to file.

I am new to all this with Hibernate. I really don't want to use MySQL for my ultra small application that I am trying do write. But I must say that MySQL is far easier to maintain.

I did get Hibernate to work with Derby instead.

Thanks again.
[ February 07, 2007: Message edited by: Henrik Engert ]
Solved the problem with this line:

Query q = getSession().createQuery("from Pilot where id = :id");

Changed from PILOT to Pilot.....

BUT, why does the data not persist in the database when I restart the application? If you start the app again with a SELECT (Query q = getSession().createQuery("from Pilot where id = :id") then the data is not there?!
Hi,

I am using Hibernate 3 with HSQLDB.

I have the following Java Bean:



Mapping file looks like this:



Hibernate configuration looks like this:



I then use a DAO to insert and retreive data. The insert seems to work since I do get back an id of the row inserterted into the PILOT table. But once I try to retrieve the inserted row I get the follwing error:

java.lang.Exception: PILOT is not mapped [from PILOT where id = :id]

It's like the tables are not created.

Can anybody help me?

Thanks.
[ February 06, 2007: Message edited by: Henrik Engert ]