Ruben Matthews

Greenhorn
+ Follow
since Jan 05, 2009
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ruben Matthews

Jeff Kin wrote:Maybe a bit late; but for anyone else who may have this problem; it turned out i had put a backslash \ at the end on my CATALINA_HOME environment variable (I was using windows). When i removed it, i could start using catalina run command.



Great. This post finally solved my problem. Thanks.
12 years ago
Hi,

I am running into a much discussed error with a one-to-one mapping, but I just can't getting fixed! I keep running into the following error:

Exception in thread "main" org.hibernate.id.IdentifierGenerationException: attempted to assign id from null one-to-one property [nl.xx.yy.zz.model.UserSession.user]

I am trying to tie a UserSession to an AbstractUser in a one-to-one relationship using a foreign key association.

This is the mapping for the AbstractUser:



This is the mapping for the UserSession:



And this is the code I use:



This throws the "attempted to assign id from null one-to-one property" error. Do you know why and how to solve this? The problem occurs on the session.update(user). All the surrounding code works fine.

Also, when I use session.save() instead of session.update, Hibernate tries to insert a new AbstractUser record with the same id, resulting in a PK constraint failure. Why is Hibernate tryuing to insert a new record instead of just updating the existing one?
Hello

What would be the best way to map the following many-to-many situation?

I want to map User (userId, username, password, firstname, lastname, roles)

to

Role (roleId, name)

A role is really just a name and the system contains 4 roles (admin, user, etc). Each User can have one or more roles, and each Role can be assigned to one or more Users. These roles never change, so what I need in the database is a USER table with user data and a ROLE table with just 4 records that never change and an association table between them.

Is there a way to specify the roles in a HBM mapping, kinda like an Enum?

OMG. The Netherlands is playing against Brazil, so thanks in advance for your responses, I'll read them in a couple of hours.
Hah! I may have once again answered my own question right after I posted it. I guess the companyValues mapping was wrong and that I must use a <index-many-to-many> tag with a class attribute instead of the plain <index> tag?

Hello,

I have a Company entity which has a Map property called "companyValues".

private Map<Competence, Integer> companyValues;

The companyValues property uses a Competence entity as its key. Competence is another mapped entity in the system.

Could you explain how I would create this mapping in the Company mapping?

This is the Competence, which is just an id and a name for now.


And this is the Company with the companyValues mapping.




Is the companyValues property in the Company mapping correct like this? Or will this result in an <Integer, Integer> Map? I mean, will Hibernate understand that I need the entire Competence object as the key and return a <Competence, Integer> Map or will it return a <Integer, Integer> Map with the COMPETENCE_ID as the first integer?

Thanks!
Hi!

I am creating a content repository system in Java that should be able to serve either web or desktop applications. And now I want to create some kind of session management, but I can't use cookies, since the system is not strictly for use in a web environment. How would you retain session (credentials/login) information in this situation? Should I store sessions myself in a db? And if so, how would I retain the link between the stored session and the client?

Thanks
14 years ago
I just talked to our network admin and he explained to me it is caused by the fact that the application (tomcat) is not going through the proxy. Problem is solved.
15 years ago
Hello Java friends

I have a problem where an application I am working on is throwing the following exception "java.net.ConnectException: Connection timed out" after trying to connect() to a URI.



This small test case outputs

YEEEEHAAAAH
test1

and then stalls....



I tried to "wget" the url from the box the application is running on and that works fine. It returns 200 OK. So, the url is accessible, but still connect() times out.

Any clue why?
15 years ago

Joe Ess wrote:The key to beating google is choose a niche that google doesn't occupy or doesn't fill very well. For example, thumb-twiddling. Google doesn't have thumbs. I do. Can you see me google! I'm twiddling! You can't stop me! Ahahahahaha!






I see absolutely no sign of Google's ultra-powers wearing off. Microsoft's Live search is nowhere near as popular as Google, the Yahoo Publisher Network is nowhere as popular as Google Adsense. Google have a huge array of online applications. Google are preparing for cloud computing... They are on top of everything. Google IS the internet nowadays.
15 years ago
Hi Eric. I got Firebug, but I don't know how to set these breakpoint in the included Javascript. I usually just use "alert" boxes to show me variable values.

From what I understand is that the content of the left frame is set by


in general.js. The value of 'frame' is 'left_frame' and the value of 'page' depends on the link that was clicked. This is all OK. I just don't understand why the 'page' disappears from the 'left_frame' in Firefox.
Hello,

I have a problem where a certain menu doesn't get loaded in Firefox, while it is loaded in IE.

If you click on one of the links on the left part of the page at www.beroepenbeeldbank.nl the menu will appear for a very short time and then disappear again in FF, while in IE it stays there like it should.

I used Chrome's Javascript debugger to review the issue and it says two things:

Uncaught ReferenceError: Window is not defined - stylemorpher.js:13

I can't find a reference to Window on line 13 however.

Would you know why this is happening in Firefox?

Thanks in advance, Ruben


The problem was the Tomcat version. Tomcat 5.5 couldn't find the TLD, but Tomcat 4.1.7 (on which the site is currently hosted in the live environment) can.

thanks
15 years ago
Hi,

When I open index.jsp in a browser Tomcat (5.5.27 on Debian) says

org.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "META-INF/taglib.tld" from JAR file "file:/usr/local/tomcat/webapps/bbbank/WEB-INF/lib/mmbase-taglib.jar":



But it's there! The JAR called mmbase-taglib.jar is there and it contains a META-INF with the taglib.tld file in it. Any clue why Tomcat says it can't find it?
15 years ago
Hi,

I get a 403 when I try to login to the Tomcat Manager app on Tomcat 5.5. I have taken the following steps.

1. Install the actual application
2. Added TOMCAT5_SECURITY=no to the startup script (this is a testing environment)
2. Changed tomcat-users.xml to create a user with the manager role.
3. changed admin.xml by uncommenting the following line:



I am out of options. Do you have any idea why I can't login to the Tomcat Manager? The tomcat default page works...

This is my tomcat-users.xml file




THANKS for your help
15 years ago
Hey Joe I see it's possible to split ZIP files with the Winzip interface, but I am not sure there is a command line argument for splitting files. I'm still looking into that. Using Winzip however, would make my program rely on Winzip, right? I prefer avoiding that.

Your suggestion did direct me to a different possible solution. Perhaps I could use Java to ZIP the entire contents of the folder and then use Java to split the ZIP file myself? Or is that for rocket scientists? I am not really familiar with the internals of files. Would it be possible to use Java to do something like this:

1. Read contents of directory and create ZIP (possible)
2. Open the file again in Java, but not with the ZIP API.
3. Read the file, and while reading, split the file into smaller bits of X Mb and save them (along with some code that defines the order)
15 years ago