Liz Costelloe

Greenhorn
+ Follow
since Nov 01, 2003
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 Liz Costelloe

Hi,

Thanks for your responses. Problem solved, I've put the DLL in the system32 folder for the moment and it's loading with no problems now.

I'll look into setting java.library.path now that I know the DLL works and isn't the source of the problem.

Many thanks, very grateful.
14 years ago
Hi,

I'm trying to link an applet to a Fortran DLL through a servlet using JNI. Originally I tried to directly communicate between the Applet and Fortran however security permissions were blocking the communication. The sun tutorial on Applets does mention that applets can't do this.

So I've introduced a Servlet to allow the Applet and Fortran to communicate. My problem at the moment is that I get the following error when I try to load the dll to the Servlet:

java.lang.UnsatisfiedLinkError: no fortran.dll in java.library.path

I'm using the following command to load the DLL

System.loadLibrary("fortran.dll");

I've tried replacing fortran.dll with

http://aserver:8080/structures/fortran.dll

I've also tried editing system.library.path to include the address of the server.

I'd very much appreciate any suggestions on this,
Many thanks.
[ June 06, 2006: Message edited by: Liz Costelloe ]
14 years ago
Hi,

Thank you very much for the replies, I'm very relieved that I wasn't heading into a dead-end.

Stan, JNI sounds like it will solve the problem nicely. I'm comfortable with Java and C++ but I'm a noobie to Fortran. The Fortran code belongs to someone else, I'm just offering a helping hand with the Java/Web side of things. Also, thanks for suggesting the alternative, I've used System.runtime.exec() in the past and it didn't occur to me that streams might be another approach to solving this problem - cheers!

Jean-Francois, thanks for the link. Really very helpful, it's concise and answered a lot of questions and problems that I was having, I'm very grateful.

Thanks again to you both!
14 years ago
Hi,

Just wondering could anyone provide me with any information about using Fortran code (a DLL or otherwise) with Java.

I have a Fortran program that performs some heavy-weight calculations using Matrices among other things. I'd like to put a web interface on this using Java.

Could anyone enlighten me as to whether this is possible or not, and if so provide some pointers about how to go about doing this.

I found the following article on-line which gave me hope that this is possible.

http://www.math.ucla.edu/~anderson/JAVAclass/JavaInterface/JavaInterface.html

Many thanks in advance.
14 years ago
Hey Ulf,

Quick line just to say thanks for all your help!! At long last I have this applet and servlet communicating. In the end I got out a TCP viewer and noticed that there were a lot of 'Java' connections stuck waiting for responses so I extended my code like so:



As a result communication was established There were a few errors along the way (Permissions and an EOF error) but now all is working smoothly.

Thanks again for all your help!!
[ May 24, 2006: Message edited by: Liz Costelloe ]
14 years ago
Hi Ulf,

I do think I have the servlet configured to respond to http://an.ip.address:8080/structures/Save. The web.xml file is included below and I am able to invoke the servlet manually through a web browser.

I have tried looking through the web server (JBoss) logs but I'm not sure where the access logs are stored in JBoss. If you happen to know this, I would be grateful if you could point me in the right direction - I will keep looking of course, but it would save me some time.

Many thanks.



[ May 15, 2006: Message edited by: Liz Costelloe ]
14 years ago
Hi Ulf,

Thanks for your reply.


What does this mean - what happens when the code is run? Are there any exceptions?



The applet code executes in full without throwing any errors. On the servlet side nothing happens, the doPost method is not invoked (and no errors occur).


but is the servlet really listening at the URL where the applet is hosted?



Terribly sorry, but I'm not sure exactly what you mean by this, I'm new to applets and servlets.

Yes, the applet and servlet are both hosted on the same server.

The servlet has responded to requests from JSPs but I'm not sure if this answers your question.
14 years ago
Hi,

I'm trying to save some information from an applet to a mySQL database using a Servlet. I can access the Servlet fine from a JSP but I can't get an Applet to connect to the servlet at all.

The code is as follows, any suggestions would be gratefully received.

Thanks in advance.


14 years ago
Hi Ulf,

Apologies for this delay responding. I will bear that in mind that I should be over-riding the paintComponents method, thanks.

Also, to answer your question, I use the init method to create the GUI - I assume this must have some impact so I'll head off and do some reading around this now!

Thanks again.
14 years ago
Hi I'm using a canvas to draw a very simple picture, retangle and a few circles in an Applet. The canvas is in a JPanel, inside a JTabbedPane. When I put the canvas in a JFrame, there is no problem it pops up and all the content is in place. However when I put the same JTabbedPane in a JPanel so it is embedded in a JSP the content does not appear at all.

I've done some debugging and it seems the paint() method for the Canvas is not being invoked at all. I've used repaint(), validate() and paint(canvasInstance.getGraphics()). I think it might be that the Graphics object used in the paint() method is returning null.

I've also tried overwriting the paint method of a JPanel - will this work??

I'd be very grateful for any suggestions/ideas.

Many thanks!

[ April 12, 2006: Message edited by: Liz Costelloe ]

[ April 12, 2006: Message edited by: Liz Costelloe ]
[ April 12, 2006: Message edited by: Liz Costelloe ]
14 years ago
Hi Craig,

Thanks for taking the time to implement that solution, I'm really grateful. It works perfectly, I can't thank you enough.

I tried using your solution without the JFrame so I could embed my applet in the JSP that I'm using, but the Canvas doesn't seem to appear if I do that. Using the JFrame the applet pops out of the page and the canvas appears. I'll figure out if I can embed the applet in the page at a later stage; it's only for asthetics that I want to do this really. The functionality is there now and that is without a doubt my primary concern.

Also I took out the 4th line of class LPTest because the applets security won't let me do this:



Anyway thank you again, I was beginning to get very frustrated, I really appreciate that you took time out to look through this for me.
14 years ago
Hi,

I have an applet, inside which there is a tabbed pane. In the first pane there is a panel, the panel uses GridLayout (1 column, 2 rows). In the top half of this panel is some text areas and a button. In the bottom half I have added a canvas, however the canvas does not appear. Everything else in the applet does appear fine.

Code is listed here, I'd be grateful if anyone has any suggestions as to why the canvas might not be appearing.

Many thanks in advance.



[ April 10, 2006: Message edited by: Liz Costelloe ]

[ April 10, 2006: Message edited by: Liz Costelloe ]
[ April 10, 2006: Message edited by: Liz Costelloe ]
14 years ago
Hi,

I'm trying to provide a page where users can edit existing records from a database. I'm using a series of input & droplists to do this. Ideally I would like the page to open with each droplist displaying the values stored in the database & not just the first value in the list. Does anyone know the code that will do this for me??

Thanks
Thank you - very much appreciated
Hi,
Can anyone tell me is there a way to have a page refresh itself after an item has been selected from a drop down menu (without using a button).
My problem is that I have two drop down menus corresponding to two different tables; for arguments sake say menu1 and menu2 corresponding to table1 and table2 respectively.
When an item is selected from menu1 it refers to a PK in table1. I want the second drop down menu at this point to display all the PKs from table2 that have a FK matching the PK selected in menu1.
Can I get the page to refresh itself automatically to reflect the change? At the moment the only automatic refresh I'm aware of is based on a timer.
All help would be appreciated, thanks,
Liz