Help coderanch get a
new server
by contributing to the fundraiser

Dennis Meyer

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

Recent posts by Dennis Meyer

The project really looks very promising. I'll have a deeper look into it. Not exacly what I was asking (thinking in the wrong direction?) but maybe even more useful for some other stuff we have
Thanks very much!

Other hints still welcome for discussion...
15 years ago
I have a JAR that needs to be deployed into a webapp, but will also be used for stand-alone apps as a persitence layer. Since we have two identical systems on two different db servers (only the DB server specific enhancement differs), we need to decide which one to deploy (oracle.jar and mysql.jar). What would be great is to have a single JAR (database.jar) containing both codes, but only one gets loaded. This will not change at ruintime - it must be decided uplon load time.

I've been thinking of a kind of kickstart.jar which dynamically loads one of the jars (mysql.jar or oracle.jar) depending on a property setting. To avoid to load it in before of the other jars I could zip the two JARS into the kickstart.jar and retrieve again as resource and the load it using a custom).

The troubles I force is that I would have to write a customClassLoader which loads the classes into his scope. But: the other apps rely on the classes in oracle.jar (or mysql.jar) but wouldn't get known to it until they would have the same parentclassloader!

Is there a way to write a customClassloader that loads the classes into the parent (or tells the parent where it'll find a specific class)?

Thanks a lot!

PS: Note that the solution would have best design if I could add the database.jar in any lib fiolöder like any other jar and it would decide what to load on it's own. Without any dependencies on classloading orders (like Tomcat endored lib and WEB/INF/lib classloading order)

Thanks a lot for any suggestion!
15 years ago
I'd appreciate a good solution for giving the server app feedback on errors. They usually will popup at the client which is a bad thing for a bigger web application. We experienced that a lot of errors which are pretty hard to find and debug are JS errors. Having a framework giving feedback to the server (maybve via AJAX) would be great.

[ August 26, 2008: Message edited by: Dennis Meyer ]
[ August 26, 2008: Message edited by: Ulf Dittmer ]
I was using the Mootools project for some OO-programming of an OsX like dashboard for a webapp. The most ugly thing is debugging JS. Although one can debug in Firebug and in the MS Script Debugger it is still very frustrating when switching from Java/JSP to JS. Dynamically loaded JS (e.g. for components) is very hard to debug.
I'd be interested in what concepts are out there to have JS modules that will integrate in testing frameworks.

For server side apps it would even be great to have a kind of generic input buffer for JS modules(AspectJ like) to generate a stand alone test case for problems in the live-webapplication. Something like
Webapp -> JS Interface -> JS

[ August 26, 2008: Message edited by: Ulf Dittmer ]
[ August 26, 2008: Message edited by: Dennis Meyer ]
I had a wrong understanding. Use a PaintListener to draw the lines and add it to the Sash. Then every sash.redraw() the PaintListener will also be redrawn. When a different Listener wants to redraw the sash-lines it is best to call sash.redraw() and the loines will also be redrawn. Note that all the lines have to be repaintet every redraw() event.
Have a look at SWT/GC introduction
17 years ago
I have two trees on the left and right side separated by a sash. On the Sash I paint some lines that will show correlated elements in the trees. The listeners and the painting works well. I Use a GC to Draw on the sash. When my data changes, I will recalculate the line positions and draw on a cleared sash. Therfore I call
1) sash.redraw()
2) render links on the sash

The Problem:
The redraw() will not take place immediatly, but after the painting of my lines - I get an empty Sash!!!

Please help!
Thanks!
17 years ago
Hi,

I got the same behaviour in the same scenario. If you did find a solution, please let me know!

THX, Dennis
20 years ago
Hi,

we have an database design problem on mySQL using JBoss. We are using CMP, Autoincrement and InnoDB relationships. The Problem of our design qzestion is the following:
As we use EJB as abstaction layer and tranfer data from client to server by DTO, we have a "dirty flag" that marks our DTO as modified by the client. Then our serverside logic has to create/modify these entities. No problems until here. But when we have related data, it is impossible to create the relationship witout getting the database table id becaouse of the foreign constraint. Threrfore we allowed to insert data with foreign key null which is quite not very nice! Is there any possibility or JBoss mechanism to tell the container to create constrained data objects in one operation including the correct foreign references. So we would not have to do it unsecure in two steps (the foreign key = null way without DB savety or access to the DB layer since object abstaction is not any more given in a elegant form).

Thanks for any reply,
Dennis
Hi,
I got a program using some libraries (jar of course). I want to have a one file jar containing my program and the jar libraries in a lib folder. Can anyone give me an example how I have to do this as the classloader does not find the containing jars?
THX,
Dennis
20 years ago
Hi,
as I'm new in EJB I am not sure how to implement a service best. We want to run a service inside the container. When the application server is starting ist should start that service which is implemented as endless loop (althoug there is no better way to do it).
This service should run certain jobs which are based on session beans.
Is it possible to do that gracefully inside the container? Other suggestions welcome!
THX for all comments,
Dennis
Just have a look at the ORO NetComponents.
http://www.savarese.org/oro/
Now it's a Jakarta Project available under
http://jakarta.apache.org/commons/net/
Look at the API docs. This package has all functionality you are looking for (FTP / Telnet) and even many more if you need to upgrade your program.
A solution only with sun classes is possible but not really recommended as you have to code on basic network layers.
If the package don't fit for your purpose, there are also other FTP API's available. Just google for them.
20 years ago
When you need an FTP API you can look at the oroinc.net.* packages avaiable at jakarta. So you don't need to implement the whole FTP stuff. Also many other protocols are supported.
20 years ago
javascript: x()The PipedStreams are used to syncronize two threads. As I do not couple two independent threads the PipedInputStreams waits for input, but will never get any!!!
Solution:
1) Generate Producer / Consumer Treads and use PipedStreams
2) Generate the whole XML File in Memory and generate onla an Outputstream
As my files are pretty small and the service has to be VERY reliable, I now use solution 2.
Hope this will help anybody in the future
20 years ago
I forgot to say that the variables for the FTP commands (e.g. ftpServer) are Strings and should not be the problem as I can establish a connection without problem. It looks like the Streams cause this problem.
THX, Dennis
20 years ago
Hi,
maybe you're right. I do mean a lockup like you already mentioned. The program just stops at that point. Here is tho whole code:
private boolean ftpUpload(Document doc){
System.out.println("start FTP Upload");
boolean ok = true;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp.connect(ftpServer);
reply = ftp.getReplyCode();
if(!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
System.err.println("FTP server refused connection.");
}
else{
System.out.println("Connection established");
//dfUpload... is a SimpleDateFormat
String fileName = ftpFileName + dfUploadFile.format(new java.util.Date()) + ".xml";
ftp.setFileType(FTP.BINARY_FILE_TYPE);
XMLOutputter xmlBuilder = new XMLOutputter(indent, newlines, encoding);
PipedInputStream pin = new PipedInputStream();
PipedOutputStream pout = new PipedOutputStream(pin);
BufferedOutputStream os = new BufferedOutputStream(pout);
ftp.storeFile("remote", pin);
xmlBuilder.output(doc, os);
os.flush();
if(!ftp.completePendingCommand()) {
System.err.println("File transfer failed.");
}
ftp.logout();
ftp.disconnect();
}
} catch(IOException e) {
if(ftp.isConnected()) {
try {
ftp.disconnect();
} catch(IOException ex) {
// do nothing
}
}
System.err.println("Could not connect to server.");
e.printStackTrace();
}
System.out.println("end FTP upload");
return ok;
}
20 years ago