comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * loading JAR's from a URL - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5aef841a37c27d9 * Need good free beautifier other than Jalopy - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b4415996c299a7af * exec jars w/dependent jars - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57a120668105cdf7 * Socket problem -- response slow for host with domain (on SunOS5.8) - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfb84c34caf0c9e9 * read binary data from C file??? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c04d04f749f5ae1f * java.util.Timer doesn't work - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/71ef1327ff59774b * cost of unused import statement - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7541f77bd3a07e9e * Simple multiuser java database - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76285f28cb4423bf * Beginner Advice Sought - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b96a0a430a102e22 * how can C program calls Java? Thanks - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/919552d936d443f9 * A Jtidy and XHTML question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/22e06ae99461da6d * Extension problem Mac OS X (launching of external jar doesn't work) - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3dd4b342d0c112d6 * I got the Herbert Schilt, (Java 2) Package blues. Please help before I shoot the dog - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f29e821306447a70 * what's wrong in this program - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7988d20d29a05202 * Application sharing - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7befcbbc82dde970 * help w/ xdoclet entity definition - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/95d618c227db1e79 * Getting something on my resume - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a1e0464adf07366 * how to detect if web app is deployed - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d07e772bf6805e * Need a method for detecting when files are written to a directory - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1293173b48ccf65 ========================================================================== TOPIC: loading JAR's from a URL http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5aef841a37c27d9 ========================================================================== == 1 of 2 == Date: Fri, Sep 24 2004 9:51 am From: "John Keyes" <[EMAIL PROTECTED]> Michael: You need to do some reading up on classloaders. Check out this part of the JNDI Tutorial (http://java.sun.com/products/jndi/tutorial/beyond/misc/classloader.html) which shows how to use URLClassLoader and the Javadoc for URLClassLoader(http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLClassLoader.html). This article (http://www.developer.com/java/other/article.php/2248831) "Java Class Loading: The Basics" is a good read also. == 2 of 2 == Date: Fri, Sep 24 2004 10:12 am From: Andrew Thompson <[EMAIL PROTECTED]> On 24 Sep 2004 08:13:17 -0700, MJK wrote: > I am loading a JAR file from a URL. It loads OK. What I want to do, > is use the classes defined in the JAR file as if they were loaded from > the CLASSPATH. Does anyone know if this is possible? John's suggestion will work, an alternative might be to use JWS to install the app. and the jars for the user. <http://www.physci.org/codes/javafaq.jsp#jws> HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane ========================================================================== TOPIC: Need good free beautifier other than Jalopy http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b4415996c299a7af ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 10:12 am From: Frederic Banaszak <[EMAIL PROTECTED]> On 24 Sep 2004 08:11:24 -0700, [EMAIL PROTECTED] (Tivo Escobar) wrote: >Hi all, > >anybody could recommend a good free java beautifier (code formatter, >pretty printer, etc.) other than Jalopy? > >I am about to run a beautifier over a 150,000 lines app and Jalopy >comes with a bizarre 'feature' that is really frustrating: it is >indenting my anonymous inner classes with an extra 'tab' (4 spaces). > >Thanks in advance, > >Tivo Escobar Have you tried Jacobe? http://www.tiobe.com/jacobe.htm ========================================================================== TOPIC: exec jars w/dependent jars http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57a120668105cdf7 ========================================================================== == 1 of 2 == Date: Fri, Sep 24 2004 10:49 am From: "Will Hartung" <[EMAIL PROTECTED]> "Sudsy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Fritsch wrote: > <snip> > > BTW: I have added the book-mark http://java.sun.com/j2se/1.4.2/docs/ to > > my browser, which is really helpful. ;-) > > A stellar suggestion! I also have > <http://java.sun.com/j2ee/1.4/docs/api/> > When writing Java code, I <em>always</em> have a browser window open > to the javadocs. Even though life is easier with an IDE like Eclipse, > I need to be able to navigate the classes so that I can find methods > in ancestor classes, etc. Since there are sooo many classes, I find > it helpful to be able to browse and locate likely candidates for what > I'm trying to accomplish. I have them downloaded and local on my machine. I just wish there was a process that would integrate the sets of docs. Not combine them into a monolithic Javadoc, but have the J2EE docs aware of the Java docs and classes (so, I could click on java.lang.String in the J2EE docs if I wanted, for example). Regards, Will Hartung ([EMAIL PROTECTED]) == 2 of 2 == Date: Fri, Sep 24 2004 11:03 am From: Andrew Thompson <[EMAIL PROTECTED]> On Fri, 24 Sep 2004 12:23:26 -0400, Sudsy wrote: > Thomas Fritsch wrote: > <snip> >> BTW: I have added the book-mark http://java.sun.com/j2se/1.4.2/docs/ to >> my browser, which is really helpful. ;-) > > A stellar suggestion! I also have > <http://java.sun.com/j2ee/1.4/docs/api/> When the 1.5 main frames index crashed my OS component I bookmarked this.. <http://java.sun.com/j2se/1.5.0/docs/api/overview-summary.html> Then made this.. <http://www.physci.org/api.jsp?class=java.lang.Object> ..handy links for each class. Main page here.. <http://www.physci.org/api.jsp> > When writing Java code, I <em>always</em> have a browser window open > to the javadocs. Just one? I have four open at the moment.. Or does your UA provide advanced functionality such as tabbed browsing. ;-) -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane ========================================================================== TOPIC: Socket problem -- response slow for host with domain (on SunOS5.8) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfb84c34caf0c9e9 ========================================================================== == 1 of 3 == Date: Fri, Sep 24 2004 10:50 am From: Nishi Bhonsle <[EMAIL PROTECTED]> Babu Kalakrishnan wrote: > Nishi Bhonsle wrote: > > > > Babu Kalakrishnan wrote: > > > > > > I checked the /etc/nsswitch.conf and found the following -- > > hosts: files nis dns > > > > I checked the /etc/resolv.conf and found that there are nameserver entries for my > > domain and 3 servers . One of the server entries (the last one) is not returning a > > successful ping. > > Could that be any problem? > > > > Depends on the strategy adopted by your resolver. If it tries to rotate > the queries between nameservers, it is possible that you might get > delays each time it tries to connect to the dead nameserver. > > Better to experiment and find out. Try running nslookup on different > hostnames a few number of times. If some of the queries are taking a > long time to complete, then it is likely to be a DNS issue, and removing > that entry from the resolv.conf file should help. > > On the other hand if your nslookup queries are returning fast with a > success or failure as the result (you didn't mention that aspect - i.e. > the time taken for the query - in your other post where said nslookup > seemed to be working ok), then you can eliminate DNS as the probable > reason. The nslookup queries did return pretty quickly, whether it was success or failure. > The next thing to try to connect to port 25 of a server that > gave you delays while testing using telnet. ("telnet yahoo.com 25" for > instance) Normally it should instantly say "connection refused" if the > port is not open. If you find a long delay, then it is probably your > firewall setup which is to blame. (It might be quietly dropping packets > instead of rejecting them - or might be blocking ICMP packets) I ran the following command on the host on which i am seeing the delay. > telnet yahoo.com 25 Trying 216.109.112.135... <The Trying state hung for a long time before returning the below line> -- my comments telnet: connect to address 216.109.112.135: No route to host Trying 66.94.234.13... <The Trying state hung for a long time before returning the below line> -- my comments telnet: Unable to connect to remote host: No route to host > > > BK == 2 of 3 == Date: Fri, Sep 24 2004 12:01 pm From: Babu Kalakrishnan <[EMAIL PROTECTED]> Nishi Bhonsle wrote: >>telnet yahoo.com 25 > > Trying 216.109.112.135... > <The Trying state hung for a long time before returning the below line> -- my > comments > > telnet: connect to address 216.109.112.135: No route to host > Trying 66.94.234.13... > <The Trying state hung for a long time before returning the below line> -- my > comments > > telnet: Unable to connect to remote host: No route to host > So this is exactly what's causing the delay in your application as well. Looks like your firewall is blocking outward traffic to port 25 and dropping those packets. Time to query your sysadmin as to what is happening.. They need to open up connections to port 25 for your application to work. By the way, if I try the same on my machine, it comes up with : [EMAIL PROTECTED] telnet yahoo.com 25 Trying 216.109.112.135... Connected to yahoo.com. Escape character is '^]'. BK == 3 of 3 == Date: Fri, Sep 24 2004 2:22 pm From: Nishi Bhonsle <[EMAIL PROTECTED]> Babu Kalakrishnan wrote: > Nishi Bhonsle wrote: > >>telnet yahoo.com 25 > > > > Trying 216.109.112.135... > > <The Trying state hung for a long time before returning the below line> -- my > > comments > > > > telnet: connect to address 216.109.112.135: No route to host > > Trying 66.94.234.13... > > <The Trying state hung for a long time before returning the below line> -- my > > comments > > > > telnet: Unable to connect to remote host: No route to host > > > > So this is exactly what's causing the delay in your application as well. > Looks like your firewall is blocking outward traffic to port 25 and > dropping those packets. Time to query your sysadmin as to what is > happening.. They need to open up connections to port 25 for your > application to work. > > By the way, if I try the same on my machine, it comes up with : > > [EMAIL PROTECTED] telnet yahoo.com 25 > Trying 216.109.112.135... > Connected to yahoo.com. > Escape character is '^]'. Port 25 is a default port value both for the SMTP mail server and the e-mail client and hence my application is trying to open a connection of the host(supplied through the application) on port 25. ie if there is no SMTP server with the name yahoo.com configured on port 25 then i should get an error. I think, even though the sysadmin does not open the connections to port 25, they should be dropping packets instead of rejecting them .ie. If I run the same telnet command on my windows box, I get the following returned pretty quickly C:\>telnet yahoo.com 25 Connecting To yahoo.com...Could not open a connection to host on port 25 : Connect failed If I get such a response from the solaris box, that would help too. What do you think? > > > BK ========================================================================== TOPIC: read binary data from C file??? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c04d04f749f5ae1f ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 11:26 am From: Steve Horsley <[EMAIL PROTECTED]> Gordon Beaton wrote: > On Thu, 23 Sep 2004 20:35:19 +0100, Steve Horsley wrote: > >>John Adams wrote: >> >>>Gordon Beaton wrote: > > > Just to clarify, I didn't write *any* of the text (a short section of > code) that you quoted in your reply to John. > > /gordon > Whoops, sorry. Sloppy snipping. I'll try to be more careful in future. Steve ========================================================================== TOPIC: java.util.Timer doesn't work http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/71ef1327ff59774b ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 11:44 am From: Chris Smith <[EMAIL PROTECTED]> FET wrote: > I have an application that displays a Swing GUI. The application > writes its logs to a certain file. I would like to have a thread that > checks the file every, say 10 seconds, and if it is found to be > deleted, creates a new file. I have made a class that extends > TimerTask and in the run method, it calls file.exists() and > file.createNewFile(). Then I have set timer.schedule ( task, 0, > 10000). But the code never gets called. As Andrew said, please post a complete example that fails, including the code to prove that the timer task is never called (println or whatever). This should work. > Should I just use plain ol' awt threads ? I think Timers is a more > sophisticated mechanism. But it doesn't seem to be working. There's no such concept as "AWT threads". Plain old Java threads would work, but you're right that java.util.Timer is a better idea. Let's see if we can fix that. -- www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ========================================================================== TOPIC: cost of unused import statement http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7541f77bd3a07e9e ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 11:51 am From: Chris Smith <[EMAIL PROTECTED]> Thomas Fritsch wrote: > No performance impact, but a risk of semantic impact. For example: > > package my.package; > import java.lang.reflect.*; > import java.sql.*; > > class Array { } > ... > Array a; // Array from which of the 3 packages is meant ? If anyone cares, that's a reference to my.package.Array. You can find the nitty-gritty at JLS section 6.5.5.1. The fact that many people will probably need to look this up reinforces the recommendation against relying on it, of course. -- www.designacourse.com The Easiest Way to Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ========================================================================== TOPIC: Simple multiuser java database http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76285f28cb4423bf ========================================================================== == 1 of 2 == Date: Fri, Sep 24 2004 11:58 am From: [EMAIL PROTECTED] (Robert) Paul Lutus <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Robert wrote: > > > I have written a no frills console math app that I would like to run > > from multiple computers. I need help in replacing two methods that > > store and retrieve data. I am currently using an array for > > writing/reading strings but I need to replace the array with a > > database. For various reasons I don't want to get wrapped up in > > configuring and managing a SQL database but need to distribute this > > classs to multiple computers. I'd like to find a small efficient > > database that doesn't require the complexity of jdbc calls from my app > > but will allow tcp calls for remote instances. > > If you want a database that is accessible by way of TCP calls, the next > questions are whether you intend to write it yourself, whether it will be > written in java, and whether the clients will read only or possibly modify > the database. > > If the database requirement can be met by simply retrieving flat-file > records and no interactive writing will be done, this is very simple. If > you have to retrieve many records, or retrieve using any database-specific > methods such as SQL queries, or write to the database, this becomes much > more complex. > > So, in summary, you need to define the problem more clearly. Start by moving > beyond saying what it is not. Paul, As I mentioned above, the application reads and writes and requires multiuser capability which is why I refer to the solution as a database. The app is a number sieve so I'd like to keep it small and efficient. The current array read write process is very simple. The first loop generates character strings which are appended to an array. At the end of the loop, I call the read method whichs starts at the top of the array, reads a line and flags it read and passes that value back to the loop which may generate more data which gets sent to the write method. The write method starts at the top of the array and writes over any record flagged as read or gets appended to the bottom. The order is not important since all records must be processed. I am looking for a class with simple methods that write to a remote file or database so I can replace the single user array I'm using now. I do not want to use jdbc. The data source can be another class, an embedded database such as Berkely or even an executable as long as it is easy to configure and doesn't require the investment of time that a sql server would. I'm open to someone writing this for me if it doesn't cost too much considering this is just a hobby. == 2 of 2 == Date: Fri, Sep 24 2004 1:02 pm From: Sudsy <[EMAIL PROTECTED]> Robert wrote: <snip> > I am looking for a class with simple methods that write to a remote > file or database so I can replace the single user array I'm using now. > I do not want to use jdbc. The data source can be another class, an > embedded database such as Berkely or even an executable as long as it > is easy to configure and doesn't require the investment of time that a > sql server would. > > I'm open to someone writing this for me if it doesn't cost too much > considering this is just a hobby. Depending on your target platform, you could write a small C program which could use ndbm as the datastore. I'd do that but I already have RDBMSs coming out of my ears... ;-) (One of the many nice things about Linux) ========================================================================== TOPIC: Beginner Advice Sought http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b96a0a430a102e22 ========================================================================== == 1 of 3 == Date: Fri, Sep 24 2004 12:06 pm From: IchBin <[EMAIL PROTECTED]> jbeck wrote: > Looking for recommendations as to the top two or three books to use to begin > learning Java. > > Also, recommendations for compilers? > > As for an IDE, I would recommend an academic generated IDE called JGRASP. I wish I had this IDE when I started to lean Java and C/C++. It is free! Here is the site: http://www.jgrasp.org/ Here is their description of the IDE: jGRASP is a lightweight development environment, created specifically to provide automatic generation of software visualizations for the purpose of improving the comprehensibility of software. jGRASP is implemented in Java, and runs on all platforms with a Java Virtual Machine (Java version 1.3 or higher). jGRASP produces CSD diagrams for Java, C, C++, Objective-C, Ada, and VHDL; CPG diagrams for Java and Ada; UML diagrams for Java; and has an integrated debugger and workbench for Java. -- Thanks in Advance... IchBin __________________________________________________________________________ 'Laughter is inner jogging' - Norman Cousins, editor and author (1915-1990) == 2 of 3 == Date: Fri, Sep 24 2004 12:14 pm From: IchBin <[EMAIL PROTECTED]> jbeck wrote: > "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>On Tue, 21 Sep 2004 05:06:33 -0600, Joe Beck wrote: >> >> >>>I was considering using an IDE in my quest for learning the basics of >>>Java...unless there is a better approach, or reason to go with the >>>commandline compiler. >> >>I recommend the command line, till you have the hang of it.. >><http://www.xdweb.net/~dibblego/java/faq/answers.html#q34> >> >>(Oh, OK! I'll admit that even I wanted an editor >>that had keyword highlighting, so I use TextPad) >> >>-- >>Andrew Thompson >>http://www.PhySci.org/codes/ Web & IT Help >>http://www.PhySci.org/ Open-source software suite >>http://www.1point1C.org/ Science & Technology >>http://www.lensescapes.com/ Images that escape the mundane > > > > Okay! Okay! Command line editor isn't as bad as I thought it would be! > Actually, kind a bit easier than I remember during my C experience (perhaps > it really did prepare me a bit more than I thought for this?) > > I am currently trying Jedit (I got the copy off Sourceforge)...so far, so > good. > > Thanks for the advice! > > > As for an IDE, I would recommend an academic generated IDE called JGRASP. I wish I had this IDE when I started to lean Java and C/C++. It is free! Here is the site: http://www.jgrasp.org/ Here is their description of the IDE: jGRASP is a lightweight development environment, created specifically to provide automatic generation of software visualizations for the purpose of improving the comprehensibility of software. jGRASP is implemented in Java, and runs on all platforms with a Java Virtual Machine (Java version 1.3 or higher). jGRASP produces CSD diagrams for Java, C, C++, Objective-C, Ada, and VHDL; CPG diagrams for Java and Ada; UML diagrams for Java; and has an integrated debugger and workbench for Java. -- Thanks in Advance... IchBin __________________________________________________________________________ 'Laughter is inner jogging' - Norman Cousins, editor and author (1915-1990) == 3 of 3 == Date: Fri, Sep 24 2004 12:59 pm From: "jbeck" <[EMAIL PROTECTED]> "IchBin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > jbeck wrote: >> Looking for recommendations as to the top two or three books to use to >> begin learning Java. >> >> Also, recommendations for compilers? > As for an IDE, I would recommend an academic generated IDE called JGRASP. > I wish I had this IDE when I started to lean Java and C/C++. It is free! > Here is the site: http://www.jgrasp.org/ > > Here is their description of the IDE: > > jGRASP is a lightweight development environment, created specifically to > provide automatic generation of software visualizations for the purpose of > improving the comprehensibility of software. jGRASP is implemented in > Java, and runs on all platforms with a Java Virtual Machine (Java version > 1.3 or higher). jGRASP produces CSD diagrams for Java, C, C++, > Objective-C, Ada, and VHDL; CPG diagrams for Java and Ada; UML diagrams > for Java; and has an integrated debugger and workbench for Java. > > -- > > > Thanks in Advance... > IchBin > __________________________________________________________________________ > > 'Laughter is inner jogging' > - Norman Cousins, editor and author (1915-1990) Thank you very much for the link! I will look into it! Is it me, or does it seem like some of the free stuff is as good, if not better than commercial stuff. I used Dev-C++ for learning C++, and I think it worked as well as anything else (and I tried about 3 or 4 different ones...including two seperate versions of the same product from Microsoft). For Java, I plan on using the command line based compiler for a bit longer...at least until I *think* I know what I am doing! :-) ========================================================================== TOPIC: how can C program calls Java? Thanks http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/919552d936d443f9 ========================================================================== == 1 of 3 == Date: Fri, Sep 24 2004 12:02 pm From: Shuo Yang <[EMAIL PROTECTED]> Hi folks, How can a C program call a Java program? Is there any reference on that point? I need some help on this issue, thanks. == 2 of 3 == Date: Fri, Sep 24 2004 12:33 pm From: John Davison <[EMAIL PROTECTED]> Shuo Yang wrote: > Hi folks, > How can a C program call a Java program? Is there any reference on > that point? I need some help on this issue, thanks. If you're asking how to start a Java program from a C program, then you should ask comp.lang.c - they might give you trouble since that problem is really OS dependant. It's just a matter of running the java.exe (or java) program with the correct arguments. If you asking how to run C code from inside a Java program, Google for JNI. - john == 3 of 3 == Date: Fri, Sep 24 2004 2:12 pm From: "hilz" <[EMAIL PROTECTED]> http://java.sun.com/j2se/1.3/docs/guide/jni/ ========================================================================== TOPIC: A Jtidy and XHTML question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/22e06ae99461da6d ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 12:16 pm From: [EMAIL PROTECTED] (mike) > The XHTML specification can tell you: > http://www.w3.org/TR/xhtml1/#media regards: I would like to say sorry first,maybe I am wrong. I doubt that if the Jtidy can exactly translate a HTML file into a XHTML file. My mobile client is nokia6600,and the wireless bearer is Wap. I reply the mobile client(nokia6600) the standard XHTML page(page of http://www.w3c.org) by the content-type: application/vnd.wap.xhtml+xml, it is testing OK. See the page showed on the nokia6600,and I am a little happy. I use the same idea.I try to send the "XHTML file(produced by Jtidy)" content-length:(I try to get the number from the OS) content-type: application/vnd.wap.xhtml+xml I fail. Sequently,I change the content-type to application/xhtml+xml, application/xhtml,application/xml, text/html,xml.............etc I fail All of my tests. ------------------------------------------------------------------------- thank you for your suggestion,anyway. ------------------------------------------------------------------------- I would like to ask is there any constructive suggestion? thank you ========================================================================== TOPIC: Extension problem Mac OS X (launching of external jar doesn't work) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3dd4b342d0c112d6 ========================================================================== == 1 of 3 == Date: Fri, Sep 24 2004 12:24 pm From: "Steve W. Jackson" <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (contrex) wrote: >:My java application use the extension mechanism (see: >:http://java.sun.com/docs/books/tutorial/ext/basics/install.html) which >:works very well under windows and linux. But the same app doesn't >:launch under Mac OS X (Panther) throwing a >:java.lang.NoSuchMethodException by the main class even when I've >:copied the jar (the extension) to all three possible extension >:folders which are (see: >:http://developer.apple.com/documentation/Java/Conceptual/Java141Development/Ov >:erview/chapter_2_section_4.html): >: >:1) /Library/Java/Extensions/ >:2) /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/ext/ >:3) /System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home/lib/ext/ >: >:Let me go a little bit more into the details: What I wan't is to >:integrate an existing java app "SubApp" into another java app >:"MainApp". Both apps are normaly standalone apps. >:Thus, I just added a button to the GUI of "MainApp" which will >:instanciate "SubApp" when the user clicks it. The jar of "SubApp" has >:to be located therefore in the java extension folder, which is the >:case. >:This works fine on windows and linux but Mac OS X throws a >:java.lang.NoSuchMethodException. Why? >: >:Thanks for reading and helping! >: >:PS: If I double-click directly the jar file of "SubApp" then this app >:works fine too on Mac OS X - but standalone and not integrated in >:"MainApp". What can I do (besides chuck away Mac OS X)? I don't know >:much about Mac but I begin to hate it... If a lack of understanding is all it takes to make you hate the Mac, then you're probably already biased against it to begin with... But back to your described problem. You've said that putting the jar into the extensions locations isn't working -- and have described putting it into two locations that could not possibly work for 1.4.2 (notice the directory paths you provided, which explicitly apply to 1.3.1 and 1.4.1). And the link you provided from Apple says to place your jar in /Library/Java/Extensions rather than the second and third locations anyway, which you've said you tried. You've said that the app runs when the jar is double-clicked, but you can't instanciate SubApp. I'm not convinced that you've done it correctly, since creating an instance cannot possibly produce a java.lang.NoSuchMethodException. Instead, that should produce a java.lang.NoClassDefFoundError if it can't find the class. This implies that the jar is indeed found, but that you've referred to a method that's not in existence. Perhaps that'll help. = Steve = -- Steve W. Jackson Montgomery, Alabama == 2 of 3 == Date: Fri, Sep 24 2004 12:33 pm From: "Steve W. Jackson" <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Batman4050) wrote: >:I too, have this problem on my Mac OS X computer. >: >:What command do you use to add the $CLASSPATH? >: >:I tried typing the following: >:set CLASSPATH=.;/Library/Java/Extensions/ >:set $CLASSPATH=.;/Library/Java/Extensions/ >:env CLASSPATH=.;/Library/Java/Extensions/ >:env $CLASSPATH=.;/Library/Java/Extensions/ >: >:and I keep getting the error: -bash: /Library/Java/Extensions/: is a >:directory >: >:The current version of Java I have is: >:Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141) >:Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode) You need two tips here. (1) There's no reason to set a CLASSPATH variable. (2) That's not how you set an environment variable in Bash and most other shells. The OP's post (which he multi-posted, BTW) included a link to an Apple page which clearly states that jar files in /Library/Java/Extensions are loaded by the JVM at startup, so no CLASSPATH setting is needed. Setting an environment variable in Bash (and other shells which trace their roots to the Bourne shell) is done as follows: VARIABLE=value export VARIABLE Or the alternative in Bash and some others is "export VARIABLE=value". = Steve = -- Steve W. Jackson Montgomery, Alabama == 3 of 3 == Date: Fri, Sep 24 2004 3:12 pm From: contrex <[EMAIL PROTECTED]> > If a lack of understanding is all it takes to make you hate the Mac, > then you're probably already biased against it to begin with... I aggree, I have heard good things about Mac but the first time I got in touch with it (one week ago) I was wondering if it was made only for kids or seniors because the icons was so oversized (I don't need glasses) whereas I even wasn't interested in the most of these shopping icons, the mouse had only one button (I still have 5 fingers on each hand), finder didn't find files I was looking for even I knew they exist (I don't need to be "protected" for myself), help is very spare (besides man pages), while installation of OS X I was forced to select marketing bullshit and so on.... But this would be another story. > and have described > putting it into two locations that could not possibly work for 1.4.2 > (notice the directory paths you provided, which explicitly apply to > 1.3.1 and 1.4.1). Of course. I wasn't speaking about 1.4.2 (it was batman4050 post). Besides this, my application would run on JRE 1.4.2 if I had it installed (at least on linux and windows). > And the link you provided from Apple says to place > your jar in /Library/Java/Extensions rather than the second and third > locations anyway, which you've said you tried. It depends if you like restrict the access for some users (or grant it for all users of this physical machine). But neither putting it in /Library/Java/Extensions nor in the others /home/... directories worked. > You've said that the app runs when the jar is double-clicked, but you > can't instanciate SubApp. Yes, double-click on SubApp jar launchs SubApp well but clicking the button of MainApp which shall instanciate SubApp doesn't work on Mac OS X (but it works on windows and linux). > I'm not convinced that you've done it > correctly, since creating an instance cannot possibly produce a > java.lang.NoSuchMethodException. If it were not correctly done why it works on windows and linux? > Instead, that should produce a > java.lang.NoClassDefFoundError if it can't find the class. This implies > that the jar is indeed found, but that you've referred to a method > that's not in existence. Hm, I'm not sure. I have now installed Eclipse IDE in order to debug my app on Mac OS X. All works fine when running with Eclipse! There is no instanciation error or whatever. > Perhaps that'll help. Not really. But I would be VERY pleased if I could send you my java code allowing you to see it and test it by your own eyes. This is not a commercial product. Its freeware which I'm developing in my spare time. PS: I posted twice because I posted via Google which was telling me publishing would take between 3 and 9 hours. After 10 hours I still didn't saw my posting so I posted it anew. Now I'm using a newsreader client and the news-server of my internet provider. Thus it should be posted immediatly. BTW: I see your second post (this one I replied) only in "Gravity" newsreader but not in "Noworyta-NewsReader" nor "XNews" nor on Google web pages. Can you explain that? Are they just not yet up-to- date? Thanks ========================================================================== TOPIC: I got the Herbert Schilt, (Java 2) Package blues. Please help before I shoot the dog http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f29e821306447a70 ========================================================================== == 1 of 2 == Date: Fri, Sep 24 2004 1:02 pm From: Rendzina <[EMAIL PROTECTED]> Hi all. I'm a recent convert to the world of Java and I've hit a problem that maybe a few of you learned people could help me with. Please. I'm reading Herbert Schildt (Java 2, complete reference, 5th edition.) and I'm stuck on Chapter 9, Packages and Interfaces. I did the first demo ok but then could not compile anything past his first program, Package p1- Protection.java, Derived. java, SamePackage.java. Package p2-Protection.java,OtherPackage.java. To test "Demo.java" will not compile. Is there some simple explanation/rule for getting packages working.......classpath? It's very confusing in Schildt and there doesn't seem to be any examples around. I'd be grateful for any ideas or help. Thanks. PS. I was joking about shooting the dog. == 2 of 2 == Date: Fri, Sep 24 2004 2:47 pm From: Joona I Palaste <[EMAIL PROTECTED]> Rendzina <[EMAIL PROTECTED]> scribbled the following: > Hi all. > I'm a recent convert to the world of Java and I've hit a problem that > maybe a few of you learned people could help me with. Please. > I'm reading Herbert Schildt (Java 2, complete reference, 5th edition.) > and I'm stuck on Chapter 9, Packages and Interfaces. I did the first > demo ok but then could not compile anything past his first program, > Package p1- Protection.java, Derived. java, SamePackage.java. > Package p2-Protection.java,OtherPackage.java. > To test "Demo.java" will not compile. > Is there some simple explanation/rule for getting packages > working.......classpath? It's very confusing in Schildt and there > doesn't seem to be any examples around. > I'd be grateful for any ideas or help. > Thanks. > PS. I was joking about shooting the dog. If Herbert Schildt's Java books are anything like his C books, I suggest getting another books instead. -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/ "Parthenogenetic procreation in humans will result in the founding of a new religion." - John Nordberg ========================================================================== TOPIC: what's wrong in this program http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7988d20d29a05202 ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 7:12 am From: "Madhur Ahuja" <[EMAIL PROTECTED]> VisionSet <[EMAIL PROTECTED]> wrote: > "Madhur Ahuja" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] [snip] Thanks a lot, for a quick answer. ========================================================================== TOPIC: Application sharing http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7befcbbc82dde970 ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 2:03 pm From: "Ike" <[EMAIL PROTECTED]> exactly! "Jonck" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In <[EMAIL PROTECTED]> Ike wrote: > > Anyone know of a Java API in existence that I could utilize for > > application sharing? Thanks, Ike > > > > > > > > Perhaps you mean something like this? > http://www.realvnc.com/javavncviewer.html ========================================================================== TOPIC: help w/ xdoclet entity definition http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/95d618c227db1e79 ========================================================================== == 1 of 2 == Date: Fri, Sep 24 2004 2:28 pm From: [EMAIL PROTECTED] (Willian Irving Zumwalt) Can anyone help me w/ the following errors. I'm new at using XDoclet and dont' know what's wrong w/ my bean definition. Any help greatly appreciated. --- my bean --- /** * This is the Device entity bean. * * * @ejb.bean * name="comp/Device" * type="BMP" * jndi-name="ejb/comp/Device" * primkey-field="id" * * @ejb.home * extends="javax.ejb.EJBHome" * remote-class="com.place.management.ejb.entity.DeviceHome" * * @ejb.interface * extends="javax.ejb.EJBObject" * remote-class="com.place.management.ejb.entity.Device" * */ public class DeviceBean implements EntityBean { private EntityContext context = null; private transient Connection dbConn = null; private transient DataSource dataSource = null; static { try { Class.forName("org.postgresql.Driver"); } catch (ClassNotFoundException cnfe) { System.out.println("Logger not working"); } } public DeviceBean() { } /** * Sets the unique serial number of the device. This is used within * the initial registration. * * @param id the unique 64-bit serial number. * * @ejb.interface-method * view-type="remote" */ public void setId(String id) {} /** * The unique serial number of the hardware device. * * @return the unique serial number of the device. * * @ejb.interface-method * view-type="remote" */ public String getId() { return null; } /** * * @throws CreateException * * @ejb.create-method */ public String ejbCreate() throws CreateException { System.out.println("DeviceBean.ejbCreate()"); return null; } /** * @throws CreateException * * @ejb.create-method */ public String ejbCreate(DeviceInfo dev) throws CreateException { System.out.println("DeviceBean.ejbCreate(Device)"); return null; } public void ejbPostCreate() { } public void setEntityContext(EntityContext ctx) { context = ctx; } public void unsetEntityContext() throws EJBException { context = null; } public void ejbRemove() throws RemoveException { } public void ejbActivate() { } public void ejbPassivate() { } public void ejbLoad() throws EJBException { } public void ejbStore() throws EJBException { } public String ejbFindByPrimaryKey(String pk) throws FinderException { return null; } public Connection getConnection() throws SQLException { return null; } } --- my server output --- 16:07:47,419 WARN [verifier] EJB spec violation: Bean : comp/Device Section: 12.2.10 Warning: Entity bean's local interface must extend the javax.ejb.EJBLocalObject interface. 16:07:47,450 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract void setId(String) throws RemoteException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,482 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract String getId() throws RemoteException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,517 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract void remove() throws RemoteException, RemoveException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,550 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract Object getPrimaryKey() throws RemoteException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,551 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract EJBHome getEJBHome() throws RemoteException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,552 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract Handle getHandle() throws RemoteException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,582 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract boolean isIdentical(EJBObject) throws RemoteException Section: 12.2.10 Warning: The methods in the local interface must not include java.rmi.RemoteException in their throws clause. 16:07:47,609 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract void remove() throws RemoteException, RemoveException Section: 12.2.10 Warning: For each method defined in the local interface, there must be a matching method in the entity bean's class that has the same name and argument types. 16:07:47,611 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract Object getPrimaryKey() throws RemoteException Section: 12.2.10 Warning: For each method defined in the local interface, there must be a matching method in the entity bean's class that has the same name and argument types. 16:07:47,647 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract EJBHome getEJBHome() throws RemoteException Section: 12.2.10 Warning: For each method defined in the local interface, there must be a matching method in the entity bean's class that has the same name and argument types. 16:07:47,648 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract Handle getHandle() throws RemoteException Section: 12.2.10 Warning: For each method defined in the local interface, there must be a matching method in the entity bean's class that has the same name and argument types. 16:07:47,677 WARN [verifier] EJB spec violation: Bean : comp/Device Method : public abstract boolean isIdentical(EJBObject) throws RemoteException Section: 12.2.10 Warning: For each method defined in the local interface, there must be a matching method in the entity bean's class that has the same name and argument types. 16:07:47,740 ERROR [MainDeployer] could not create deployment: file:/opt/jboss-3.2.5/server/default/deploy/megs-ejb.jar org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages. at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:517) at org.jboss.deployment.MainDeployer.create(MainDeployer.java:790) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:644) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608) at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) == 2 of 2 == Date: Fri, Sep 24 2004 3:05 pm From: Sudsy <[EMAIL PROTECTED]> Willian Irving Zumwalt wrote: > Can anyone help me w/ the following errors. I'm new at using XDoclet > and dont' know what's wrong w/ my bean definition. > > Any help greatly appreciated. > > --- my bean --- > > /** > * This is the Device entity bean. > * > * > * @ejb.bean > * name="comp/Device" > * type="BMP" > * jndi-name="ejb/comp/Device" > * primkey-field="id" Try adding: * view-type="remote" You really need to learn how to read error messages and documentation. You're the same poster who had two declaration of ejbDelete, right? ========================================================================== TOPIC: Getting something on my resume http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a1e0464adf07366 ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 2:59 pm From: Alex Hunsley <[EMAIL PROTECTED]> kboris wrote: > I stumble across very depressing websites with incredible displays > of programming prowess. They're depressing because they belong to > other people. > > Examples include: a 3-D rendition of Rubik's cube, various games, > scientific analysis etc etc. Just to completely go over the top, > a lot of these sites share the source code. > > 1) Am I sunk in the job market without a portfolio? Not necessarily - depends on if you've had a job in that market before, who for, and for how long... > 2) If you interview candidates, what was the best display you've seen? I'd say they'd be quite interested in stable, industrious, able people (with some background in the work) as much as they'd be interested in graphics/science whizzes etc. (who also may of course have the aforementioned traits as well). > > I have some assembler and preprocessing utilities to show off. Maybe > a simple language compiler. > > But it's no rubik's cube! > > Thanks > /kevin If you don't have a previous comparable employment in the field, then a portfolio would help a lot. It's your way to show off your thang (in whatever way you want) given a lack of previous jobs. alex ========================================================================== TOPIC: how to detect if web app is deployed http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d07e772bf6805e ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 3:06 pm From: [EMAIL PROTECTED] (Willian Irving Zumwalt) Hey all, I'd like to know how to detect if a web application has been deployed from my main web application and if so, have another tab in my main web application appear for the newly installed web app. BTW - I'm using jboss if that matters. Any advice on how something like this works? Any help much appreciated. ========================================================================== TOPIC: Need a method for detecting when files are written to a directory http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d1293173b48ccf65 ========================================================================== == 1 of 1 == Date: Fri, Sep 24 2004 3:07 pm From: [EMAIL PROTECTED] (Elliott) Hi all: Perhaps someone can help a relatively new Java programmer. I am writing an application that sits in a network and processes files when they are written to a designated directory. I am wondering if there is some elegant way to do this. I realize I can create a loop in which the process sleeps for say, five seconds and then checks to see if a directory has a file in it and then performs an action appropriately. However, I wonder if there is a better way to do this. If there is some way that a file being written to a designated directory triggers some kind of event that wakes my program up to begin processing, that would be better, but how does one do this? Any help would be greatly appreciated. Thanks, Elliott ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
