Bojan Tomic

Greenhorn
+ Follow
since Apr 08, 2008
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 Bojan Tomic

I was just looking into the exact same issue.
Here's the preferred solution: http://dev.mysql.com/doc/refman/4.1/en/connector-j-usagenotes-basic.html#connector-j-examples-autoincrement-getgeneratedkeys

In short:
What do you mean "JSP table"? Are you talking about a html element called <table>?
In that case, there's nothing JSP specific. If you know how to parse html in C#, that's it.
If you were talking about JSP outputting something that can be readily imported into Excel, well, that's doable too, but you'd have to know the format. If csv is enough, go with that.
If you need real Excel export, look at Seam, it has excel export freature:
http://myjavaroom.blogspot.com/2009/10/microsoft-excel-spreadsheet-in-jboss.html
http://myjavaroom.blogspot.com/2009/12/jboss-seam-excel-implementation-part-2.html
Looking further into that would be waaay beyond this topic and forum.
I don't completely understand what you're doing, but in order for two distinct JVMs (as I reckon you have) to operate on the same component, that component should be somehow exposed. Through an EJB, RESTful interface or anything really, as long both apps can see it and use it... You can't directly just share an object between JVMs.... well, you probably can, but that's hardly what you need here... I guess.

Joe Harry wrote:Google Guice and what else?


CDI, the new standard perhaps? That's talking DI.
7 years ago
Is it possible to customize the SQL used for fetching relationship fields?

To exemplify:
User U1 has friends U2 and U3,. This automatically means users U2 and U3 are friends with U1, as this is a reflexive relationship. The join table looks like this: (userId1, userId2, date). The catch here is that I don't want two different rows for every relation in the join table, but still be able to have a list of friends in the user entity. To make this happen, I need the order in which the IDs appear in the join table irrelevant.
That why I'm asking if I can modify the SQL used for fetching the relationship fields - I could make it look for the current user's id in both the first and the second column in the join table when populating the list of his friends.

I hope I was clear enough... Any thoughts on this? I could really use an advice...

Thanks a lot!
Thanks you both for the advices. In the end, it turned out to be a classloading issue. I removed the DB drivers from the app package, put the JAR into server/default/lib only, restared JBoss and it works fine.

Thanks you again for your time.
10 years ago
Hi.

I'm having a problem deploying my web application (.war) to JBoss 5.0.1. Previously, it was running on Tomcat 6.

Since I was depending on a pooled DataSource, in order to migrate to JBoss, I added a mysql-ds.xml to 'deploy' directory and added jboss-web.xml to WEB-INF.
Here's how they look like:

mysql-ds.xml


web.xml


jboss-web.xml


Deploying mysql-ds.xml returns no erros. It gets bound to the MySqlDS JNDI name. Still, when I attempt to do a


ds is null. Did I misconfigure something? Any idea is welcome...
Just to remind, I'm on JBoss 5.0.1.

Thanks for your time.

[EDIT]
In case it is helpful, here's the original Context.xml that worked under Tomcat:
10 years ago
I haven't fixed it. I'll try your solution.
Thanks for posting it.
10 years ago
Ok, thanks for that.
I'm grateful.
10 years ago
I am going through a book example, and it tells me to type

in order to run my client that will access an EJB running on JBoss on my the local machine.
It works fine, but I was wondering what would I need to change if I was to run this client on a remote machine? How do I tell it where the remote host is? The address in the above command points to JBosses naming provider, I doubt it would be enough to change just that...
[ December 01, 2008: Message edited by: Bojan Tomic ]
10 years ago
I tried this exact same configuration with JDBCRealm, and it works fine, so the error must be in the DataSource configurations, but I still can't discover it.

I hope this helps...
10 years ago
I'm trying to build an access control mechanism for a JSF web application on Tomcat 6. Since I already have a database with users, I was going for a DataSourceRealm.
First, I've created another table called user_roles that has only two columns: useraname and role.
Then, I've added the following rows:



Next, I edited conf/server.xml to contain this:


and I edited my web.xml to contain this:


No exceptions are raised during Tomcat startup. Now, when I try to access the app through http://localhost:8080/Test/, the login dialog pops up but no matter what I type in - nothing happens. usertest/usertest doesn't work.
I tried shuting down MySQL to see if an exception would be raised when I attempt to login, but everything seems the same. So, it must something in my server.xml is wrongly configured but I don't know what.
Please guys, give it a shot. I'd be very, very grateful.
[ November 19, 2008: Message edited by: Veggen Skrikk ]
10 years ago
I have an Eclipse plugin project (a RCP client application) in which I'm using SWT and JFaces for GUI and I'm facing the following problem: when launched from Eclipse, Unicode (UTF8) characters are displayed normally, but if I try to export the project through PDE export and launch that, some characters in the workbench are not displayed properly.
I have already tried using "-dfileencoding=utf8" VM parameter.
Any ideas what could be going wrong?
Ok, thanks a lot for the tip. I'll see what I can do.
Btw. I can't wait for your book to come out. I'm in desperate need of a good JBoss guide.
[ October 17, 2008: Message edited by: Veggen Skrikk ]
10 years ago
Thank you Peter for this answer. Just one more thing, if it's not a problem; where should I place *-ds.xml (inside EAR) for JBoss to find it? Can I do this with WARs as well?

Thanks again for your time.
10 years ago