| Debugging java sevlet with Eclipse |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- JButton - Set font to fillHi,
I want to create the best fitting font for my jbutton, so when the user
expands the UI, the JButton expands or shrinks, so I then change the size of
the font to fill the button correctly..
I am trying something like this on component resize:
- 4
- [ANNOUNCE] Apache Derby 10.4.1.3 releasedThe Apache Derby project is pleased to announce a new feature release
of Derby, 10.4.1.3.
Apache Derby is a subproject of the Apache DB project.
Derby is a pure Java relational database engine which conforms to the
ISO/ANSI SQL and JDBC standards. Derby aims to be easy for developers
and end-users to work with.
Derby 10.4.1.3 can be obtained from the Derby download site:
http://db.apache.org/derby/derby_downloads.html.
Derby 10.4.1.3 introduces the following new capabilities:
* Asynchronous Replication
Allows you to maintain an up to date copy of your (master) database on
a different host (the slave). In the case of a crash on the master
database you can perform failover to the copy (slave database) and
continue serving client requests against your database.
* Security
o Shutting down the Network Server now supports user authentication,
and in fact requires credentials when authentication is enabled.
* SQL
o Table Functions. Using table functions and standard SQL, you can pose
sophisticated queries against in-memory collections, flat files, web
resources, non-relational databases, etc.. Table functions also let
you efficiently import data from web feeds, sensor logs, and other
relational databases.
o Unique constraints on nullable columns.
o SQL ROW_NUMBER() window function, (for an empty, inlined window
specification).
o Bracketed comments (/* ... */).
* Performance and Memory Usage
o New buffer manager with better concurrency.
o Statement cache in the client driver.
o Caching of isolation level and current schema in the client
driver.
* Administration
o Java Management Extensions (JMX) for Derby, allowing
local and remote monitoring and management of running Derby instances
(embedded or Network Server).
o Continuation prompt. ij adds a short "> " prompt to the next line
after a newline has been entered by the user without ending the
statement with a semicolon.
Derby 10.4.1.3 also has many bugfixes, including the fix for
DERBY-3347 which can cause unrecoverable database corruption. All
10.3 users are encouraged to upgrade to avoid potential corruption
issues.
--
Regards,
Dyre
- 6
- 6
- Data generatorDo You know if there is any data generator for databases like TurboData,
but for free?
- 7
- Static Variables and JAR FilesI am curious - does the scope of static variables carry across
different JAR files?
Here's the issue:
BaseClass is in "BaseClasses.jar"
ExtendedClassA extends BaseClass is in "AnotherPackage.jar"
ExtendedClassB extends BaseClass is in "EvenAnotherPackage.jar"
BaseClass has a static object (ObjectX). Now, normally, this static
object is static across all of the subclasses. However...
These JAR files (AnotherPackage and EvenAnotherPackage) are being read
in by a separate tool. When ExtendedClassA and ExtendedClassB are
used within the context of this tool, ObjectX is instantiated twice
and has two separate values. As far as I can tell, the tool runs
ExtendedClassA and ExtendedClassB within the same JVM, so I am unsure
of what is going on.
Does anybody have any insight into what is going on here? (Sorry for
being vague. I'm not actually working the project, but I'm curious
from an academic standpoint. Another group ran across this problem
today.)
- 7
- IE AutomationI am working on developing a test application in java. I use java for UI
only. I use JNI to communicate with a VC MFC DLL. I launch an IE browser
instance in one JNI method (init()), which works fine.
OleInitialize(NULL);
CLSID clsid;
CLSIDFromProgID(OLESTR("InternetExplorer.Application"), &clsid);
HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (void**)&m_spBrowser);
I store the browser pointer (IWebBrowser2 *) as a C++ class instance
variable. BTW, I start a
thread on the native side (_beginthread) which in turn calls the method that
launches the browser.
Previously I was facing the problem of marshalling, the IWebBrowser2 pointer
was getting correupted, when used in different methods (even the simple
properties of IWebBrowser2 (like IWebBrowser2::fullname) were not
accessible). So now I have added the code of marshalling after the browser
is launched. In almost all the other methods, I first unmarshall the
interface and then marshall it back at the end of it. This solved my earlier
mentioned problem.
void CIECanvas::MarshallInterface()
{
HRESULT hr;
if(SUCCEEDED(hr = ::CreateStreamOnHGlobal(NULL, TRUE, &pstm)))
{
LARGE_INTEGER bZero = {0, 0};
pstm->Seek(bZero, STREAM_SEEK_SET, NULL);
if(SUCCEEDED(::CoMarshalInterface(pstm, IID_IWebBrowser2, m_spBrowser,
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL)))
{
pstm->Seek(bZero, STREAM_SEEK_SET, NULL);
}
}
}
void CIECanvas::UnmarshallInterface()
{
LARGE_INTEGER bZero = {0, 0};
pstm->Seek(bZero, STREAM_SEEK_SET, NULL);
HRESULT hr = ::CoUnmarshalInterface(pstm, IID_IWebBrowser2,
(void**)&m_spBrowser);
if(FAILED(hr))
{
showMessageBox("CIECanvas::UnmarshallInterface()", "%s %ld", "FAILED.
ERROR CODE = ", GetLastError());
}
}
Then for recording I use AfxConnectionAdvise(), which is working fine.
The problem I am facing is in Replaying the events.
1)The VM crashes with a hotspot error, when on the first page some link
click event is present, which loads a new page. One observation here is the
VM crashes after onBeforeNavigate2 or TitleChange events are fired.
2)I also tried Yahoo's registration page (having a lot of dropdowns and
checkboxes), it works fine for the first few events, but then the VM
crashes.
My questions are
1)Does IE handle the events like page loading (tiltle change etc.) and click
on some link in different threads? How are the events handled (any useful
info on this)?
2)How should I fix the problem?
3)Is it related to marshalling of IE COM pointers?
Please replay ASAP,
Nikhil
- 7
- JMS and httpsHi all,
Have JMS to use with https
It says in documentation to supply these four arguments,
javax.net.ssl.trustStore, javax.net.ssl.keyStore,
javax.net.ssl.keyStoreType and javax.net.ssl.keyStorePassword
Here's my sample below:
System.setProperty("javax.net.ssl.trustStore", "C:\\Program
Files\\Java\\j2re1.4.2_03\\lib\\security\\cacerts");
System.setProperty("javax.net.ssl.keyStore",
"D:\\Projects\\certificates\\tomcat.keystore");
System.setProperty("javax.net.ssl.keyStoreType", "jks");
System.setProperty("javax.net.ssl.keyStorePassword",
"changeit");
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.InitialContextFactory");
properties.put(Context.PROVIDER_URL,
"https://localhost:8443/");
jndiContext = new InitialContext(properties);
For some reason after creating the new initial context, its reporting:
Default SSL context init failed: null
Did I set my trustStore path correctly?
Thanks
- 9
- How does Java make assignments atomic?>From what I understand, Java guarantees that all assignments to
primitive types (except non-volatile 64-bit types) will be atomic.
How does it do this? I thought that the only truly uninterruptable
processor instruction was the test-and-set, and that test-and-set was
the basis from which richer thread synchronization resources typically
provided by an underlying operating system (e.g. semaphores, mutexes,
critical sections) were built.
Does Java internally implement all of its generated assignment opcodes
inside some kind of test-and-set-based wrappers?
Thanks.
- 9
- JBuilder applet, adding class to jarI have applet which uses classes like java.util.AbstractList,
java.awt.Point. Unfortunately MS VM doesnt support above(i got IO
exception, above classes not found) So i guess i have to add those
classes to my jar. No idea how to do it... Any help appreciated...
- 11
- [RFE] Access to Field, Method and Constructor without the use of Strings
Hi all,
I submitted the following RFE to Sun's RFE page.
As a reply I received a mail from Girish Manwani at Sun that I
should start a discussion in one of the Java newsgroups (Huh?).
To my knowledge, this is the most appropriate group. Here gos:
A DESCRIPTION OF THE REQUEST:
It should be possible to obtain references to Field, Method and
Constructor objects without the use of strings. Proposed syntax:
// Assuming the following class
public class Foo {
String bar;
public Foo(String bar) {
this.bar = bar;
}
public void fly(String to) {
bar = to;
}
}
Field fooBarField = Foo.class.bar.field;
Method fooFlyMethod = Foo.class.fly.method(new Object[]{String.class});
Constructor fooConstructor = Foo.class.constructor(new Object[]{String.class});
There are other possible options for the syntax. I would just like to see
this principally possible.
The construct is similar to the ClassName.class syntax and it can be treated
by the Compiler in the same way:
It could produce the getDeclaredField, getDeclaredMethod and getConstructor
bytecode. No modifications to the JVM would be necessary.
JUSTIFICATION :
The existance of the field/method/constructor could be checked during compile
time. Typos would no longer be possible.
A notation without strings could be very easily refactored by IDEs.
We would specifically need the feature for our typesafe querying system,
so it could work completely without strings.
http://sodaquery.sf.net/
The possibility to get Method objects without strings, would encourage many
developers to use them for more dynamic programming and would result in lots
of more flexible libraries for the Java platform.
Thanks in advance for your attention and for positive comments.
Kind regards,
Carl
Carl Rosenberger
db4o - database for objects - http://www.db4o.com
- 12
- portaudit and linux-sun-jdk15>
X-XaM3-API-Version: 4.3 (R1) (B3pl17)
X-SenderIP: 82.49.197.26
I'm referring to the informations displayed on this page:
http://www.vuxml.org/freebsd/18e5428f-ae7c-11d9-837d-000e0c2e438a.html
Is the information about linux-sun-jdk15 correct?
1.5.* <= linux-sun-jdk <= 1.5.2.02,2
I think that the correct version should be 1.5.0.02,2 considering also that a 1.5 based version >=1.5.1 doesn't (yet) exist.
The last jdk versions for linux is 1.5.0.11 and the port with that version has been committed today, but portaudit is still complaining about this vulnerability.
Thank you.
P.S.
Sorry if I'm writing to too many people, but I'm not sure about who is responsible for that problem.
------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada25feb07
- 12
- 12
- Help choosing JSP ServerHello,
could you folks share with me your recomendations on what JSP servers are
available for a small
business with a very small budget, hopefully something that would produce
error message little
more descriptive than that of Tomcat and also with discent web-server
plugin capabilities and
administration interface.
Thanks in advance,
Ilya Bari.
- 12
- SQL into XMLHi All;
My SQL queries return one, two, sometimes even three levels of XML
data.
So for orders in my system I would like to see in my XML:
<RESULTS>
<order>
<number>3213</number>
<date>Feb 03, 2003</date>
<product>
<name>NEC Monitor</name>
<quantity>3</quantity>
<serial_numbers>
<sn>12321312321</sn>
<sn>44314133422</sn>
<sn>43434343553</sn>
<serial_numbers>
</product>
<product>
<name>Genius Mouse</name>
<quantity>2</quantity>
<serial_numbers>
<sn>23232</sn>
<sn>44343</sn>
<serial_numbers>
</product>
</order>
<order>
<number>444</number>
<date>Mar 06, 2003</date>
<product>
<name>MS Keyboard</name>
<quantity>1</quantity>
<serial_numbers>
<sn>333333</sn>
<serial_numbers>
</product>
</order>
........
</RESULTS>
obviously my query would reutrn
order_num order_date product_name quantity
serial_number
------------------------------------------------------------------------
3231 Feb 03, 2003 NEC Monitor 3 12321312321
3231 Feb 03, 2003 NEC Monitor 3 44314133422
3231 Feb 03, 2003 NEC Monitor 3 43434343553
3231 Feb 03, 2003 Genius Mouse 2 23232
3231 Feb 03, 2003 Genius Mouse 2 44343
444 Mar 06, 2003 MS Keyboard 1 333333
You get the point. I do not want to have 3 queries, but only one that
returns something like described above.
For now I have a functioin that does this, but the algorithm is not
the best, and it only works for two levels (so XML without the s/n for
example).
This must be a common problem, I would appriciate input as to how this
is commonly done, any pointers to web sites, articles... are all
welcome. I'd try to search the groups but for what?:) I would also
like to describe my current algorithm, but for now it seems I would
just bore you.
Looking for some input,
Damjan
- 16
- Sending Hop Limited UDP packetsIs there a way to send a UDP packet with a specific TTL however it
must be a unicast address instead of multicast address. Any ideas?
regards
Usman Ismail
|
| Author |
Message |
mike.maruffi

|
Posted: 2004-12-7 2:50:00 |
Top |
java-programmer, Debugging java sevlet with Eclipse
http://jroller.com/page/mikemaruffi/Weblog?catname=/Java
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- JOptionPane.showInputDialog on JButton[][] arraySorry i have a problem.
I don't know the java language but i must create a grid Of button witch
random Values, and when i clicked on one button i must change the internal
values.
I try ti make a code but i don't know how to pass the value of botton to
mouse event, and change it with
String input = JOptionPane.showInputDialog("Insert value:");
for a single button there aren't any problems, but how can I change the
value of an array of button witch MouseEvent?
Thx!!!! please help me!!!!
QUADRATOFRAME.CLASS
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class QuadratoFrame extends JFrame {
JButton pulsante = new JButton();
int N=6;
int MAXELEM = 50;
int[][] mat=new int[N][N];
JButton[][] jb = new JButton[N][N];
private JPanel pannello2= new JPanel();
LeftButtonListener leftListener = new LeftButtonListener();
public QuadratoFrame() {
Random generator=new Random();
for (int i=0; i<N; i++)
for (int j=0; j<N; j++)
mat[i][j]=generator.nextInt(MAXELEM);
for(int i = 0; i < N; i++)
for (int j=0; j<N; j++)
{
jb[i][j] = new JButton(Integer.toString(mat[i][j]));
pulsante=jb[i][j];
pulsante.addMouseListener(leftListener);
}
pannello2.setLayout(new GridLayout(N,N));
getContentPane().add(pannello2);
pack();
for(int i = 0; i < jb.length; i++)
for (int j=0; j<N; j++)
pannello2.add(jb[i][j]);
}
private class LeftButtonListener implements MouseListener {
public void mouseClicked(MouseEvent event) { }
public void mouseEntered(MouseEvent event) { }
public void mouseExited(MouseEvent event) { }
public void mousePressed(MouseEvent event) {
String input = JOptionPane.showInputDialog("Insert new value:");
}
public void mouseReleased(MouseEvent event) { }
}
}
QUADRATOTEST.CLASS
import javax.swing.*;
/**Una classe che rende attivo il programma Frattali
*tramite la costruzione e la visualizzazione della finestra Frattali nel
main.
*/
public class QuadratoTest {
public static void main(String[] args) {
JFrame myFrame=new QuadratoFrame();
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setSize(800,600);
myFrame.show();
}
}
- 2
- log4j questionIs log4j specifically a servlet, or is it an API that can be called from
ANY java program that wanst to do logging?
- 3
- Second URL.openstream in second thread causes ProtocolExceptionI have a multi-threaded Java http image proxy service application that
runs fine on Windows 2000. The app retrieves multiple, distinct images
from a webserver with one image retrieval process per thread. The
webserver images change every so often, but each distinct URL used in
my proxy service remains the same. Each thread repeats its image
download every few seconds to retrieve updated images. It all works
great.
I am trying to move this app to a Red Hat Fedora core 4 machine.
Almost everything works except I am getting a protocol exception when
I try to open a second URL stream in a second thread. Within seconds,
one of the threads will throw a ProtocolException error with error
text of '1.1/ 200 OK'. Any one stream/thread combo will work fine.
Trying to start another causes problems.
If I comment out the URL.openStream() call, I can start a dozen
threads, run them for as long as I want and stop them all quite
nicely. Again, all of the code works beautifully on Windows 2000. I'm
not sure if this is a Java problem or, perhaps, a Linux server
configuration problem.
It just seems that the Red Hat server/Java environment is having a
hard time having two http protocol discussions in two threads at the
same time. Occasionally, the threads will both succeed for a few
image revolutions, so there is a little inconsistency in when the
failure occurs.
gdhurst
- 4
- corba-J2EE-EJB-WebSphere?Some help for a newbee?
I've been a c/C++ programmer in VMS, OS/400, and most recently, Windows
and Dot Net. However, I have recently signed on as Q/A manager at a
predominantly Java shop. We have some consultants coming in to assess our
scaleability and architecture, and I'd like to be in a position to at least
make some intelligable noises. I have gotten the sense that there is at
least some compatability between these, but I'm not picking up the extent,
if any, to which any are essentially competing technologies. Is some subset
of these an obvious choice for a medium volume site with lots of active
content, with scaleability, performance, and maintainability being our top
three criteria? Thanks.
Joe
email***@***.com
(please remove "nospam." to reply)
- 5
- Executable binaryHello java experts:
Is there any tool to make java file into executable binary? thanks in
advance
- 6
- 7
- Tired of 100s of stupid Getter/Setter methodsTor Iver Wilhelmsen wrote:
> Dave Glasser <email***@***.com> writes:
>
> > Java does not. Methods can be overridden with less restrictive access
> > (like the common practice of overriding Object.clone() with a public
> > clone() method) but not more restrictive access.
>
> But they can be overridden with exception-throwing code to ensure
> they're not used.
Indeed. That's more of a symptom of a problem than a reasonable
solution. You're then left with a class that professes to follow an
interface, but doesn't follow it. What you really wanted was to
implement a different interface on top of existing functionality... a
task for which composition is ideal.
Of course, in a pinch, the exception-throwing kludge will work; it's
integrated into the collections API and even given a fancy name:
"optional methods". However, even its light application there is
generally acknowledged to be one of the few great failures of that API.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
- 8
- PreferencesHello!
I've just read about Preferences in JDK1.4 and wonder where java store data
between sessions???? I've found no related files with suitable contant..
Sorry for lammer question ;(
- 9
- Making and Returning Java Byte Arrays in C++ via JNI (Help! Please!)How do you make java byte arrays, fill them with values, and return
them in c++? I have no clue where to start. The JNI Tutorial a at
Java's website isn't much help because it doesn't really explain how to
make new jarrays. Any tips, how-tos and example code are welcome! (And
can anybody please explain me what's jsize? Is it just another integer?)
- 10
- When 56K was widebandHere is a movie made in the early days of Arpanet about the coming
networking technology.
http://www.vortex.com/bv/arpanet-72.wmv
It is fun to look back to see how much has changed, and by
extrapolation imagine what is to come.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 11
- Can't detect double-click mouse events in MustangThe following relates to Mustang b89 on Windows Server 2003. It may well
relate to earlier Java versions as well but I haven't tested it.
I think my understanding of mouse clicked events is wrong because I don't
get the behaviour I expect. When I implement the following code:
table.getTableHeader().addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent event)
{
System.out.println("Mouse event, clickCount = " +
event.getClickCount());
}
}
I get the following output for every double-click:
Mouse event, clickCount = 1
Mouse event, clickCount = 2
Shouldn't it be just one event with a clickCount of 2? How can I tell the
difference between the first event and a normal single-click?
Thanks,
Wes
- 12
- Style Sheet inside GUIIs there any open source out there that will allow me to use Style
Sheets inside of a GUI window, preferably a JEditorPane? I need to be
able to open Style Sheet formatted html that is inputted into a
database through an ASP client, and then retrieved in a JAVA client.
- 13
- Using BigInteger and BigDecimal [WAS: Converting floats to Strings and back]
"Alun Harford" <email***@***.com> wrote in message
news:dlvmk8$j8e$email***@***.com...
>
> Unless you want speed (ie. the arithmetic is hard and you've analysed the
> result of using floating-point to do it), or you want to demonstrate some
> of
> the nasty things that happen with floating point, use BigDecimal.
> a) It requires significantly less use of your brain, which generally
> reduces
> the number of bugs.
> b) Your users shouldn't have to think about the limitations of floating
> point without a very good reason.
I've experimented with using BigInteger instead of int in my code with
mixed results. Code that was integer-math intensive (e.g. finding prime
numbers) typically ran 5 to 7 times slower, which is pretty bad, but not
"noticeable" for typical user applications. I'll probably continue this
practice because for most of my apps, the bottleneck is not the
integer-math, and the extra flexibility is nice.
My question is: is there a "best" way to store BigInteger and BigDecimal
values in databases (particularly in SQL)? The two most obvious solutions to
me is to store them as BLOBs or as strings. I'd probably favor the latter,
because although it uses more storage space and processing time (e.g. to
parse the string back into a BigInteger value), it'll probably be easier to
inspect the DB to make sure all the values are correct during debugging.
- Oliver
- 14
- www.rakeback.gr
This week opportunity
FREE $50
If you're new to SunPoker, we'll match your first deposit up to $50 with
a 100% deposit bonus. See details at:
www.rakeback.gr
If you are interesting about how to play and how to win, please
contact us on e-mail: email***@***.com and we will send you book with
tip and tricks.
Sincerely yours
www.rakeback.gr
- 15
- Thread and ListenerHi,
I'm doing some experiences with JOESNMP. It's very good. Guided by the
examples I was able to build a listener that receives snmp traps. It's
working fine (when running through console).
So I decided to start it automatically, together with my web
application (that is running under tomcat).
I have a servlet that is executed when tomcat starts (using
<load-on-startup>). So I did a call to my new class.
The problem is that this class is actually a listener. When it starts,
it hangs the other procedures, including tomcat initilization.
I tryed to put it under a thread, but it also hangs as soon it starts
to listen for snmp traps.
How do I ran a listner without blocking other processes? I am looking
for a solution that should work both on linux and windows.
I don't know if I made myself understood. Sorry my poor english.
TIA,
Bob
|
|
|