| ports/java cleanup/re-org (was: freebsd eclipse plugins & mailing |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- JWS newbie security questionHi,
Trying to deploy my java application on the intranet via JWS for the
very first time. All of my jars are unsigned and I get an error
(described below). I though that the user was supposed to decide
whether or not to allow access. So why do I get an error instead?
An error occurred while launching/running the application.
Title: Yadda Yadda
Vendor: IT Department
Category: Security Error
Unsigned application requesting unrestricted access to system
Unsigned resource: http://localhost/infoflow/infoflow.jar
Thanks!
Aaron Fude
- 1
- eclipse-nls-sdk updateHi debian-java list,
In Debian unstable, eclipse-nls-sdk pacakge is too old and useless now.
I've posted it to BTS #340823 and make packages and announced to Japanese
Debian community about my packages. Some of them uses my packages and they
say it works well.
I want eclipse-nls-sdk maintainer to take it to Debian, but he cannot
work for Debian now (you know). So someone take this updated packages
to Debian, I hope.
packages and source are here.
http://www.mithril-linux.org/~henrich/debian/package/
I wish any reply will come from this list :)
# and please CC to me. I'm not on this list now.
--
Regards,
Hideki Yamane henrich @ debian.or.jp/samba.gr.jp/iijmio-mail.jp
http://www.mithril-linux.org/~henrich/
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 4
- Hashtable questionIs there a way using a Hashtable, or some other object to give the
object a value and return all the keys that have that value? So if I
have something like:
hashtable.put("A","1");
hashtable.put("B","1");
hashtable.put("C","1");
hashtable.put("D","2");
I could pass in "1" and it would return a Vector or Array with
"A","B","C" in it? Thanks for any help in advance.
- Nathan Bragg
- 4
- Apache command chain questionHi,
I am new to the command chain pattern and kindly bear with me if this
is a basic question.
In the catalog below,
<catalog>
<chain main>
<command 1/>
<command 2 lookup(sub)/>
<command 5/>
</chain>
<chain sub>
<command 3>
<command 4>
</chain>
If command 3 were to return true, will command 5 execute ? Thanks.
- 7
- UI managementI am having a problem updating the laf of my java program.
I have changed the laf using:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
which works fine, then I use successive calls to:
SwingUtilities.updateComponentTreeUI();
to update container component laf in my main window.
The problem is, when I call SwingUtilities.updateComponentTreeUI(mainMenu);
it does not update the laf of all of the menu items themselves. Only some of
the menu items take the new laf and some do not????
Anyone have any idea what could be causing this? Or how to fix this?
- 10
- Help! Where's my UIManagerOn 29 avr, 16:19, Zerex71 <email***@***.com> wrote:
> Greetings,
>
> I spent a frustrating amount of time yesterday trying to figure out
> how to get access to the UIManager class. I am dusting off my Swing
> skills after a number of years and I shouldn't have to be fighting the
> compiler - the Swing paradigm is enough of a challenge as it is.
>
> I am simply trying to set the LAF of my app to use the cool Java metal
> look instead of the default Windows LAF. Here's the offending LOC:
>
> import javax.swing.UIManager;
>
> UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
>
> It throws the four exceptions listed in the Java documentation at Sun,
> leading me to believe it simply does not know where to find the
> UIManager class. I have a normal Java 1.6.0_05 installation.
>
How could it throw the 4 exceptions? Only one exception may be thrown
by a method at runtime, but not 4 at once.
I suspect that the *compiler* refuses to compile your code because the
method *might* throw one of these 4 exceptions, and you don't catch
them or rethrow them.
Since the call should never throw any of the exceptions (the class
name returned by getCrossPlatformLookAndFeelClassName() being of
course perfectly valid for any platform), I suggest you just catch
them and rethrow them as a runtime exception:
try {
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
catch(ClassNotFoundException e) {
// should never happen
throw new RuntimeException(e);
}
catch(InstantiationException e) {
// should never happen
throw new RuntimeException(e);
}
catch(IllegalAccessException e) {
// should never happen
throw new RuntimeException(e);
}
catch(UnsupportedLookAndFeelException e) {
// should never happen
throw new RuntimeException(e);
}
JB.
- 12
- ResultSet on RMII'm trying to pass the ResultSet object to an RMI client and I
realized that this will not work since ResultSet is not serializable.
I want to be able to take advantage of ResultSet capabilities using
RMI calls. What alternatives can I use? I can pass a 2 dimensional
string object representing columns and rows but this will be
complicated for developers to use.
Any suggestions are appreciated.
Thanks
- 13
- Track developers in EclipseHello everybody,
my name is Manuel Josupeit-Walter and I'm studying Systems Engineering
at the university of Essen, Germany. My bachelor exam will be an
empirical study on the use of AOP in Java/Eclipse for what I need a
plugin to trace users during the whole developing-process, i.e. when do
they copy source code to the clipboard, when and where do they paste it,
when was the compile-button clicked and so on. I need to reproduce
nearly every action and edit.
Finding such a plugin will reduce my work a lot (what causes me not to
write such a tool by myself), but even Google gives no usable results.
Does anyone of you know such a tool?
Regards,
Manuel
X-Post: comp.lang.java.softwaretools, comp.lang.java.help
F-Up: comp.lang.java.softwaretools
- 13
- looking for another way of updating text in a swing componenthi, i'm fairly new to java and am experimenting with various swing
components. as far as I know at this time, when a change occurs in the text
i want to display, in order to show it, I have to repaint the frame.
Is there a component or way of placing a textarea of sorts in a GUI and then
have they data fed to it update without having to refresh the whole frame
each time? for example, log files fed to the GUI... as the data comes in
each line of the logs is added to the the display. I am looking for some
class in the api to look over or something i can google.
thanks...Steve
- 13
- question about RMIHi,
What is the best data type to transfer a resultset from server to
client using RMI ?
Thanks
- 13
- pack vs validateRoedy Green <email***@***.com> wrote in
news:email***@***.com:
> Pack appears to do some "extra stuff" then call validate.
>
> When do you use pack and when validate. What is the difference?
FWIW, I've only ever seen "pack" called before "show" - it is called once
in the lifetime of the frame. However, validate can get called at any time.
I'm not entirely sure why this is the case, however.
--
With kind regards,
Josh R.
- 14
- 14
- Searching ProgramI have to create a "Search Engine Program" in Java. I'm using Java /
Struts and XML.
Thanking you
- 15
- cannot run javac commandHi,
Complete newbie to Java.
I installed JDK 5.0 Update 9 with NetBeans 5.5 and started the tutorial.
No problems with using Netbeans--but can't compile the hello world prog
using command line.
I also want to write the program from scratch using text editor.
That's done but when I go to javac helloworldapp.java as system does
not recognize command "javac"
Error message: Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>javac
'javac' is not recognized as an internal or external command,
operable program or batch file.
C:\>
Here is my Class path: .;C:\Program
Files\Java\jre1.5.0_06\lib\ext\QTJava.zip
QTJAVA C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip
I'm sure I'm doing something wrong here....
Any help?
Thanks!
--
- 15
- Nice Photos from Vista Launch at New York Finally PublishedA BadVista at Microsoft's New York launch parties
,----[ Quote ]
| We may not have Lebron James, Roy Schestowitz, Shaun Alexander, or
other such
| celebrity software experts on our side, email***@***.com but
judging from the
| reception we received from this crowd, people--once they know the
details--
| are very concerned with Microsoft's attempted hoodwink masquerading
| as an "upgrade", and are very willing to listen to us plain
unfamous
| people.
`----
http://badvista.fsf.org/blog/a-badvista-at-microsof
|
| Author |
Message |
lyndon

|
Posted: 2005-8-26 13:24:00 |
Top |
java-programmer, ports/java cleanup/re-org (was: freebsd eclipse plugins & mailing
On Aug 25, 2005, at 10:00 PM, Greg Lewis wrote:
> and the fact that the devel category is already huge.
Devel is ripe for splitting ala the x11-* categories. And I suspect a
not insubstantial portion of devel could be moved elsewhere (e.g.
devel/mime -> mail/mime).
And this whole thread should be moved to the ports list. Please note
the reply-to.
--lyndon
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- bypassing IISHi
We have an architecture where users log in to their
"windows" pcs using Microsoft Active Directory
and requests are then sent as follows:
client -> IIS -> Tomcat
An isapi redirector resides at IIS which forwards the request to
Tomcat.
isapi redirect would appear to populate the HTTP header with
the user's credentials.
My question is: how can we avoid the overhead of IIS
and send requests directly to Tomcat for authentication against the
ldap server as before.
(The issue I see is how to populate the HTTP header with the
user details?)
Regards
- 2
- Open Source Distributive Cache solutionHi,
I am looking for an open source's distributive cache solution. One that
can be used for a clustered weblogic servers environment, the cache has
to be read and write, and the cache itself need to be fail-safe.
Anyone has some recommandations?
Thanks,
Edmond
- 3
- Problems with tomcatHi guys, I have some problems, I'm trying to run tomcat in windows
2000 pro and actually it runs but when I use the browser http://localhost:
doesn't work, What should be the problem? I've changed the port to 80
but still having the same problem. Thx in advance
- 4
- XML Validation with JavaHi
For several days I've been trying to validate a very simple XML-Document
against an XML Schema - so far without success. I've tried several
approaches, using libraries like Xerces, JAXP and an Oracle-library, but
none of those worked the way for example XML Spy works.
Here is my Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root"/>
</xsd:schema>
This is the (invalid) XML-File that references the schema: <?xml
version="1.0" encoding="UTF-8"?> <root
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='test.xsd'> <a></a> </root>
This is my first try to validate the Document against the schema:
try { DOMParser parser = new DOMParser();
parser.setFeature("http://xml.org/sax/features/validation",true);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-che
cking",true); parser.parse("C:\\test.xml"); }
catch(Exception ex) { ex.printStackTrace(); }
This runs without problems, however, it doesn't report a validation-error.
My second try:
try { SAXParserFactory parserFct =
SAXParserFactory.newInstance(); parserFct.setValidating(true);
parserFct.setFeature("http://xml.org/sax/features/validation", true);
parserFct.setFeature("http://apache.org/xml/features/validation/schema",
true);
parserFct.setFeature("http://apache.org/xml/features/validation/schema-full-
checking",true); javax.xml.parsers.SAXParser parser =
parserFct.newSAXParser(); parser.parse("C:\\test.xml", new
MyHandlerBase()); } catch(Exception ex)
{ ex.printStackTrace(); }
This is the Errorhandler I used:
class MeinErrorHandler implements ErrorHandler{ boolean b = false;
public void warning(SAXParseException e) throws SAXException {
System.out.println("WARNUNG: " + e); b = true; } public void
error(SAXParseException e) throws SAXException {
System.out.println("FEHLER: " + e); b = true; } public void
fatalError(SAXParseException e) throws SAXException {
System.out.println("LEIDER, LEIDER, AUS: " + e); } public boolean
warninghappened(){ return b; }}
Again, no validation-error.
My third try:
InputSource is = null; DOMParser parser = new DOMParser();
Document doc = null; try {
parser.setFeature("http://xml.org/sax/features/validation",true);
parser.setFeature("http://apache.org/xml/features/validation/schema",true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-che
cking",true);
parser.setProperty("http://apache.org/xml/properties/schema/external-noNames
paceSchemaLocation", "C:\\test.xsd" ); is = new
InputSource(new FileReader("C:\\test.xml"));
parser.parse(is); } catch(Exception ex)
{ ex.printStackTrace(); }
Again, no validation-error.
My fourth try involved the oracle.xml.parser.schema and
oracle.xml.parser.v2-packages.
Here is the code:
public void process(String xsdURI, String xmlURI) throws Exception
{
XSDBuilder builder = new XSDBuilder();
URL url = createURL(xsdURI);
// Build XML Schema Object
XMLSchema schemadoc = (XMLSchema) builder.build(url);
DOMParser dp = new DOMParser();
url = createURL(xmlURI);
// Set Schema Object for Validation
dp.setXMLSchema(schemadoc);
dp.setValidationMode(XMLParser.SCHEMA_VALIDATION);
dp.setPreserveWhitespace(true);
dp.setErrorStream(System.out);
try
{
System.out.println("Parsing " + xmlURI);
dp.parse(url);
System.out.println("The input file <" + xmlURI + "> parsed
without errors");
}
catch (XMLParseException pe)
{
System.out.println("Parser Exception: " + pe.getMessage());
}
catch (Exception e)
{
System.out.println("NonParserException: " + e.getMessage());
}
}
This worked fine with the test.xml-Document, however, when I tried to
validate a more complex document which used keys and key-references, it
couldn't validate the Document although XML-Spy had no problem with it.
Am I missing something here? Does anybody know those problems and has a
solution for it, or perhaps a sample-code that works? Any help would be
greatly appreciated.
Thanks in advance
Mathias Winklhofer
- 5
- java.util.zip not handling Unicode filenamesI have a zip file that contains files with Asian filenames.
java.util.zip.ZipFile opens it, but the filenames are garbled. Is there any
way to handle filenames that contain unicode characters?
- 6
- Reading only numbers from a filehi all
i need a code for reading only numbers from file and not the
letters.
for ex if i have emp name and salary i have to reda only salary.
- 7
- KeyRelease Event affects next Internal FrameHi,
I am working on an MDI application using JInternalFrames. I have
forms to fill that have the 'Next', 'Back' and 'Cancel' buttons. I am
assigning key presses (Enter, Alt+left and Esc respectively) through
KeyRelease event. In addition, the 'Next' button is assigned as the
default button using
this.getRootPane().setDefaultButton(btnOK). However, I find that when
I run the program and press the Enter key, after accepting the enter
and processing the button action, it loads the next JInternalFrame and
appears to call the KeyRelease event for this form too. Since I have
entries that must be filled, this raises errors that entries are not
filled.
Can anyone tell me what I am doing wrong.
Thanks in advance,
Arun Kumar Srinivasan
- 8
- what's wrong with my component? i make a new component which is a dragable icon here is my piece of
code
//class: DragAbleComponent.the father of my component
import java.awt.Graphics;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import javax.accessibility.Accessible;
import javax.swing.JComponent;
public abstract class DragAbleComponent extends JComponent implements
MouseListener,
FocusListener, Accessible ,MouseMotionListener{
private int X;
private int Y;
/**
*
*/
private static final long serialVersionUID = 1L;
public void mouseClicked(MouseEvent e) {
this.requestFocusInWindow();
}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void focusGained(FocusEvent e) {
this.repaint();}
public void focusLost(FocusEvent e) {
this.repaint();}
protected abstract void paintComponent(Graphics graphics);
public int getX() {
return X;
}
public void setX(int x) {
X = x;
}
public int getY() {
return Y;
}
public void setY(int y) {
Y = y;
}
}
//class:DragableIcon the component
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import javax.swing.Action;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import javax.swing.TransferHandler;
public class DragableIcon extends DragAbleComponent {
private Image image;
private MouseEvent firstMouseEvent = null;
private static boolean installKeyBordMapings = true;
/**
*
*/
private static final long serialVersionUID = 1L;
public DragableIcon(Image image) {
super();
this.image = image;
this.setFocusable(true);
this.addMouseListener(this);
this.addFocusListener(this);
this.addMouseMotionListener(this);
this.initKeyBordMaping();
}
private void initKeyBordMaping(){
if (installKeyBordMapings) {
InputMap imap = this.getInputMap();
// imap.put(KeyStroke.getKeyStroke("ctrl X"),
//
TransferHandler.getCutAction().getValue(Action.NAME));
imap.put(KeyStroke.getKeyStroke("ctrl C"),
TransferHandler.getCopyAction().getValue(Action.NAME));
imap.put(KeyStroke.getKeyStroke("ctrl V"),
TransferHandler.getPasteAction().getValue(Action.NAME));
}
ActionMap map = this.getActionMap();
//
map.put(TransferHandler.getCutAction().getValue(Action.NAME),
// TransferHandler.getCutAction());
map.put(TransferHandler.getCopyAction().getValue(Action.NAME),
TransferHandler.getCopyAction());
map.put(TransferHandler.getPasteAction().getValue(Action.NAME),
TransferHandler.getPasteAction());
}
@Override
protected void paintComponent(Graphics graphics) {
Graphics g = graphics.create();
//Draw in our entire space, even if isOpaque is false.
g.setColor(Color.WHITE);
g.fillRect(0, 0, image == null ? 125 : image.getWidth(this),
image == null ? 125 : image.getHeight(this));
if (image != null) {
//Draw image at its natural size of 125x125.
g.drawImage(image, 0, 0, this);
}
//Add a border, red if picture currently has focus
if (isFocusOwner()) {
g.setColor(Color.RED);
} else {
g.setColor(Color.BLACK);
}
g.drawRect(0, 0, image == null ? 125 : image.getWidth(this),
image == null ? 125 : image.getHeight(this));
// g.drawImage(image, 0, 0, this);
g.dispose();
}
public void mouseDragged(MouseEvent e) {
//Don't bother to drag if the component displays no image.
if (image == null) return;
if (firstMouseEvent != null) {
e.consume();
//If they are holding down the control key, COPY rather
than MOVE
int ctrlMask = InputEvent.CTRL_DOWN_MASK;
int action = ((e.getModifiersEx() & ctrlMask) == ctrlMask)
?
TransferHandler.COPY : TransferHandler.MOVE;
int dx = Math.abs(e.getX() - firstMouseEvent.getX());
int dy = Math.abs(e.getY() - firstMouseEvent.getY());
//Arbitrarily define a 5-pixel shift as the
//official beginning of a drag.
if (dx > 5 || dy > 5) {
//This is a drag, not a click.
JComponent c = (JComponent)e.getSource();
TransferHandler handler = c.getTransferHandler();
//Tell the transfer handler to initiate the drag.
handler.exportAsDrag(c, firstMouseEvent, action);
firstMouseEvent = null;
}
}
}
public void mouseMoved(MouseEvent e) {}
public void mousePressed(MouseEvent e) {
//Don't bother to drag if there is no image.
if (image == null) return;
firstMouseEvent = e;
e.consume();
}
public void mouseReleased(MouseEvent e) {
firstMouseEvent = null;
}
public static boolean isInstallKeyBordMapings() {
return installKeyBordMapings;
}
public static void setInstallKeyBordMapings(boolean
installKeyBordMapings) {
DragableIcon.installKeyBordMapings = installKeyBordMapings;
}
public Image getImage() {
return image;
}
public void setImage(Image image) {
this.image = image;
}
}
//and here is my pane
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import cn.com.ynld.bms.applet.gui.handler.IconTransferHandler;
import cn.com.ynld.bms.applet.service.TransfAble;
import cn.com.ynld.bms.applet.service.UpdateAble;
public class ElectronicPane extends JPanel
implements ItemListener,UpdateAble{
private UpdateAble updateAble = null;
private ScrollAbleImage image;
private JToolBar toolBar;
private IconTransferHandler handler;
/**
*
*/
private static final long serialVersionUID = 1L;
public ElectronicPane(){
super(new BorderLayout());
handler = new IconTransferHandler();
this.creatToolBar();
this.add(this.toolBar);
this.setTransferHandler(handler);
}
public void itemStateChanged(ItemEvent e) {}
public void addTransferAble(String key, TransfAble transferAble) {
// TODO
}
public TransfAble getTransferAble(String key) {
// TODO
return null;
}
public void removeTransferAble(String key) {
this.updateAble.removeTransferAble(key);
}
public void update(UpdateAble updateAble) {
this.updateAble = updateAble;
this.init();
}
private void init(){
this.image = new ScrollAbleImage();
this.image.update(updateAble);
this.add(image,BorderLayout.CENTER);
this.repaint();
//this.image.repaint();
}
private void creatToolBar(){
this.toolBar = new JToolBar();
DragableIcon alarm = new
DragableIcon(createImageIcon("/root/Desktop/drawing/png-0003.png",
"alarm").getImage());
alarm.setTransferHandler(handler);
DragableIcon damage = new
DragableIcon(createImageIcon("/root/Desktop/drawing/png-0007.png",
"device").getImage());
alarm.setTransferHandler(handler);
this.toolBar.add(alarm);
this.toolBar.addSeparator();
this.toolBar.add(damage);
this.toolBar.setFloatable(false);
}
/** Returns an ImageIcon, or null if the path was invalid. */
protected static ImageIcon createImageIcon(String path,
String description) {
// java.net.URL imageURL =
DragPictureDemo.class.getResource(path);
if (path == null) {
System.err.println("Resource not found: "
+ path);
return null;
} else {
return new ImageIcon(path, description);
}
}
}
the problem is i add DragableIcons to my toolbar but only the first
icon can be seen!!!!
what's wrong
thanks for any help!
- 9
- POSSIBLE SECURITY PROBLEM in Java 5!This happened accidentally, but an attacker might use this
intentionally in a hostile applet to perpetrate a denial of service
attack.
I had a Java app compile and run that generated ~200 threads accessing
the network. It suddenly stopped functioning; it hadn't hung -- the UI
still worked -- but the network activity dropped to zero and it
wouldn't do anything. (Picture a Web browser that works, except every
attempt to go to a page produces a timeout or the browser just spins.
Sort of like that: the UI is working but the backend isn't.)
Naturally, suspecting a bug, I exited and went to rerun the app, this
time attaching a debugger process. Failed. Eclipse showed "Launching
(83%)..." and stuck there. Details showed "searching for free socket"
or some such.
At this point I discovered that almost every other network using app on
the system had locked up. Shareaza, MSN messenger, etc. -- Firefox was
the only survivor, and it would not function (see above description of
semi-functional Web browser; this was Firefox after the accident).
Task Manager showed two Java tasks, one with over 100 threads;
presumably the app that was supposed to have exited. I repeatedly
attacked it with "End Process" and "End Process Tree"; no effect.
Eclipse, when exited, likewise remained as a headless zombie: no
visible UI but still an Eclipse process and a Java task with a couple
of threads. Neither could be killed.
After over half an hour, none of the tasks had exited that had been
told in various increasingly imperative ways to terminate, and the
network remained unusable. I concluded I had to reboot.
To top it off, a clean reboot wasn't possible -- the system would close
a couple apps then just sit there. I had to power-cycle the fucking
box! This on an NT kernel OS and with the trigger being Java, the
paragon of security and non-crashingness? What the fuck?!
Now I've lost all my open Explorer folders and various other
inconveniences can all be laid at the doorstep of ... whatever the fuck
it was that happened.
Can anyone explain this event? Opening a lot of network connections
shouldn't be a problem on XP, and it sure as hell shouldn't render the
system unusable to the point of forcing a cold boot. Even if the Java
app ate all the free network sockets, it should have been terminatable,
and killing it should have released the sockets. Even terminating other
tasks (such as the nonresponsive Shareaza) that used the network didn't
free any up (Shareaza, when end-tasked, disappeared promptly from all
task and process lists, but Firefox didn't magically start working
again).
Annoyingly, the system help also stopped working(!); I was desperate
enough to actually resort to Help and Support Center to find info on
terminating processes and/or freeing sockets, given that the usual
first-resort, Google, was rendered unavailable by the problem.
This Should Not Have Happened.
We have at least 3 separate problems:
* Java can do things that DoS a Win32 box, without doing anything but
open sockets.
Applets can open sockets (though only back to the originating site);
Win32 boxen are
extremely commonplace. You do the math.
* Windows XP SP2, with all the latest updates (including and especially
security updates),
allows a single app to hog all the network sockets, and apps that
want a socket but
can't get one seem usually to hang rather than gracefully report an
error condition to the
user.
* And it does not seem to properly "terminate with prejudice" an
unresponsive process or
free up resources one had when it does terminate it successfully. Is
there no equivalent of
"kill -9", via Task Manager or otherwise, even when you're logged on
as administrator?
It looks like some problems (can't kill processes, processes can kill
parts of the system's overall functionality, killed tasks don't always
have their resources released by the OS) from the bad old days of
Windows 3.1 are still present and accounted for...
Win32 SP2 with all security fixes;
JDK/JRE 1.5.0_06 (latest, as of a couple weeks ago anyway)
- 10
- 11
- Server-side tools surveyI'm currently working with JBoss/Tomcat, PostgreSQL, NetBeans, Struts,
XDoclet, Ant, JUnit, JUnitEE...and a few things I've probably forgotten
to mention.
What tools do *you* consider necessary for web application development?
--
Phillip Mills
Multi-platform software development
(416) 224-0714
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
- 12
- use my JSP custom tag on click of buttonI have written a custom tag in a jsp
<test:attribs attribNames="<%=aenum%>">
<li> <b><%=aenum.nextElement()%></b>
</test:attribs>
It lists the request attributes.
Now i want the to list the same on click of a button or say on clicking
on an image( or consider for some specified event of a HTML component)
Can i use the custom tag for the same and if yes how?
Regards,
- 13
- Registering Connector/J driverHi. I have
- mySQL 1.4
- Connector/J 3.0.15
I want to use Java to query mySQL database via Connector/J.
Connector/J documentation at
http://dev.mysql.com/doc/connector/j/en/index.html instructs to
compile and run the following Java code to register the Connector/J
driver:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// Notice, do not import com.mysql.jdbc.*
// or you will have problems!
public class LoadDriver {
public static void main(String[] args) {
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
// handle the error
}
}
}
// Error:
// SQLJConnectorRegister1failed.java:8:
// class LoadDriver is public, should be declared in a file named
// LoadDriver.java
Where should I have this LoadDriver class/java file? It doesn't come
with any of the packages I have (java.sql.* or connector/J driver
classes). Hence I can't "supply a class that implements Driver
interface" which would I gather register the driver. I have set the
classpath to the driver's jar, so it should find that class.
*
And then SQL queries would be possible. That would be an achievement
as such, never loaded/registered a driver in my life, or programmed
much anyway.
Appreciate any help over this.
Best, Harri S
Finland
language technologist
- 14
- OutOfMemoryError problemHi,
I am a user of cruisecontrol ( continuous integration server). As long
as I have used it I have had problems with
java.lang.OutOfMemoryError's. I have gotten numerous ideas on how to
handle it. Some
resonable and some more unrealistic. However lately I dicided that I
need to dig deeper into this.
I use two ways to perform build and test. Both ways use the same 'ant'
and the same 'build file'.
The difference is in how the build is triggered.
Shell script
=========
Here I use a shell script to start ant.
java -Xms512M -Xmx756M -classpath .......
Cruisecontrol
==========
Here I start cruisecontrol ( a java program) that starts ant.
I set Xms and Xmx for cruisecontrol as well as ant.
When I execute the shell script the 'junit' and 'junitreport' tasks
execute nicely.
On the other hand when I execute 'cruisecontrol' I get a
java.lang.OutOfMemoryError when I execute the 'junit-report'.
Trace:
--------
BUILD FAILED
java.lang.OutOfMemoryError
at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)
at
org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
or.java:40)
at
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.lang.OutOfMemoryError
--- Nested Exception ---
java.lang.OutOfMemoryError
I did some investigation in ant ( source code ) and found out the each
junit test suite result ( xml-file) is merged into one big xml file.
There are two steps in the code. Step 1 works ok! Step 2 is failing
siince the big merged file is not complete. Could it be something with
the jvm?
All hints are welcome.
cheers,
//mikael
Step 1 - creating the dom document
-------------------------------------------
protected Element createDocument() {
// create the dom tree
DocumentBuilder builder = getDocumentBuilder();
Document doc = builder.newDocument();
Element rootElement = doc.createElement(TESTSUITES);
doc.appendChild(rootElement);
generatedId = 0;
// get all files and add them to the document
File[] files = getFiles();
for (int i = 0; i < files.length; i++) {
File file = files[i];
try {
log("Parsing file: '" + file + "'",
Project.MSG_VERBOSE);
if(file.length()>0) {
Document testsuiteDoc
=
builder.parse(FileUtils.getFileUtils().toURI(files[i].getAbsolutePath()));
Element elem = testsuiteDoc.getDocumentElement();
// make sure that this is REALLY a testsuite.
if (TESTSUITE.equals(elem.getNodeName())) {
addTestSuite(rootElement, elem);
generatedId++;
} else {
//wrong root element name
// issue a warning.
log("the file " + file
+ WARNING_INVALID_ROOT_ELEMENT,
Project.MSG_WARN);
}
} else {
log("the file " + file
+ WARNING_EMPTY_FILE,
Project.MSG_WARN);
}
} catch (SAXException e) {
// a testcase might have failed and write a zero-length
document,
// It has already failed, but hey.... mm. just put a
warning
log("The file " + file + WARNING_IS_POSSIBLY_CORRUPTED,
Project.MSG_WARN);
log(StringUtils.getStackTrace(e), Project.MSG_DEBUG);
} catch (IOException e) {
log("Error while accessing file " + file + ": "
+ e.getMessage(), Project.MSG_ERR);
}
}
return rootElement;
}
Step 2 - write the DOM Tree to file
----------------------------------------
protected void writeDOMTree(Document doc, File file) throws IOException
{
OutputStream out = null;
PrintWriter wri = null;
try {
out = new BufferedOutputStream(new FileOutputStream(file));
wri = new PrintWriter(new OutputStreamWriter(out, "UTF8"));
wri.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
(new DOMElementWriter()).write(doc.getDocumentElement(),
wri, 0, " ");
wri.flush();
// writers do not throw exceptions, so check for them.
if (wri.checkError()) {
throw new IOException("Error while writing DOM
content");
}
} finally {
FileUtils.close(wri);
FileUtils.close(out);
}
}
- 15
- Little problem with ant install taskHi,
I found out that i can use ant for installing my web application.
great, I have copied some code from an example and added the taskdef's
to the top of my build.xml.
Then I copied the catalina-ant.jar into my java classpath.
But when I run it, I get :
"A class needed by class org.apache.catalina.ant.InstallTask cannot be
found: org/apache/tools/ant/Task"
I looked into the catalina-ant.jar and could not find a Task class
indeed, but then, where is it...?
Taskdef:
<taskdef name="install"
classname="org.apache.catalina.ant.InstallTask" />
<taskdef name="remove"
classname="org.apache.catalina.ant.RemoveTask" />
Target:
<target name="install" depends="war" description="Install servlet
on tomcat.kochan.de">
<install url="${tomcat.url}" username="${manager.username}"
password="${manager.password}" path="${app.path}"
war="jar:file:/${war.dir}/${project}.war!/" />
<sleep seconds="2"/>
</target>
Thanks for help!
Werner
|
|
|