comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* local disk based JDBC implementation - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3bcd34f5eb202fef
* has someone seen this error before? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f8e9f76b902386f4
* Stack trace ALL exceptions? - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/540a5bc35537462c
* NullPointerException with FileInputStream - 4 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/31f437f0b81b32cd
* Passing Servlet Context to a non servlet object. - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ea7f86915490db6b
* regex replace \\ by \ - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9f662bcf0fda45f7
* java does not trigger on my mouse events - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/34f1471cbf5a31c9
* Global Servlet Filter - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7d63140db52052d6
* "Could not find main-class" - 3 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/631c41f6c0ad1a67
* Coverting Ascii Hexidecimal Number - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d845951875c2539
* How to "VIEW" Java Class Files? - 5 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e1173c5cb8c432f1
* Embed a java-compiler in java. - 1 messages, 0 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d2a97cca8f943
* Need help with Tomcat/JSP website design - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48119caa527a8ff0
* Building an Exception Layer - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8359d1a0e5422fb
  
==========================================================================
TOPIC: local disk based JDBC implementation
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3bcd34f5eb202fef
==========================================================================

== 1 of 3 ==
Date:   Wed,   Nov 3 2004 7:14 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

I'm looking for local disk storage based JDBC implementations (i.e. one 
that stores the database in files on disk, the exact format isn't important)

I've found a few already:


http://www.csv-jdbc.com/ (commercial)

http://hsqldb.sourceforge.net/ -  in memory or on disk database.

http://www.servletguru.com/downloads.htm (see SimpleText.zip, is a text 
JDBC driver)


Just wondering if anyone is using or knows of any more that I've missed 
from my above list!

thanks
alex



== 2 of 3 ==
Date:   Wed,   Nov 3 2004 7:50 am
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> 

Don't know if you're using Windows or not, but if you are you might be
able to use the JDBC/ODBC bridge with the Microsoft text or Excel ODBC
drivers.




== 3 of 3 ==
Date:   Wed,   Nov 3 2004 8:12 am
From: Juha Laiho <[EMAIL PROTECTED]> 

Alex Hunsley <[EMAIL PROTECTED]> said:
>I'm looking for local disk storage based JDBC implementations (i.e. one 
>that stores the database in files on disk, the exact format isn't important)
>
>I've found a few already:
>
>http://www.csv-jdbc.com/ (commercial)
>
>http://hsqldb.sourceforge.net/ -  in memory or on disk database.
>
>http://www.servletguru.com/downloads.htm (see SimpleText.zip, is a text 
>JDBC driver)
>
>Just wondering if anyone is using or knows of any more that I've missed 
>from my above list!

Derby; a project recently donated to Apache by IBM. Like hsqldb; don't
know what are the actual differences.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)




==========================================================================
TOPIC: has someone seen this error before?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f8e9f76b902386f4
==========================================================================

== 1 of 2 ==
Date:   Wed,   Nov 3 2004 7:16 am
From: "John C. Bollinger" <[EMAIL PROTECTED]> 

Jeff wrote:

> I would greatly appreciate some good advice on a problem that has eluded us.
> 
> Our server has what appears to be a network IO problem under load.   We have 
> seen one instance of an error message that we think is a strong clue:
> java.net.SocketException: Insufficient buffer space
> 
> However, we can't find any documentation on what this error means?  Which 
> buffer space?

I don't _know_, but a good guess would be that the exception wraps an 
error signaled by the OS' native socket implementation.  The buffer 
would be one of the socket's native I/O buffers.  Such an error probably 
means that you have too many active sockets, whether because there are 
many sockets simultaneously in use or because discarded sockets are not 
cleaned up.  How many is too many would depend in part on system 
resources, including file descriptors and kernel memory among other things.

It might not be the core problem, but you should be sure _always_ to 
close() sockets when you are done with them.  Typically you would ensure 
this by putting the close() invocation in a finally {} block associated 
with a suitably scoped try {} block.

> ARCHITECTURE
> 1. our probe sends large volumes of data to our server
> 2. the probe-server connection is tcp carrying proprietary data
> 3. at times, our probe definitely sends more data than the server can 
> process.  We expected tcp congestion control to throttle the probe.
> 
> OPTIMIZATIONS COMPLETED
> 1. set the socket's receiveBufferSize to 32768

I don't know how that compares to the system default, but you cannot 
hope to make the situation (running out of buffer space) better by 
setting this larger than the system's default.

> 2. set the the buffered input stream's buffer size to 1024000

This is unlikely to be the problem.  On the other hand, it's also very 
much larger than is likely to be useful.

Did you make these "optimizations" in response to actual system 
performance problems?  Did they demonstrably help?  If not, then I'd 
tear them back out until (at least) you have fixed your immediate problem.

> SYMPTOMS
> 1. data in buffer returned by inputStream.read() appears to be off by 2 or 3 
> bytes

I'm not sure what that means.  Bytes are being dropped?  A few bytes are 
incorrect?  Those would be very bad signs, but probably indications of a 
native system-level problem.  On the other hand, if you just mean that 
you are receiving fewer bytes at a time than the receive buffer size 
(but no bytes are dropped) then that is perfectly reasonable.

> 2. no tcp congestion control (advertised window does not decrease)

Whether or not congestion control goes into effect is definitely in the 
realm of the system's network stack.  I don't know offhand what specific 
conditions would be expected to bring it into play.  I assume you have 
already confirmed that that feature is in fact built into your network 
stack and enabled.  It is conceivable, though not required (as far as I 
can tell), that some particular TCP implementation might disable 
congestion control on a socket after the receive buffer size is manually 
set on it.

> 3. according to the server's operating system stats, the receiver queue 
> builds up

That shows that the server is not keeping up with the data stream, but 
I'm not sure what other conclusions we are supposed to draw from it.

> 4. data input rate is 7 to 8 Meg continuous.

That's the rate at which the server is inputting the data or the 
utilization level of the wire?  Not that it much matters -- without 
hardware and OS details the number is not especially meaningful.

> ENVIRONMENT
> - running BEA's JRockit JVM
> - both SuSE 8.2 and WinXP.
> - Lot of processing on the buffer returned by the read call is available for 
> garbage collection

None of a BufferedInputStream's read() methods returns a buffer.  Two of 
them store bytes in a buffer provided to them.  Whether or not this 
buffer is eligible for garbage collection is not likely to be directly 
relevant to the question, but you might want to recognize that 
performance will be negatively affected by frequent allocation (and 
concomitant initialization) of medium- to large-size arrays.  These 
buffers are unrelated to a socket's native I/O buffers.

> SERVER'S SOCKET CODE
> Socket probeSocket = sock.accept();
>  if ( probeSocket.getReceiveBufferSize() < 32768 ) 
> probeSocket.setReceiveBufferSize(32768);

I'd recommend instead that you set the default receive buffer size on 
your ServerSocket, and then live with what you actually get instead of 
testing each accepted socket.  Note also that although a large buffer 
helps with throughput if you have high volume over individual 
connections, but it may not help (and might even hurt) if you have a 
large number of connections with small average volume.  For instance, if 
the average amount of data transmitted over each socket connection is 1K 
then over 95% of your buffer space is going unused.  That buffer space 
will live in kernel memory, which may be considerably more restricted 
than user memory.

>  BufferedInputStream is = new BufferedInputStream( 
> probeSocket.getInputStream(), 1024000 );

As I wrote above, that's a _much_ larger buffer than typically gives 
advantage.  If you have many connections and you do this for each then 
you are probably reducing your throughput.

If you have performance problems then _test_ (by profiling) where the 
bottlenecks are before you set out to improve matters, and _test_ after 
tuning to verify that you have in fact helped things.


John Bollinger
[EMAIL PROTECTED]



== 2 of 2 ==
Date:   Wed,   Nov 3 2004 7:20 am
From: "Jeff" <[EMAIL PROTECTED]> 


"Louis" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote...
>> Seems more like a queue limitation, rather than buffer.
>> Do you have a setting like "tcp_conn_request_max" and what (if any) does 
>> it
>> say?
>
> I believe the OP stated it was a single connection that was
> saturated.
>

Correct - it's a single connection that generates the error 






==========================================================================
TOPIC: Stack trace ALL exceptions?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/540a5bc35537462c
==========================================================================

== 1 of 3 ==
Date:   Wed,   Nov 3 2004 7:08 am
From: kaeli <[EMAIL PROTECTED]> 


Hey all,

In my code (JSP), when I catch an exception and print the stack trace, it 
isn't giving me the full error like I see in the server logs.
Any hints on how to get the entire error message? (the "caused by" part most 
important)

For example, looking at this message, WAY at the bottom, you can see the real 
problem was the unparseable date.

The server logs:
[03/Nov/2004:08:33:03] failure (13157): Internal error: servlet service 
function had thrown ServletException (uri=/ops_b
eta/events_retrofit_updateNow.jsp): org.apache.jasper.JasperException, stack: 
org.apache.jasper.JasperException         
        at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:199)                     
        at org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146)                           
        at _jsps._ops_beta._events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:138)          
        at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)                                          
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)                
                                 
        at 
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915)               
        at com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)                            
, root cause: java.lang.reflect.InvocationTargetException                              
                                 
        at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)                
                                 
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)                        
        at java.lang.reflect.Method.invoke(Method.java:324)                            
                                 
        at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:195)                     
        at org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146)                           
        at _jsps._ops_beta._events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:138)          
        at org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:119)                                          
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)                
                                 
        at 
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915)               
        at com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)                            
Caused by: java.text.ParseException: Unparseable date: " "                             
                                 
        at java.text.DateFormat.parse(DateFormat.java:334)                             
                                 
        at OPS_Beans_20.OPS_EventBean.setSchPrelimDueDate
(OPS_EventBean.java:435)                                       
        ... 10 more     


Yet when I just do exception.printStackTrace in the JSP code, I get only the 
first few lines, thus making it impossible to see what the problem was.

>From the JSP:
Message: null
Stack Trace: org.apache.jasper.JasperException at 
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper
(JspRuntimeLibrary.java:199) at 
org.apache.jasper.runtime.JspRuntimeLibrary.introspect
(JspRuntimeLibrary.java:146) at _jsps._ops_beta.
_events_retrofit_updateNow_jsp._jspService
(_events_retrofit_updateNow_jsp.java:148) at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
com.iplanet.server.http.servlet.NSServletRunner.invokeServletService
(NSServletRunner.java:915) at 
com.iplanet.server.http.servlet.NSServletRunner.Service
(NSServletRunner.java:483)   

JSP code:
catch (Exception e)
   {
   String errMsg = e.getMessage();
   %>
   <p class="bigAttention">Message: <%= errMsg %></p>
   <p>Stack Trace: 
   <%
   StringWriter sw = new StringWriter();
   PrintWriter pw = new PrintWriter(sw);
   e.printStackTrace(pw);
   out.print(sw);
   sw.close();
   pw.close();
}

-- 
--
~kaeli~
Never argue with an idiot! People may not be able to tell 
you apart.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace




== 2 of 3 ==
Date:   Wed,   Nov 3 2004 8:30 am
From: Sudsy <[EMAIL PROTECTED]> 

kaeli wrote:
> Hey all,
<snip>

Hey back at ya!

> The server logs:
> [03/Nov/2004:08:33:03] failure (13157): Internal error: servlet service 
> function had thrown ServletException (uri=/ops_b
> eta/events_retrofit_updateNow.jsp): org.apache.jasper.JasperException, stack: 
<snip>

Note that you've received a JasperException. Using javap on jasper.jar shows
that the exception extends ServletException. Using javap on servlet.jar
reveals a method named getRootCause. So now we know enough to extend your
code.

> JSP code:
> catch (Exception e)
>    {
>    String errMsg = e.getMessage();
>    %>
>    <p class="bigAttention">Message: <%= errMsg %></p>
>    <p>Stack Trace: 
>    <%
>    StringWriter sw = new StringWriter();
>    PrintWriter pw = new PrintWriter(sw);
>    e.printStackTrace(pw);
>    out.print(sw);

     if( e instanceof ServletException ) {
         pw.println( "Root cause:" );
         ( (ServletException) e ).getRootCause().printStackTrace( sw );
     }

>    sw.close();
>    pw.close();
> }
> 

Do I even need to mention that the javadocs (and javap) are your
friends?   ;-)

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 3 of 3 ==
Date:   Wed,   Nov 3 2004 8:54 am
From: kaeli <[EMAIL PROTECTED]> 

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
enlightened us with...
> 
> > The server logs:
> > [03/Nov/2004:08:33:03] failure (13157): Internal error: servlet service 
> > function had thrown ServletException (uri=/ops_b
> > eta/events_retrofit_updateNow.jsp): org.apache.jasper.JasperException, stack: 
> <snip>
> 
> Note that you've received a JasperException. Using javap on jasper.jar shows

javap?
I'll  have to look up that little dandy.

> that the exception extends ServletException.

Apparently not for Netscape Enterprise Server it doesn't. The code failed. 
Well, more specifically, the instanceof evaluated to false, so it didn't do 
anything bad, but didn't help, either.
I'm going to play with this a bit...

Thanks for the hint.


-- 
--
~kaeli~
Never argue with an idiot! People may not be able to tell 
you apart.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace





==========================================================================
TOPIC: NullPointerException with FileInputStream
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/31f437f0b81b32cd
==========================================================================

== 1 of 4 ==
Date:   Wed,   Nov 3 2004 7:20 am
From: Mark F <[EMAIL PROTECTED]> 

For some reason I'm getting an NPE at this line:

       fis = new FileInputStream(HitCountFilter.HITS_FILENAME);

HITS_FILENAME is a static variable that is set to "C:\\hits.ser"

Counter is a simple object with a funcion that is self-explanatory.  It 
implements serializable.

Here is the code:


   public void init(FilterConfig fc) throws ServletException {
     this.filterConfig = fc;
     FileInputStream fis = null;
     ObjectInputStream ois = null;

     try {
       fis = new FileInputStream(HitCountFilter.HITS_FILENAME);
     }
     catch (FileNotFoundException ex) {
      ...
     }
     catch (NullPointerException npe) {
      ...
     }
     try {
       if (fis != null) {
         ois = new ObjectInputStream(fis);
         count = (Counter) ois.readObject();
       }
       else {
         count = new Counter(0);
       }
     }
     catch (ClassNotFoundException ex2) {
      ...
     }
     catch (IOException ex2) {
       ...
     }
     finally {
       try {
         ois.close();
         fis.close();
       }
       catch (IOException ex3) {
         ...
       }
     }
   }



== 2 of 4 ==
Date:   Wed,   Nov 3 2004 8:22 am
From: "Mike Schilling" <[EMAIL PROTECTED]> 


"Mark F" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> For some reason I'm getting an NPE at this line:
>
>       fis = new FileInputStream(HitCountFilter.HITS_FILENAME);
>
> HITS_FILENAME is a static variable that is set to "C:\\hits.ser"

Wild guess:

Call the file containing the line quoted above "Reader.java".  At one time, 
HITS_FILENAME  was declared like:

    public static final String HITS_FILENAME ;

Then Reader.java was compiled.

Next, the declaration of HITS_FILENAME was changed to

    public static final String HITS_FILENAME = "c:\\hits.ser";

but Reader.java was not recompiled.  Since a Java compiler grabs the value 
of public static final variables at compile time (if they're scalars or 
Strings), Reader.class still passes the constructor a null.  Try recompiling 
it. 





== 3 of 4 ==
Date:   Wed,   Nov 3 2004 8:33 am
From: Sudsy <[EMAIL PROTECTED]> 

Mark F wrote:
> For some reason I'm getting an NPE at this line:
> 
>       fis = new FileInputStream(HitCountFilter.HITS_FILENAME);
<snip>

Are you absolutely sure? A quick check of the javadocs shows that the
only exceptions that the constructor you're using will throw are
FileNotFoundException and SecurityException. Have you tried invoking
printStackTrace on the caught exception?

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 4 of 4 ==
Date:   Wed,   Nov 3 2004 8:47 am
From: Mark F <[EMAIL PROTECTED]> 

Mike Schilling wrote:
> "Mark F" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> 
>>For some reason I'm getting an NPE at this line:
>>
>>      fis = new FileInputStream(HitCountFilter.HITS_FILENAME);
>>
>>HITS_FILENAME is a static variable that is set to "C:\\hits.ser"
> 
> 
> Wild guess:
> 
> Call the file containing the line quoted above "Reader.java".  At one time, 
> HITS_FILENAME  was declared like:
> 
>     public static final String HITS_FILENAME ;
> 
> Then Reader.java was compiled.
> 
> Next, the declaration of HITS_FILENAME was changed to
> 
>     public static final String HITS_FILENAME = "c:\\hits.ser";
> 
> but Reader.java was not recompiled.  Since a Java compiler grabs the value 
> of public static final variables at compile time (if they're scalars or 
> Strings), Reader.class still passes the constructor a null.  Try recompiling 
> it. 
> 
> 
Nope, declared and initialized on a single line, just as you have it 
written.  Also, I've probably compiled the thing a couple hundred times 
by now trying to get it to work.

Thanks though,
-Mark




==========================================================================
TOPIC: Passing Servlet Context to a non servlet object.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ea7f86915490db6b
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 7:26 am
From: Chris Smith <[EMAIL PROTECTED]> 

Andrew Purser wrote:
> Basically I have created a Something java class that I want to call
> from a servlet. The catch is I want the Something java class to
> include Jsps depending on various things. The only way I can see to do
> this if for my servlet to pass the ServletContext, HttpRequest and
> HttpResponse to the class. I get the feeling this may be a bad thing
> to do. Can someone enlighten me?

There's nothing inherently wrong with passing the ServletContext and the 
ServletRequest and ServletResponse outside of the servlet class.  There 
are some concerns in some cases, though, specifically with code re-use.  
If your goal is to include JSPs, then it seems you probably don't intend 
to use this outside of a servlet environment, so you're probably okay.  
If you needed something more reusable, you'd need to consider other 
options.

-- 
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation




==========================================================================
TOPIC: regex replace \\ by \
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9f662bcf0fda45f7
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 7:30 am
From: "John C. Bollinger" <[EMAIL PROTECTED]> 

Stephan Ehlert wrote:
> I have a problem with java.regex. In a given String \\ has to be replaced by \
> 
> My code leads to the following exception:
> java.lang.StringIndexOutOfBoundsException: String index out of range: 1
>   at java.lang.String.charAt(String.java:444)
>   at java.util.regex.Matcher.appendReplacement(Matcher.java:551)
> 
> 
> This is my code:
> ...
> Pattern p = Pattern.compile("\\\\");
> Matcher m = p.matcher(s);                
> StringBuffer sb = new StringBuffer();
> boolean result = m.find();
> while(result) {
>   m.appendReplacement(sb, "\\");
>   result = m.find();
> }
> m.appendTail(sb);
> System.out.println(sb.toString());

The backslash character is tricky.  It is a metacharacter in both Java 
source and in a Java regex.  A literal single backslash character in a 
regex that appears in Java source as a String literal must therefore be 
double escaped: "\\\\".  That's a String literal containing two 
backslashes (each escaped), which will be interpreted as one literal 
backslash by the regex engine.  Note, however, that you only need one 
level of escaping for a String literal that will not be processed as a 
regex (such as the replacement text).  Finally, consider using 
String.replaceAll() to accomplish this feat -- it is much cleaner than 
what you are attempting (although it does something similar behind the 
scenes).  Put that all together for your solution.


John Bollinger
[EMAIL PROTECTED]




==========================================================================
TOPIC: java does not trigger on my mouse events
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/34f1471cbf5a31c9
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 7:37 am
From: [EMAIL PROTECTED] (karl wettin) 

"Ann" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> "karl wettin" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hello groups,
> >
> > sorry for the cross-post, but I'm not sure where this question
> > belongs.
> >
> > Java applications does not detect my mouse/listen to mouse events. I
> > have no clue why not. Anyone of you that have an idea of what might be
> > wrong? It worked just fine before I replaced my harddrive and
> > reinstalled Gentoo. The major diffrence is that I now run xorg and
> > gnome 2.6. It used to be xfree and gnome 2.4.
> 
> Do you have a listener?

Listener?

I solved it by installing Ubuntu and Xfree86, but I would still like
to know what might have been wrong.

-- 

  karl




==========================================================================
TOPIC: Global Servlet Filter
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7d63140db52052d6
==========================================================================

== 1 of 2 ==
Date:   Wed,   Nov 3 2004 7:40 am
From: "John C. Bollinger" <[EMAIL PROTECTED]> 

Mark F wrote:

> I'm writing a servlet filter that will keep track of the number of hits 
> for my site but the site is composed of several web applications.  I'd 
> like to write it in such a way as to allow it to work with all of the 
> applications at one time, instead of tallying individual counts by hand.

You are barking up the wrong tree.  The servlet spec does not provide 
for objects scoped wider than a single web application.  It might be 
that you could play tricks with a shared object, but making it work 
correctly would be container-dependent.  Since you need a 
container-dependent solution anyway, why don't you look at configuration 
options for your container?


John Bollinger
[EMAIL PROTECTED]



== 2 of 2 ==
Date:   Wed,   Nov 3 2004 8:18 am
From: Mark F <[EMAIL PROTECTED]> 

John C. Bollinger wrote:
> Mark F wrote:
> 
>> I'm writing a servlet filter that will keep track of the number of 
>> hits for my site but the site is composed of several web 
>> applications.  I'd like to write it in such a way as to allow it to 
>> work with all of the applications at one time, instead of tallying 
>> individual counts by hand.
> 
> 
> You are barking up the wrong tree.  The servlet spec does not provide 
> for objects scoped wider than a single web application.  It might be 
> that you could play tricks with a shared object, but making it work 
> correctly would be container-dependent.  Since you need a 
> container-dependent solution anyway, why don't you look at configuration 
> options for your container?
> 
> 
> John Bollinger
> [EMAIL PROTECTED]

Thanks, I'll look into it.

-Mark




==========================================================================
TOPIC: "Could not find main-class"
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/631c41f6c0ad1a67
==========================================================================

== 1 of 3 ==
Date:   Wed,   Nov 3 2004 8:03 am
From: Tarlika Elisabeth Schmitz <[EMAIL PROTECTED]> 

Hello,

I am encountering the following problem with my webstart application:

The application consists of a couple of dozen jar files. I specify the 
main class via
<application-desc main-class="app.Main"/>
but it is only found if the jar file containing the main class is the 
first listed in <resources>. If this jar file is not the first the above 
error occurs.

This is a nuisance as I am generating the JNLP file with an Ant task 
using fileset for the list of resources 
(http://www.roxes.com/produkte/rat.html) and the main jar file 
inevitably doesn't end up at the top.

Is this a feature? Is there a work-around?


Set-up: Sun's SDK 1.4.2_01 on Win2K

-- 


Regards/Gruß,

Tarlika Elisabeth Schmitz



== 2 of 3 ==
Date:   Wed,   Nov 3 2004 8:31 am
From: Andrew Thompson <[EMAIL PROTECTED]> 

On Wed, 03 Nov 2004 16:03:46 +0000, Tarlika Elisabeth Schmitz wrote:

> I am encountering the following problem with my webstart application:
> 
> The application consists of a couple of dozen jar files. I specify the 
> main class via
> <application-desc main-class="app.Main"/>
> but it is only found if the jar file containing the main class is the 
> first listed in <resources>. If this jar file is not the first the above 
> error occurs.

Untested.. have you tried..
<jar href="YourMainJar.jar" download="eager"/> ?

-- 
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



== 3 of 3 ==
Date:   Wed,   Nov 3 2004 8:45 am
From: [EMAIL PROTECTED] (Bent C Dalager) 

In article <[EMAIL PROTECTED]>,
Tarlika Elisabeth Schmitz  <[EMAIL PROTECTED]> wrote:
>
>Is this a feature? Is there a work-around?

I think it's an artifact of a different feature. In short, if you do
not specify a main-class in the jnlp file, jws will use the main-class
it finds in the manifest file of the first jar file in the resource
section. This is all well and nice of course, but it appears to me to
have the side effect that even if you _do_ specify a main-class, it
still only looks for it in the first jar file.

I wrote my own ANT task to sort the file names with my main jar on
top.

Cheers
        Bent D
-- 
Bent Dalager - [EMAIL PROTECTED] - http://www.pvv.org/~bcd
                                    powered by emacs




==========================================================================
TOPIC: Coverting Ascii Hexidecimal Number
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d845951875c2539
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 8:07 am
From: Thomas Weidenfeller <[EMAIL PROTECTED]> 

JVSFugitive wrote:
> Interesting problem to solve here:

Interesting? Well ... Please consider posting beginner's questions to 
comp.lang.java.help in the future.

> I have an ASCII representation of an integer such as "FF". It is stored 
> in my Java app as array byte[2] = { 70, 70 };

Using bytes for chars in not a good idea in Java. If you can, change 
them to chars.

> i.e. FF = 1111 1111 binary = 255 decimal
> "FF" as ascii representation = { 70, 70 };

Assuming Java 1.5:

  byte aBytes[] = new byte[] {70, 70};
  int i = Character.digit(aBytes[0] & 0xFF, 16) * 16
          + Character.digit(aBytes[1] & 0xFF, 16);


/Thomas




==========================================================================
TOPIC: How to "VIEW" Java Class Files?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e1173c5cb8c432f1
==========================================================================

== 1 of 5 ==
Date:   Wed,   Nov 3 2004 8:14 am
From: "System User" <[EMAIL PROTECTED]> 

Hello,

I have searched to no avail on this question.

Does anyone know how to view the grapical (menu) output of a JAVA class
file?

I am not interested in the code behind the scene, but rather the
executed/parsed output.

I have some java class files that create various menus and I need to take
screen captures of those menus.

Please excuse any apparent ignorance with Java.

Any assistance will be very much appreciated.

Thanks,

Jim






== 2 of 5 ==
Date:   Wed,   Nov 3 2004 8:16 am
From: Joona I Palaste <[EMAIL PROTECTED]> 

System User <[EMAIL PROTECTED]> scribbled the following:
> Hello,

> I have searched to no avail on this question.

> Does anyone know how to view the grapical (menu) output of a JAVA class
> file?

Please accurately define the "graphical (menu) output of a Java class
file". Is it some sort of GUI window the code displays when run?

> I am not interested in the code behind the scene, but rather the
> executed/parsed output.

The same question applies here.

> I have some java class files that create various menus and I need to take
> screen captures of those menus.

I figure what you would want to do is write a Java program around your
class files, adding code that calls the code that creates the various
menus. Then simply run your program and take screen captures.

-- 
/-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"The trouble with the French is they don't have a word for entrepreneur."
   - George Bush



== 3 of 5 ==
Date:   Wed,   Nov 3 2004 8:20 am
From: Thomas Weidenfeller <[EMAIL PROTECTED]> 

System User wrote:
> Hello,
> 
> I have searched to no avail on this question.

Please do not multi-post.


> Does anyone know how to view the grapical (menu) output of a JAVA class
> file?

Please consider using terminology which is understandable for other 
programmers.

> I have some java class files that create various menus and I need to take
> screen captures of those menus.

Then run the program and take them. Or use java.awt.Robot and write some 
code to generate them from the program.


> Please excuse any apparent ignorance with Java.

Please take some time to learn the basics, like running your program 
(which frankly, a programmer should be able to do, don't you think?). We 
are not a 24*7 help desk for people not willing to learn anything about 
the language they are dealing with.

/Thomas



== 4 of 5 ==
Date:   Wed,   Nov 3 2004 8:57 am
From: <@> 

which o.s.?

Why don't you simply take a screenshot? It'd be easier than anything else.
(e.g. for Win: the PrintScreen key on your keyboard and then a "paste"
inside any paint application)

bye!













----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---



== 5 of 5 ==
Date:   Wed,   Nov 3 2004 8:58 am
From: "System User" <[EMAIL PROTECTED]> 

Thanks for the replies.  I appreciate it. :-)

Jim


"System User" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I have searched to no avail on this question.
>
> Does anyone know how to view the grapical (menu) output of a JAVA class
> file?
>
> I am not interested in the code behind the scene, but rather the
> executed/parsed output.
>
> I have some java class files that create various menus and I need to take
> screen captures of those menus.
>
> Please excuse any apparent ignorance with Java.
>
> Any assistance will be very much appreciated.
>
> Thanks,
>
> Jim
>
>
>






==========================================================================
TOPIC: Embed a java-compiler in java.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6d2a97cca8f943
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 8:20 am
From: <@> 

I'm looking for a (hopefully open-source) java-compiler to embed in a wider
java archive.

i.e. I need something - a class - that take sources (".java") and libs
(".class") and outputs a new archive (".class") without external resources.
Moreover it would be good if I could compile data without taking external
files (at least for the ".java" files) maybe passing one or more
Stringbuffer variables.

Thankx.




----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---




==========================================================================
TOPIC: Need help with Tomcat/JSP website design
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48119caa527a8ff0
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 8:18 am
From: Alex Hunsley <[EMAIL PROTECTED]> 

zenshade wrote:
> I have been tasked with creating a website for my company. It
> basically just needs to hold some documents with emergency contact
> numbers and instructions. Also, though, these documents need to be
> updated via the website and saved to the server. My experience with
> web site design is rather limited (mostly just simple html), but I do
> know that javascript alone will not cut it. Though not strictly
> required (I could get away with using PHP or perl cgi), I'm choosing
> to use Tomcat and JSP since these are technologies my company uses for
> other projects. I guess I'm just looking for something like an
> architectural project outline, pitfalls to watch out for, and
> suggestions how to quickly get the site up and running. I've got
> Tomcat installed and working, so mostly I need help with the JSP side
> of things, i.e. is JSP going to be enough, or will there also have to
> be some servlet programming, etc. Or, are there any packages out there
> to do this rather quickly and painlessly?

It sounds a little like you're trying to stroke a kitten with a hammer: 
overkill.
If you need a database backed site, consider looking at existing content 
management systems rather than trying to write one from scratch in a 
very short amount of time (when you're not experienced in the field 
either)...

alex




==========================================================================
TOPIC: Building an Exception Layer
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8359d1a0e5422fb
==========================================================================

== 1 of 1 ==
Date:   Wed,   Nov 3 2004 8:10 am
From: "Rizwan" <[EMAIL PROTECTED]> 

ok so all four exceptions has to be inherited from BaseException. thanks

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Rizwan" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> > what i can think of is that PermissionException and
BusinessRulesException
> > inherites from Exception while StructureException and DAOException
inherites
> > from RuntimeException.
> >
> > "Rizwan" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I am trying to build an Exception Layer for a new system. The
exceptions I
> > > want to catch are :
> > > * system/configuration failures e.g., Hibernate configuration file
missing
> > > etc. (StructureException)
> > > * system access voilation e.g. wrong user id etc.
(PermissionException)
> > > * business rules voilation (BusinessRulesException)
> > > * data access voilation (DAOException)
> > >
> > > My question is should these above Exception sub-classes be inherited
from
> > > Exception or RuntimeException? Please explain why?
> > >
> > > In this system I am planning to use Hibernate and Struts.
> >  StructureException
> > > will be used in Hibernate and Struts initialization. I was thinking
about
> > > creating 2 classes HibernateStructureException and
> >  StrutsStructureException
> > > inherited from StructureException and using them in respective code.
What
> >  do
> > > you guys think?
> > >
> > > Thanks
> > >
> > > Thanks
> > >
> > >
>
> Don't inherit from RuntimeException. See
> http://java.sun.com/docs/books/tutorial/essential/exceptions/runtime.html
>
> .ed
>
> www.EdmundKirwan.com - Home of The Fractal Class Composition





=======================================================================

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 

Reply via email to