Glen Divers

Ranch Hand
+ Follow
since Jan 21, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Glen Divers

Hi

I've successfully implemented a single file download using the Stream result. How do I deal with the situation where I have multiple files to download? I want to allow the user to select a number of files and then download all the chosen files, rather than force the user to select a file, download it, select another file, download it etc etc.

Regards
13 years ago

James Sutherland wrote:Ensure that you have defined "jdbc/pembridge" as a JTA enabled DataSource in Glassfish.



jdbc/pembridge is defined in terms of a connection pool. There doesn't appear to be any other options. The connection pool is defined as a resource type javax.sql.ConnectionPoolDataSource with a datasource classname of com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource.

Glassfish offers alternative resource types of javax.sql.Driver, javax.sql.DataSource and javax.sql.XADataSource. I can't find anything that indicates/mentions JTA.

One odd thing however, Glassfish seems to be creating it's own connection & pool definition. It's created its own connection "pembridge" connnected to pool "mysql_Pembridge_RootPool" which is defined with a resource type of javax.sql.DataSource with a datasource class name of com.mysql.jdbc.jdbc2.optional.MysqlDataSource. If I delete these, they appear to be re-created when I deploy my application, although it never uses this (there's no database userid or password defined for it)

Regards
Thanks for your response, persistance.xml is specifying JTA
Hi

I have two entities, Client and Telephone





and I'm using the Netbeans generated AbstractFacade handle the persistence. My persistence code is;



If I create a new client with a unique telephone number everything works. However, if I create a new client and reuse an existing persisted
telephone number, I get an exception because the phone number already exists in the database as expected, but the new client is still created in the database. I was expecting a rollback and neither client nor telephone to be persisted.

What am I missing/have I done wrong?

Regards
Hi

I'm just starting JEE6 with Glassfish and JSF, and I'm trying to create my first JSR-303 validation. The problem I've got is that despite the fact that everything compiles, the validator class is never called. I've listed the code below. (I know that the validator doesn't make logical sense at the moment, there's more to go in it, I'm just trying to get it to work at the moment.) Can anyone see what I'm doing wrong.

Regards

The annotation;



The validator;


and my backing bean (trimmed);


Hi,

I have a use case, where after the user "logs in" to the application (handled by Spring Security) I need to start a "setup wizard" comprising three views and their associated actions. These must be processed in strict sequence and the user must not be allowed to break out by either typing a URL into the browser or loading a bookmark. Once the "setup wizard" is complete and the user moves into the application proper, (s)he should not be able to re-enter the setup wizard, unless he first logs out & logs in again. I had considered experimenting with the JQuery plugin to see if I could implement this as a series of modal dialogs, but of course I need javascript active at the client for this to work.

This appears to be the realm of either the ScopeInterceptor or the SpringWebflow plugin, but I'm having difficulty in finding tutorials or example code other than that cwiki.apache.org/S2PLUGINS (and the car insurance example mentioned by the SpringWebflow plugin, is not shipped with the download.) to help me decide which of these, if either, I should use. I'd be grateful for any pointers or suggestions.

In addition, since research suggests that it is practically impossible to prevent, I need to be able to handle the situation where, after establishing the session, the user opens multiple browser tabs into my app and runs multiple functions at the same time, for example, starts editing orders for two different customers in two seperate tabs. How do I keep "session data" seperate for the two tabs and stop these actions from walking all over each other.

And my final use case, is that I have one other "activity" that *absolutely must* be a session singleton. That is, it cannot start if the user is running another action, and while it's active, the user cannot start another action. What techniques/patterns is everyone using to handle this?

Regards
13 years ago

harsha uduap wrote:

I have requirement that thread should be running in the tomcat server. the thread should start when the server starts.



You need to take a look at the ServletContextListener.
After more digging, I've found that if I change Java Control Panel -> Network Settings from Use Browser Settings to Direct Connection everything starts woking. My jnlp file works and the Sun demo site works. Would anyone care to explain the difference between these settings so I can get to the root of the problem.

Regards
13 years ago
I've been grappling with trying to get Java Web Start working over the last couple of days. When I run it on a locally installed web-server (Tomcat 6.0.26) my jnlp file works perfectly. As soon as I put it on an external web-server I get "com.sun.deploy.net.FailedDownloadException: Unable to load resource:" errors. While investigating I came across http://java.sun.com/javase/technologies/desktop/javawebstart/demos.html - and I get exactly the same error when I try to run any of these examples. Could someone confirm if this page still works for them or is this a dead page? I haven't found anything that suggests that I need to open holes in firewalls to get WebStart to work.

Regards
13 years ago
Can I "force" web start to create a desktop entry on first download? I've seen tutorials on how to create a shortcut from the Application Cache Viewer but, really, I cannot expect, nor want, my users to have to go through this. I've also seen references in tutorials that web start "may" ask if you want to create a desktop launcher - how is this controlled? Is this feature only enabled via downloads from a web site - I'm currently testing using a local file:// based codebase - would this be the reaon I'm not seeing Web Start ask to create a shortcut?

Regards
13 years ago

Paul Clapham wrote:My suggestion would be to not use that DLL. Even when it hadn't been de-supported by Sun (which I believe happened somewhere around 2002) it was a pain to get it configured correctly. Try using the RXTX version instead.



Well roger me sensless with a ripe pineapple. Changing to the RXTX version solved the java web start loading issue. Back to the unit tests to workout why we rejected RXTX in the first place.

Thanks a million.
13 years ago

Paul Clapham wrote:My suggestion would be to not use that DLL. Even when it hadn't been de-supported by Sun (which I believe happened somewhere around 2002) it was a pain to get it configured correctly. Try using the RXTX version instead.



Without wishing to wander too far off topic, we started with the RXTX version, but reverted to the Sun version when we ran into "undocumented" features of RxTx. It may be worth re-visiting. However coming back to my original point, if I bundle everything, including win32com.dll into an executable jar and download it manually - everything works as it should - the dll is found on the classpath. It's just through JWS that it doesn't find it.

Is it a classloader issue? What is different (if anything) about the way Java Web Start fires up an app and java -jar myWebapp?

Regards
13 years ago
I've managed to get the Java console enabled and set the trace level to 5. This is what I'm getting as my application trys to launch;


The message "Properties file exists" is issued by my application imediately before I try



I've looked in in the c:\JNLP_cache\.... directory and the win32com.dll file is there. So JNLP is downloading the dll, stashing it away. The second lookup is caused when the com\sun\comm\Win32Driver.class has another tilt at loading it.

Any suggestions gratefully received.
13 years ago
If you're looking for a high performance socket framework, you might be interested in JBoss Netty. They have some well worked examples of both HTTP servers and clients.

HTH

Matthew Brown wrote:I've not tried it, but it appears you can do this by including a <nativelib> element in the JNLP file.



Tried that. The relevant part of my jnlp is

I've used the same name as the .dll file is stored/packaged with my class files. My application code does not include directly System.loadLibary() as my app is not directly responsible for loading it. My app, mong other things uses the javax.comm package to read/write data from the serial port and it is these classes that need the dll. As I said earlier, creating a standard executable jar works just fine, the dll is found and loaded, but when I sign the executable jar and load it via web-start the dll isn't loaded.

I've tried adding System.loadLibary("win32comm.dll") and that fails because the system fails to find the dll in the java.library.path - which is true since java.library.path is a set to directories on the hard drives of the client-pc and I do not want to have to install the dll to their hard drives, I want JNLP to load it from my jar file as it does for a normal executable jar.

Sorry if I'm being a bit vague or dense but this is my first foray into Java Web Start.


Regards
13 years ago