comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Daylight Savings Time in Java - 4 messages, 4 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8278bbc2bf516a1f * Turn off boundary checks? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fc5b4ab5a504cf9 * clone() seems odd - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ffa034c5b07f529 * quick newbie GUI question - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/753192ed9637ff5c * jdom + jtree - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4d3523ac3f1cc88d * how my Database can send me a message? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96ee48d269aefeb4 * Problem with mssql jdbc - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bf3235eec595bc83 * What is Instance Initializer? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/15dac666512492d6 * Method invocation conversion - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a84caa7322a6162d * why does ObjectInputStream constructor block reading a header - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7b8520ff9f293b96 * Off Topic: Safari Bookshelf - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3d4c237d0e60a7ee * Alternative to change log4j logging level at runtime? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9bb8d27d79dac47f * stack implementation - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c909f1ce5b4696a * JBuilder / BlueJ question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfea91ed00a06b2c * Code compiled with JDK1.2. Will it be compilable with JDM1.4?? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7f9404acc33d0a2a * Code compiled with JDK1.2. Will it be compilable with JDK1.4?? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eb71120d3dc9286e * Java 1.5.0 - shared memory mode blows up - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8a09d7cb09fae534 * _scripting engines for java applications_ - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/39a65441a241e46a ========================================================================== TOPIC: Daylight Savings Time in Java http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8278bbc2bf516a1f ========================================================================== == 1 of 4 == Date: Mon, Nov 1 2004 12:33 pm From: [EMAIL PROTECTED] (marat) How does one determine if daylight savings time is currently in effect via Java ? I searched thru Calendar, Date, TimeZone objects and haven't figured it out.... Thanks == 2 of 4 == Date: Mon, Nov 1 2004 12:38 pm From: Chris Smith <[EMAIL PROTECTED]> marat wrote: > How does one determine if daylight savings time is currently in effect > via Java ? I searched thru Calendar, Date, TimeZone objects and > haven't figured it out.... See TimeZone.inDaylightTime(Date) -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation == 3 of 4 == Date: Mon, Nov 1 2004 12:40 pm From: "Jbjones" <[EMAIL PROTECTED]> I would also suggest perhaps parsing the current date into a Z format (GMT), and thenr reading the offset. I know all my Z dates just changed from -04:00 to -05:00. == 4 of 4 == Date: Mon, Nov 1 2004 12:55 pm From: "John C. Bollinger" <[EMAIL PROTECTED]> marat wrote: > How does one determine if daylight savings time is currently in effect > via Java ? I searched thru Calendar, Date, TimeZone objects and > haven't figured it out.... Have you tried this: if (TimeZone.getDefault().inDaylightTime(new Date())) { System.out.println("Daylight savings time is in effect"); } else { System.out.println("Daylight savings time is NOT in effect"); } This depends on your locale being correctly configured and your system clock being correct, of course. John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: Turn off boundary checks? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fc5b4ab5a504cf9 ========================================================================== == 1 of 2 == Date: Mon, Nov 1 2004 12:55 pm From: [EMAIL PROTECTED] (Markus Dehmann) [EMAIL PROTECTED] (Jesper Nordenberg) wrote in message news:<[EMAIL PROTECTED]>... > Markus Dehmann <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > I know that automatic boundary checks for array accesses is a good thing, > > prevents crashes at runtime and makes Java superior to, say, C. > > > > But what if I use arrays really heavily and I am sure that there are no > > undefined array elements queried -- shouldn't there be an option to turn > > the boundary checks off? It would probably improve the performance of my > > program a lot. The same for automatic initialization. > > You can compile your code using GCJ which allows you to turn off array > bounds checking. gcj --no-bounds-check Sweet! I didn't think it's that easy!! Thanks! Markus == 2 of 2 == Date: Mon, Nov 1 2004 1:03 pm From: Michael Borgwardt <[EMAIL PROTECTED]> Chris Smith wrote: > Michael, I should have limited that statement a bit more. Java is not > the right language if you wish to mix in assembly in performance- > critical places like inner loops. It is, of course, possible to write > native Java methods in assembly, just not generally possible to approach > the limits of application performance by doing so. I wouldn't say that. The only preoblem is the overhead for a native call. That means a native method must do a significant amount of work in each call to yield a performance gain. ========================================================================== TOPIC: clone() seems odd http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ffa034c5b07f529 ========================================================================== == 1 of 3 == Date: Mon, Nov 1 2004 1:01 pm From: DeMarcus <[EMAIL PROTECTED]> Chris Smith wrote: > DeMarcus wrote: > >>Ok, thanks. I think I got it. >>I'm a C++ guy in the roots so "walking upstream" is a little >>bit unfamiliar to me. I would prefer to return new Car( this ); >>instead of super.clone(); but I guess there's a point using >>super. > > > The point of using super is that if you say: > > public Object clone() > { > return new Car(...); > } > > And then, > > public class HybridElectric extends Car { ... } > > Then you won't get back a HybridElectric when you clone a > HybridElectric, unless go out of your way to override the default clone. > The way it is now, clone *only* need to be overridden if you need to > make a deep copy of something. Otherwise, the default implementation > succeeds the way you want. > Ah! Brilliant! As far as I know we can't do that in C++, but that's off topic anyway. Thanks. == 2 of 3 == Date: Mon, Nov 1 2004 12:57 pm From: Oscar kind <[EMAIL PROTECTED]> DeMarcus <[EMAIL PROTECTED]> wrote: > I'm a C++ guy in the roots so "walking upstream" is a little > bit unfamiliar to me. I would prefer to return new Car( this ); > instead of super.clone(); but I guess there's a point using > super. Actually, there are two trains of thought here. One states that when using clone() instead of a copy constructor you can run into problems with final fields (you can't set them). The other states that when using a copy constructor instead of clone(), the user must define the correct class, which is error-prone, not always possible (inner classes with a private constructor), etc. Clearly, both have their problems. But given the convenience for the user, my choice is for the clone() method. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 == 3 of 3 == Date: Mon, Nov 1 2004 5:40 pm From: Greg <[EMAIL PROTECTED]> DeMarcus wrote: > > If you take a look at the Object class in the Java documentation > it says like this under the clone() section: > > "By convention, the returned object should be obtained by calling > super.clone. If a class and all of its superclasses (except Object) obey > this convention, it will be the case that x.clone().getClass() == > x.getClass(). " > > To me this makes no sense. If I have this class > > public class Car extends Vehicle implements Cloneable > { > public Object clone() > { > return super.clone(); > } > } > > To me this clearly means I return an Object which will be of > type Vehicle. > > Am I wrong? I don't get this. Is there anyone that can help me > clear this out? > > Thanks > Daniel > > Trust me, you aren't the first to think the whole clone/cloneable system is a confusing mess. :-) If you get a chance, I very highly recommend picking up Joshua Bloch's "Effective Java Programming Language Guide" book. He gives the clone system a very thorough treatment, and his final analysis is that cloning was a design mistake to be avoided if at all possible. Use copy-constructors or factories instead. One thing that might help to understand how clone is able to work is to keep in mind that it works pretty much outside the realm of Java. I've read Bloch's book cover-to-cover 3 times now, and hell I still don't totally understand how clone works under the covers. But to answer your question, as long as Vehicle also implements Cloneable then your Car's clone method should work as you have written it, and you'll get an Object of type Car (not Vehicle). You can verify the returned type yourself like this: Vehicle aVehicle = new Vehicle(); Object aClone = aVehicle.clone(); System.out.println(aClone.getClass().getName()); // should print "Vehicle" Car aCar = new Car(); aClone = aCar.clone(); System.out.println(aClone.getClass().getName()); // should print "Car" ========================================================================== TOPIC: quick newbie GUI question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/753192ed9637ff5c ========================================================================== == 1 of 3 == Date: Mon, Nov 1 2004 12:50 pm From: Oscar kind <[EMAIL PROTECTED]> In comp.lang.java.help zcraven <[EMAIL PROTECTED]> wrote: > I want to make a window GUI that contains the following: > > (top) - 3 tabs leading to League, Player, and Club menus (default is to > display League). > (underneath tabs) - a main frame with various nested panels. > > --------------------------------------------------------------------- [...] > public class GUI implements ActionListener { [...] > JPanel leaguemenu, clubmenu, playermenu; [...] > > ///////////// CONSTRUCTOR ///////////// > public GUI() { //static? No, not static: don't use static code unless you have to. this is not procedural programming. Also, a constructor always belongs to an object; not a class (hence, not static). [...] > Component leaguemenu = leagueMenu(); > Component clubmenu = clubMenu(); > Component playermenu = playerMenu(); You do realize that you do not use the member variables defined above, don't you? I'd remove the declaration of the new variables, and use the member variables. [...] > } [...] > } -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 == 2 of 3 == Date: Mon, Nov 1 2004 3:25 pm From: Carl <[EMAIL PROTECTED]> zcraven wrote: > I want to make a window GUI that contains the following: > > (top) - 3 tabs leading to League, Player, and Club menus (default is to > display League). > (underneath tabs) - a main frame with various nested panels. > > I cannot get this code to do this. It just displays the tabs, and the > league frame, but when I click the tabs it doesnt change at all. Can anyone > point me in the right direction? > > Thanks, > > Zac > > --------------------------------------------------------------------- > import javax.swing.*; > import java.awt.*; > import java.awt.event.*; > > public class GUI implements ActionListener { > > JFrame frame; > JPanel leaguemenu, clubmenu, playermenu; > final static String LOOKANDFEEL = null; > > ///////////// CONSTRUCTOR ///////////// > public GUI() { //static? > //Set the look and feel. > initLookAndFeel(); > //Make sure we have nice window decorations. > JFrame.setDefaultLookAndFeelDecorated(true); > // set up the main window > frame = new JFrame("League Administrator (Zac Craven - 2004)"); > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > frame.setSize(new Dimension(120, 40)); > > > Component tabs = createTabs(); > Component leaguemenu = leagueMenu(); > Component clubmenu = clubMenu(); > Component playermenu = playerMenu(); In the createTabs method, you are loading the JTabbedPane using the already declared member variables leaguemenu, clubmenu and playermenu. Then you create new Component type variables with the same name and "build" them. Don't create new variables for the result if leagueMenu() , etc. Instead, use the existing member variables. == 3 of 3 == Date: Mon, Nov 1 2004 4:12 pm From: Alex Hunsley <[EMAIL PROTECTED]> (Followup set to comp.lang.java.help) (zcraven - this means that any replies to this will go to that group only, which is a more appropriate place for this discussion) zcraven wrote: > "Alex Hunsley" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>[snip] >> >>Can you please post code that is compilable? This code you've posted is >>line breaked and doesn't compile. >>Hint: write you code so that you never go beyond the 78th character in >>the first place (a good practice IMO) and this won't happen. >> >>[1] or other number slightly less than 80 > > > ok you can download it from here: > > www.dur.ac.uk/z.a.craven/GUI.txt > > That will work fine, you might have to rename it to .class or something > though. > > zac I renamed it to .java, as it is a java source file (which is fine: it is what I need). Firstly - I'm not surprised that nothing much happens with your main panel when a tab is clicked, since you're not even listener for tab changed events. Go to the JTabbedPane docs and look at the method addChangeListener(ChangeListener l). Secondly - are you sure you want this main panel to be outside of the tabbed pane? How about having a version of the whole main panel setup in each of the tabs panes themselves? You might save yourself some bother. Not sure if that would be appropriate though, since I don't know enough about what you want to do. I just say this because you seem to be wanting to use a tabbed pane in a non-conventional way - effectively, as some radio buttons! alex ========================================================================== TOPIC: jdom + jtree http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4d3523ac3f1cc88d ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 1:07 pm From: [EMAIL PROTECTED] (Marios Koumides) I was wondering guys what is the best way to have a jtree in a java program which actually displayes nodes of Jdom tree in memory. What is best strategy to follow for updating / modifying both so they are always consistent. Thank you Marios Koumides ========================================================================== TOPIC: how my Database can send me a message? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/96ee48d269aefeb4 ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 2:18 pm From: [EMAIL PROTECTED] (Shrish) Hi John, Yeah, By host I mean 'client' where my application runs which connects to a remote database server. I am wondering how do you connect to the listening socket through your update trigger since I thought that a trigger can only perform operations on the database? It seems that there should be a way to make a call to Java I/O API from the trigger. It would be great if you can give some pointers in this direction. Thanks, Shrish "John Harlow" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Shrish wrote: > > Hi Everybody, > > > > I have a Database and two hosts- host1 and host2. When host1 makes a > > change in Database, I want Database to send a message to host2. I am > > When you say "host" do you mean java application? It's quite simple for a > java app to create a listening socket which the database can (through an > update trigger, for example) call. I do this all the time to instantly let > services know there is work ready for them. I include a poller loop too "as > a backup". I do this so often I went ahead and included the functionality > in my database connection class. > > Another less elegant way is for the database to create a file wherein the > app hooks to the OS to get file system change notifications. ========================================================================== TOPIC: Problem with mssql jdbc http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bf3235eec595bc83 ========================================================================== == 1 of 2 == Date: Mon, Nov 1 2004 2:31 pm From: "sp" <[EMAIL PROTECTED]> I can't connect with jdbc for mssql. This is the code: try { Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } try { conn = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433","username","pwd"); dmd = conn.getMetaData(); } catch (SQLException e1) { e1.printStackTrace(); } This is the error : java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source) at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171) at sgs.mssql.Prova.<init>(Prova.java:50) at sgs.mssql.VisualizzaSQL.<init>(VisualizzaSQL.java:52) at sgs.mssql.VisualizzaSQL.createAndShowGUI(VisualizzaSQL.java:114) at sgs.mssql.VisualizzaSQL.access$0(VisualizzaSQL.java:102) at sgs.mssql.VisualizzaSQL$2.run(VisualizzaSQL.java:135) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178) at java.awt.EventQueue.dispatchEvent(EventQueue.java:454) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja va:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java :151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) == 2 of 2 == Date: Mon, Nov 1 2004 3:08 pm From: Mark Thornton <[EMAIL PROTECTED]> sp wrote: > I can't connect with jdbc for mssql. > > This is the code: > > try { > Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); > } catch (ClassNotFoundException e) { > e.printStackTrace(); > } > try { > conn = > DriverManager.getConnection( > "jdbc:microsoft:sqlserver://localhost:1433","username","pwd"); > dmd = conn.getMetaData(); > } catch (SQLException e1) { > e1.printStackTrace(); > } > > > > > This is the error : > java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error > establishing socket. Are you running XP SP2 and haven't made the server an exception to the firewall (or simply turned it off)? Mark Thornton ========================================================================== TOPIC: What is Instance Initializer? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/15dac666512492d6 ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 4:00 pm From: [EMAIL PROTECTED] (hiwa) Thanks Tor and xarax. Your descriptions are very clear. I have found that JLS first edition has no section on the Instance Initializers. I think anonymous inner class should have given birth to them. ========================================================================== TOPIC: Method invocation conversion http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a84caa7322a6162d ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 4:25 pm From: Daniel Sjöblom <[EMAIL PROTECTED]> The VM spec says in chapter 4.8.2, Structural constraints: The arguments to each method invocation must be method invocation compatible (§2.6.8) with the method descriptor (§4.3.3). And 2.6.8 reads: Method invocation conversion is applied to each argument value in a method or constructor invocation: the type of the argument expression must be converted to the type of the corresponding parameter. Method invocation contexts allow the use of an identity conversion (§2.6.1), a widening primitive conversion (§2.6.2), or a widening reference conversion (§2.6.4). Method invocation conversions specifically do not include the implicit narrowing of integer constants that is part of assignment conversion (§2.6.7). While the above is obviously enforced in the java language, I find it to be imprecise when it comes to java bytecode, specifically when it comes to the 'inferior' types, ie. byte, short, char and boolean. Sun's JVM (versions 1.5.0 rc, 1.4.2) for example does *not* require casts from e.g. int to byte when calling a method taking a byte as argument, and I find it to be sensible to allow it as well (in bytecode that is). So is 2.6.8 to be interpreted simply as 'The VM will not perform any implicit narrowing conversions on method invocation, (a byte is a short is an int)' or is the Sun VM non-compliant? -- Daniel Sjöblom Remove _NOSPAM to reply by mail ========================================================================== TOPIC: why does ObjectInputStream constructor block reading a header http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7b8520ff9f293b96 ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 4:37 pm From: "Tony Morris" <[EMAIL PROTECTED]> In that case, you want to look at the java.nio package. -- Tony Morris http://xdweb.net/~dibblego/ ========================================================================== TOPIC: Off Topic: Safari Bookshelf http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3d4c237d0e60a7ee ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 4:45 pm From: Scott Ellsworth <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Love Rhino) wrote: > I'm wondering if it's any good. I'd just like to know the > feedback of those people who have used it. I love it. I had decided that it was not worth it when I did a cost-benefits analysis some months back, as for $15 a month, I could have a pretty good shelf of OReilly books by year end were I to spend the money on new books. Then a client added me to their corporate subscription while I was working on a job for them. It turned out far more useful than I expected, as I ended up doing searches over perhaps five or six books on a given topic when researching how to perform new tasks. I can compare various explanations of the same topic from different books, and I can copy/paste code snippets from several authors while noodling about. My bookshelf usually has a dozen to twenty books in it, all with various bookmarks that relate to current and anticipated needs for the projects. When the Perl project I was on spun down and one on JSP spun up, a dozen books left the shelf, and a dozen new ones appeared as searches coughed up relevant titles. > Also, the site says you can download 5 chapters at a time from > a book, I'm wondering does that mean, I can only view chapters > while I'm subscribed? I have not tried downloading any chapters; I am reading them live for the most part, thus this is a bit theoretical. That said, I believe that you are downloading complete pdfs of the relevant chapters of the book. On line, you can view any chapter you follow links to. On your harddrive, on the other hand, you will have those files you downloaded, each of which holds 5 chapters of a book. This does imply that you could scarf whole books by going on a frenzy of downloading, but this looses the cool search features, and takes time. At reasonable billing rates, it is probably cheaper just to buy the book if you find you really like it. > Or can I view them at any time (e.g. offline, > or after expired subscription), as if I 'owned' those files when I > bought them. That is my understanding. > Plus, what is the format for the books? Are their several > different formats? Books are displayed on the website in HTML, but I believe downloads are PDF. Scott [EMAIL PROTECTED] Java and database consulting for the biotech community ========================================================================== TOPIC: Alternative to change log4j logging level at runtime? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9bb8d27d79dac47f ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 5:01 pm From: [EMAIL PROTECTED] (Earth) Hi Juha, I have checked the Log4j FAQ in http://logging.apache.org/log4j/docs/faq.html#3.6 However, it suggests this features is unsafe for use in J2EE environment. QUOTE 3.6 Is there a way to get log4j to automatically reload a configuration file if it changes? Yes. Both the DOMConfigurator and the PropertyConfigurator support automatic reloading through the configureAndWatch method. See the API documentation for more details. Because the configureAndWatch launches a separate wathdog thread, and because there is no way to stop this thread in log4j 1.2, the configureAndWatch method is unsafe for use in J2EE envrironments where applications are recycled UNQUOTE I would to understand the reason and thus, I could try to design a solution to this. What does it mean by 'J2EE envrironments where applications are recycled'? Thanks in advance for any inputs and comments. Earth ========================================================================== TOPIC: stack implementation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5c909f1ce5b4696a ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 5:40 pm From: "George W. Cherry" <[EMAIL PROTECTED]> "John C. Bollinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Boudewijn Dijkstra wrote: > >> "Tor Iver Wilhelmsen" <[EMAIL PROTECTED]> schreef in >> bericht news:[EMAIL PROTECTED] > >>>it, etc. Ideally I would write my own implementation using a >>>LinkedList as an internal representation. >> >> >> Something like this perhaps? > > [Complete stack implementation including custom linked list implementation > snipped] > > Based on the fact that he specifically named the LinkedList class, I > suspect Tor meant something more like this: > > public class BetterStack { > List elements = new LinkedList(); > > public void clear() { > elements.clear(); > } > > public void push(Object o) { > elements.add(o); > } > > public Object pop() throws StackEmptyException { > try { > return elements.remove(elements.size() - 1); > } catch (IndexOutOfBoundsException ioobe) { > throw new StackEmptyException(); > } > } > > public Object peek() throws StackEmptyException { > try { > return elements.get(elements.size() - 1); > } catch (IndexOutOfBoundsException ioobe) { > throw new StackEmptyException(); > } > } > > public int getSize() { > return elements.size(); > } > > public boolean isEmpty() { > return (elements.isEmpty()); > } > } > > > Everyone enjoys reinventing the wheel, but their boss would usually prefer > that they just put the manufacturer's wheel on the car. > > > John Bollinger > [EMAIL PROTECTED] Why did you implement this with LinkedList rather than ArrayList? George ========================================================================== TOPIC: JBuilder / BlueJ question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfea91ed00a06b2c ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 5:40 pm From: "Bill Joy" <[EMAIL PROTECTED]> My guess is that you are just opening these files at random without defining a project. Assuming you only have the free Foundation version, start out doing File | New Project. Go to Project | Project Properties | Paths and on the Source tab add the root of your source tree, mark it as Default using the radiobutton, then OK. You should then be able to see your source in the Project pane. Do Project | Make for a compilation. "zcraven" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > When I open my java files (made in BlueJ) in JBuilder, it gives loads of > errors: > > 'cant resolve symbol [myclass] in class [other_myclass]? > > Basically it doesnt like any of the classes that I defined myself. How > can > I stop this from happening? I know the code is fine cos I can run it fine > from BlueJ or command prompt. > > ========================================================================== TOPIC: Code compiled with JDK1.2. Will it be compilable with JDM1.4?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7f9404acc33d0a2a ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 6:43 pm From: [EMAIL PROTECTED] (qazmlp) This is related to porting our Application to Java 1.4. Currently, we have our application code written and compiled with JDK1.2. Now, we are planning to re-compile the complete code with JDK1.4 and also use the JRE1.4 to run the application. I assume the same code should get compiled successfully with JDK1.4 as there are no Java1.2 interfaces changed/removed in Java1.4. Am I right? Could you confirm it? Thanks! ========================================================================== TOPIC: Code compiled with JDK1.2. Will it be compilable with JDK1.4?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eb71120d3dc9286e ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 6:43 pm From: [EMAIL PROTECTED] (qazmlp) This is related to porting our Application to Java 1.4. Currently, we have our application code written and compiled with JDK1.2. Now, we are planning to re-compile the complete code with JDK1.4 and also use the JRE1.4 to run the application. I assume the same code should get compiled successfully with JDK1.4 as there are no Java1.2 interfaces changed/removed in Java1.4. Am I right? Could you confirm it? Thanks! ========================================================================== TOPIC: Java 1.5.0 - shared memory mode blows up http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8a09d7cb09fae534 ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 6:52 pm From: "Alexandr Molochnikov" <[EMAIL PROTECTED]> I got the following error when trying to start JVM with -Xshare:on option on Win XP Pro. The VM quit with the following message: Error occurred during initialization of VM Unable to use shared archive. An error has occured while processing the shared archive file. A jar file is not the one used while building the shared archive file. I regenerated the shared archive according to the Sun's instructions in http://java.sun.com/j2se/1.5.0/docs/guide/vm/class-data-sharing.html, and now get this error: Error occurred during initialization of VM Unable to use shared archive. An error has occured while processing the shared archive file. Unable to reserve shared region. Does anyone know what this means? Alex Molochnikov Gestalt Corporation ========================================================================== TOPIC: _scripting engines for java applications_ http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/39a65441a241e46a ========================================================================== == 1 of 1 == Date: Mon, Nov 1 2004 7:05 pm From: [EMAIL PROTECTED] (Konijn) Andrey Romanenko <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hi All, > > I've written java app with classes that strickly corresponds to user's > business domain. Now I want to add scripting feature to my program to > enable user to create own scenarios of processing objects of those > business classes. Where to start? Is there any scripting languages > implemented in java? Several. Judoscript is one, http://www.judoscript.com. I would suggest to look into BNF (Bean Scripting Framework (http://jakarta.apache.org/bsf/index.html) ) support for your application. If you dont like one language, you can always change to another one > > thanks, > > Andrey ======================================================================= 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
