Java Tip 111: Implement HTTPS tunneling with JSSE
siehe auch im Furl
Monday, June 06, 2005
Using RMI over SSL authentication for application-level access control
Using RMI over SSL authentication for application-level access control
Sun provides support for running RMI over SSL in its Java2 platforms using a custom RMISocketFactory. In cases when applications need to provide their own fine-grained access control, it is useful to obtain access to the Java security principal (java.security.Principal) that was SSL authenticated.
The Java2 SSLSocket class provides a getSession() method which can be used to obtain the SSL principal who was authenticated. Unfortunately, by the time the RMI server method is invoked, the socket used to read the remote invocation parameters has been hidden by the RMI implementation.
Sun provides support for running RMI over SSL in its Java2 platforms using a custom RMISocketFactory. In cases when applications need to provide their own fine-grained access control, it is useful to obtain access to the Java security principal (java.security.Principal) that was SSL authenticated.
The Java2 SSLSocket class provides a getSession() method which can be used to obtain the SSL principal who was authenticated. Unfortunately, by the time the RMI server method is invoked, the socket used to read the remote invocation parameters has been hidden by the RMI implementation.
JGloss-WWW
JGloss-WWW
JGloss-WWW is a Java servlet which proxies web content. Words in a Japanese HTML document are annotated on the fly with their readings and translations. These annotations are shown as pop-ups when the user moves the mouse over a word using JavaScript (currently only Mozilla is supported).
JGloss-WWW is a Java servlet which proxies web content. Words in a Japanese HTML document are annotated on the fly with their readings and translations. These annotations are shown as pop-ups when the user moves the mouse over a word using JavaScript (currently only Mozilla is supported).
Sunday, May 29, 2005
Thursday, May 26, 2005
Saturday, May 14, 2005
Thursday, May 12, 2005
Sunday, May 08, 2005
Thursday, May 05, 2005
Wednesday, May 04, 2005
TheServerSide.com - Container Driven Testing: Advanced EJB Testing with OpenEJB - Part 2: Testing Entity Beans
TheServerSide.com - Container Driven Testing: Advanced EJB Testing with OpenEJB - Part 2: Testing Entity Beans: "Secrets of Entity Bean Testing
Entity Beans have a whole basket of special considerations which must be factored into your testing strategy. Unit testing Entity Beans is not a well-established art, and there are some techniques and trivia that will save you time and frustration as you get started. For the remainder of this section we're going to cover the following three topics:
* Testing Against a Database
* Mandatory Tests for Entity Beans (CRUD Operations)
* How to Test Transaction Integrity & Rollback"
Entity Beans have a whole basket of special considerations which must be factored into your testing strategy. Unit testing Entity Beans is not a well-established art, and there are some techniques and trivia that will save you time and frustration as you get started. For the remainder of this section we're going to cover the following three topics:
* Testing Against a Database
* Mandatory Tests for Entity Beans (CRUD Operations)
* How to Test Transaction Integrity & Rollback"
OpenEJB -- Welcome
OpenEJB -- Welcome: "OpenEJB is an open source, modular, configurable, and extendable EJB Container System and EJB Server."
GroboUtils - Using Multi-Threaded Tests
GroboUtils - Using Multi-Threaded Tests
The GroboUtils class MultiThreadedTestRunner was based on the article "JUnit Best Practices" by Andy Schneider (andrew.schneider@javaworld.com), published online at http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html. Since GroboUtils first started using that implementation, many changes have occured in the code to make a more robust and stable testing environment. Due to these changes, the use of the class will be fully described in this document.
The GroboUtils class MultiThreadedTestRunner was based on the article "JUnit Best Practices" by Andy Schneider (andrew.schneider@javaworld.com), published online at http://www.javaworld.com/javaworld/jw-12-2000/jw-1221-junit_p.html. Since GroboUtils first started using that implementation, many changes have occured in the code to make a more robust and stable testing environment. Due to these changes, the use of the class will be fully described in this document.
Tuesday, May 03, 2005
Friday, April 29, 2005
Java Forums - Java 1.5 doesn't want to indent XML output?
Java Forums - Java 1.5 doesn't want to indent XML output?: "Re: Java 1.5 doesn't want to indent XML output?
Author: js Oct 20, 2004 2:40 PM (reply 2 of 16)
I got bit by this one too. After spending quite a while poring through the Java source, here's a solution:
TransformFactory factory = TransformerFactory.newInstance();
factory.setAttribute('indent-number', new Integer(4));
This works with Java 1.5 but (sigh) the setAttribute() call causes an IllegalArgumentException in 1.4. So wrap the setAttribute() in a try/catch and throw away the IllegalArgumentException..."
Author: js Oct 20, 2004 2:40 PM (reply 2 of 16)
I got bit by this one too. After spending quite a while poring through the Java source, here's a solution:
TransformFactory factory = TransformerFactory.newInstance();
factory.setAttribute('indent-number', new Integer(4));
This works with Java 1.5 but (sigh) the setAttribute() call causes an IllegalArgumentException in 1.4. So wrap the setAttribute() in a try/catch and throw away the IllegalArgumentException..."
Thursday, April 28, 2005
Java 5.0 Generics :: own Class definition
Java Forums - cast problem: "public class SomeClass { private Map map = new HashMap(); public SomeClass(Set set) { for (Iterator i = set.iterator(); i.hasNext();) { map.put(i.next(), Boolean.FALSE); } } } Set extSet = new HashSet(); SomeClass someClass = new SomeClass(extSet); "
Monday, April 25, 2005
Thursday, April 21, 2005
Wednesday, April 20, 2005
Tuesday, April 19, 2005
Monday, April 18, 2005
Friday, April 15, 2005
howto:horizontal_table_scroll [SwingWiki]
howto:horizontal_table_scroll [SwingWiki]: "By default, JTable scrolls only vertically, not horizontally (and cell width is automatically adjusted to fit into the available space, even in JScrollPane). If the table contains a lot of columns (10 ), the columns will become too short for any use, so you will have to enable horizontal scrolling.
To enable horizontal scrolling,
The downside to this method is that you have to set cell width manually. You might try to put the table into a JPanel of fixed size, without all this tweaking, and then put the enclosing JPanel into a JScrollPane. However, this leaves you with the problem of Missing JTable Header.
First, call table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF) to turn off automatic resizing. Then, manually set cell width for each column. In earlier JDK versions (1.3), you will also have to activate the horizontal scrollbar by hand - create JScrollPane with the following constructor call JSCrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS)
"
To enable horizontal scrolling,
The downside to this method is that you have to set cell width manually. You might try to put the table into a JPanel of fixed size, without all this tweaking, and then put the enclosing JPanel into a JScrollPane. However, this leaves you with the problem of Missing JTable Header.
First, call table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF) to turn off automatic resizing. Then, manually set cell width for each column. In earlier JDK versions (1.3), you will also have to activate the horizontal scrollbar by hand - create JScrollPane with the following constructor call JSCrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS)
"
Wednesday, April 13, 2005
Tuesday, April 12, 2005
Welcome to www.ExperimentalStuff.com
Welcome to www.ExperimentalStuff.com
-Brazil
-ChorusOS
-GCold
GCspy
-HotSwap
-JIntroTool
-JRMS_multicast
-JavaCC
-Java_Make_Tool
-Uqbt
-Walkabout
-mwpbp
-Brazil
-ChorusOS
-GCold
GCspy
-HotSwap
-JIntroTool
-JRMS_multicast
-JavaCC
-Java_Make_Tool
-Uqbt
-Walkabout
-mwpbp
Wednesday, April 06, 2005
Sunday, April 03, 2005
Tuesday, March 29, 2005
Thursday, March 24, 2005
Barcelona the multi-tasking VM Project by SUN
Barcelona
The Barcelona project is investigating virtual machine architectures to improve the scalability, reliability, and availability of the JavaTM platform. The main design dimension is transparent sharing of meta-data among computations. We are also working on enhancing the Java platform to make it a complete operating environment. This includes extending the platform with interfaces for application isolation and resource management.
The Barcelona project is investigating virtual machine architectures to improve the scalability, reliability, and availability of the JavaTM platform. The main design dimension is transparent sharing of meta-data among computations. We are also working on enhancing the Java platform to make it a complete operating environment. This includes extending the platform with interfaces for application isolation and resource management.
datavision
datavision
DataVision is an Open Source reporting tool similar to Crystal Reports. Reports can be designed using a drag-and-drop GUI. They may be run, viewed, and printed from the application or exported as HTML, XML, PDF, LaTeX2e, DocBook, or tab- or comma-delimited text files. The output files produced by LaTeX2e and DocBook can in turn be used to produce PDF, text, HTML, PostScript, and more.
DataVision is written in Java and runs almost anywhere. It can generate reports from databases or text data files. Any database with an available JDBC driver should work: Oracle, PostgreSQL, MySQL, Informix, hsqldb, Microsoft Access, Progress, and more. Columns read from text files can be separated by any character.
Report descriptions are stored as XML files. This means you can not only use the DataVision GUI but you may also edit reports using your favorite text editor.
DataVision is developed and maintained by Jim Menard (jimm@io.com). The latest version of DataVision can be found on the DataVision Web page. New releases are also announced on Freshmeat and on the DataVision mailing list.
DataVision is an Open Source reporting tool similar to Crystal Reports. Reports can be designed using a drag-and-drop GUI. They may be run, viewed, and printed from the application or exported as HTML, XML, PDF, LaTeX2e, DocBook, or tab- or comma-delimited text files. The output files produced by LaTeX2e and DocBook can in turn be used to produce PDF, text, HTML, PostScript, and more.
DataVision is written in Java and runs almost anywhere. It can generate reports from databases or text data files. Any database with an available JDBC driver should work: Oracle, PostgreSQL, MySQL, Informix, hsqldb, Microsoft Access, Progress, and more. Columns read from text files can be separated by any character.
Report descriptions are stored as XML files. This means you can not only use the DataVision GUI but you may also edit reports using your favorite text editor.
DataVision is developed and maintained by Jim Menard (jimm@io.com). The latest version of DataVision can be found on the DataVision Web page. New releases are also announced on Freshmeat and on the DataVision mailing list.
Wednesday, March 23, 2005
Monday, March 21, 2005
nullbugs.tigris.org
nullbugs.tigris.org
NullBugs was a project originally ordered by the program manager at Software Engineering & Management at the the IT-University of Göteborg. The students that were given this project to work on did not complete it in the limted time span given and this is how this project was created.
Right now NullBugs is pretty buggy and it only supports creating new issue databases and loading from them (and therefore no saving allowed). This is however something that I hope will change in the near future so that we ourselves can begin to use NullBugs as in issue tracker for this project.
NullBugs was a project originally ordered by the program manager at Software Engineering & Management at the the IT-University of Göteborg. The students that were given this project to work on did not complete it in the limted time span given and this is how this project was created.
Right now NullBugs is pretty buggy and it only supports creating new issue databases and loading from them (and therefore no saving allowed). This is however something that I hope will change in the near future so that we ourselves can begin to use NullBugs as in issue tracker for this project.
Sunday, March 20, 2005
Tuesday, March 15, 2005
Java Advanced Imaging: Class Histogram
Java Advanced Imaging: Class Histogram
...
double[] getEntropy()
Returns the entropy of the histogram.
...
double[] getEntropy()
Returns the entropy of the histogram.
NeatVision.com
NeatVision.com
NeatVision is a free Java based image analysis and software development environment, which provides high level access to a wide range of image processing algorithms through well defined and easy to use graphical interface. NeatVision is in its second major release. New features include: A full developers guide with method listings and programme examples, DICOM and Analyze medical image sequence viewers, URL control, feature fitting, supervised and unsupervised colour clustering, DCT, Improved FFT, 3D volume processing and surface rendering.
NeatVision contains over 290 image manipulation, processing and analysis algorithms. Users can extend the core NeatVision library using the developers interface, a plug-in which features, automatic source code generation, compilation with full error feedback and dynamic algorithm updates. NeatVision is primarily an image processing application and offers an extensive range of image analysis and visualization tools (these include zoom, pseudo colour, intensity scan, histogram and 3D profile mesh). In addition, the ability to read and write a wide range of image file formats is supported.
NeatVision is a free Java based image analysis and software development environment, which provides high level access to a wide range of image processing algorithms through well defined and easy to use graphical interface. NeatVision is in its second major release. New features include: A full developers guide with method listings and programme examples, DICOM and Analyze medical image sequence viewers, URL control, feature fitting, supervised and unsupervised colour clustering, DCT, Improved FFT, 3D volume processing and surface rendering.
NeatVision contains over 290 image manipulation, processing and analysis algorithms. Users can extend the core NeatVision library using the developers interface, a plug-in which features, automatic source code generation, compilation with full error feedback and dynamic algorithm updates. NeatVision is primarily an image processing application and offers an extensive range of image analysis and visualization tools (these include zoom, pseudo colour, intensity scan, histogram and 3D profile mesh). In addition, the ability to read and write a wide range of image file formats is supported.
Monday, March 14, 2005
SpeexX Blog - JMX mit Jakarta Commons Modeler
SpeexX Blog - JMX mit Jakarta Commons Modeler: "JMX mit Jakarta Commons Modeler Permalink | Printable
[Java]
Im Javamagazin 01.2005 beschreibt der Artikel 'JMX: �berwachung von E-Business-L�sungen' die Erzeugung von JMX ModelMBeans mit Hilfe der Apache Jakarta Commons Modeler Component. Leider orientiert sich der Artikel an der inzwischen stark veralteten Version 1.0 dieser API. In den Beipielcodes werden Methoden und Vorgehensweisen beschrieben, die seit der Version 1.1 als deprecated markiert sind.
Auch ist der Beispielcode auf Seite 21 sehr schwer zu verstehen. Dort ist z.B. nicht klar welche Interfaces implementiert werden m�ssen (ModelMBean) oder von welchen Klassen man ableiten muss (RequiredModelMBean). Zum gro�en Verdruss ist auch kein ausf�hrlicher Code auf der mitgelieferten CD vorhanden. Der beschrieben Beispielcode wirft eine ClassCastException, da die Methode ManagedBean.createMBean(Object) hart auf das Interface ModelMBean castet (sowohl Version 1.0 als auch 1.1 der Modeler API)."
[Java]
Im Javamagazin 01.2005 beschreibt der Artikel 'JMX: �berwachung von E-Business-L�sungen' die Erzeugung von JMX ModelMBeans mit Hilfe der Apache Jakarta Commons Modeler Component. Leider orientiert sich der Artikel an der inzwischen stark veralteten Version 1.0 dieser API. In den Beipielcodes werden Methoden und Vorgehensweisen beschrieben, die seit der Version 1.1 als deprecated markiert sind.
Auch ist der Beispielcode auf Seite 21 sehr schwer zu verstehen. Dort ist z.B. nicht klar welche Interfaces implementiert werden m�ssen (ModelMBean) oder von welchen Klassen man ableiten muss (RequiredModelMBean). Zum gro�en Verdruss ist auch kein ausf�hrlicher Code auf der mitgelieferten CD vorhanden. Der beschrieben Beispielcode wirft eine ClassCastException, da die Methode ManagedBean.createMBean(Object) hart auf das Interface ModelMBean castet (sowohl Version 1.0 als auch 1.1 der Modeler API)."
Running JavaServer Faces Technology-Based Portlets on Sun Java System Portal Server 6 2005Q1
Running JavaServer Faces Technology-Based Portlets on Sun Java System Portal Server 6 2005Q1
By extending the framework based on JavaServer Faces technology, you can run within a portal application a Web application based on that technology, commonly called a portlet, that complies with Java Specification Request (JSR) 168: Portlet Specification. You can also display the portlet within a channel on your desktop portal.
...
By extending the framework based on JavaServer Faces technology, you can run within a portal application a Web application based on that technology, commonly called a portlet, that complies with Java Specification Request (JSR) 168: Portlet Specification. You can also display the portlet within a channel on your desktop portal.
...
Java Portlet :: JSRs: Java Specification Requests - detail JSR# 168
The Java Community Process(SM) Program - JSRs: Java Specification Requests - detail JSR# 168: "Different implementations are available today, the following list enumerates some of them:
Apache Software Foundation: Jakarta JetSpeed 1.3
JetSpeed home page: http://jakarta.apache.org/jetspeed/site/index.html
JetSpeed Portlet API: http://cvs.apache.org/viewcvs/jakarta-jetspeed/proposals/portletAPI/
BEA: Web Logic Portal 4.0 http://www.bea.com/products/weblogic/portal/index.shtml
IBM: WebSphere Portal 2.1 http://www-4.ibm.com/software/webservers/portal/
iPlanet: iPlanet Portal Server 3.0 http://www.iplanet.com/products/iplanet_portal/home_portal.html
Oracle: Oracle 9i Portal http://www.oracle.com/ip/deploy/ias/portal/index.html
SAP Portal: http://www.iviewstudio.com
Epicentric portal: http://www.epicentric.com/solutions/products/efs/"
Apache Software Foundation: Jakarta JetSpeed 1.3
JetSpeed home page: http://jakarta.apache.org/jetspeed/site/index.html
JetSpeed Portlet API: http://cvs.apache.org/viewcvs/jakarta-jetspeed/proposals/portletAPI/
BEA: Web Logic Portal 4.0 http://www.bea.com/products/weblogic/portal/index.shtml
IBM: WebSphere Portal 2.1 http://www-4.ibm.com/software/webservers/portal/
iPlanet: iPlanet Portal Server 3.0 http://www.iplanet.com/products/iplanet_portal/home_portal.html
Oracle: Oracle 9i Portal http://www.oracle.com/ip/deploy/ias/portal/index.html
SAP Portal: http://www.iviewstudio.com
Epicentric portal: http://www.epicentric.com/solutions/products/efs/"
Saturday, March 12, 2005
Thursday, March 10, 2005
mms-computing - Simple applications using java capi wrapper (Voice Box, DTMF Actuator ...)
mms-computing - Simple applications using java capi wrapper (Voice Box, DTMF Actuator ...): "SimpleSpeechSend : A program that sends uk/co/mmscomputing/device/capi/samples/capture.raw to a 'remote' phone. SimpleSpeechSend needs a valid telephone number : java uk.co.mmscomputing.device.capi.samples.SimpleSpeechSend 004412345678
(Run SimpleSpeechReceive first, say your 'Hello world, I feel great!' when connected, then run SimpleSpeechSend and listen to your own voice.)
(In case you wonder what to do with the raw byte stream, have a look at project uk.co.mmscomputing.device.capi.sound, uk.co.mmscomputing.sound.
Run Raw2WaveConverter to convert the raw capture.raw file into the wave files capturePCM.wav, captureALaw.wav and captureuLaw.wav)"
(Run SimpleSpeechReceive first, say your 'Hello world, I feel great!' when connected, then run SimpleSpeechSend and listen to your own voice.)
(In case you wonder what to do with the raw byte stream, have a look at project uk.co.mmscomputing.device.capi.sound, uk.co.mmscomputing.sound.
Run Raw2WaveConverter to convert the raw capture.raw file into the wave files capturePCM.wav, captureALaw.wav and captureuLaw.wav)"
Wednesday, March 09, 2005
Tuesday, March 08, 2005
The Grinder, a Java Load Testing Framework
The Grinder, a Java Load Testing Framework
What is The Grinder?
The Grinder is a JavaTM load-testing framework. It is freely available under a BSD-style open-source license.
The Grinder makes it easy to orchestrate the activities of a test script in many processes across many machines, using a graphical console application. Test scripts make use of client code embodied in Java plug-ins. Most users of The Grinder do not write plug-ins themselves, instead they use one of the supplied plug-ins. The Grinder comes with a mature plug-in for testing HTTP services, as well as a tool which allows HTTP scripts to be automatically recorded.
The Grinder was originally developed for the book Professional Java 2 Enterprise Edition with BEA WebLogic Server by Paco Gómez and Peter Zadrozny. Philip Aston took ownership of the code and reworked it to create The Grinder 2. Philip continues to enhance and maintain The Grinder, and welcomes all contributions. Recently Peter, Philip and Ted Osborne have published the book J2EE Performance Testing which makes extensive use of The Grinder.
The next major version of The Grinder, The Grinder 3 is currently available as a beta quality release. The Grinder 3 uses the powerful scripting language Jython, and allows any Java code to be tested without the need to write a plug-in.
The latest news, downloads, and mailing list archives can be found on SourceForge.net.
What is The Grinder?
The Grinder is a JavaTM load-testing framework. It is freely available under a BSD-style open-source license.
The Grinder makes it easy to orchestrate the activities of a test script in many processes across many machines, using a graphical console application. Test scripts make use of client code embodied in Java plug-ins. Most users of The Grinder do not write plug-ins themselves, instead they use one of the supplied plug-ins. The Grinder comes with a mature plug-in for testing HTTP services, as well as a tool which allows HTTP scripts to be automatically recorded.
The Grinder was originally developed for the book Professional Java 2 Enterprise Edition with BEA WebLogic Server by Paco Gómez and Peter Zadrozny. Philip Aston took ownership of the code and reworked it to create The Grinder 2. Philip continues to enhance and maintain The Grinder, and welcomes all contributions. Recently Peter, Philip and Ted Osborne have published the book J2EE Performance Testing which makes extensive use of The Grinder.
The next major version of The Grinder, The Grinder 3 is currently available as a beta quality release. The Grinder 3 uses the powerful scripting language Jython, and allows any Java code to be tested without the need to write a plug-in.
The latest news, downloads, and mailing list archives can be found on SourceForge.net.
Monday, March 07, 2005
PMD - Problem finder in Java Source Code
PMD - PMD
PMD scans Java source code and looks for potential problems like:
* Empty try/catch/finally/switch blocks
* Unused local variables, parameters and private methods
* Empty if/while statements
* Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
* Classes with high Cyclomatic Complexity measurements
PMD has plugins for JDeveloper, Eclipse, JEdit, JBuilder, Omnicore's CodeGuide, NetBeans/Sun ONE Studio, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and Emacs.
PMD scans Java source code and looks for potential problems like:
* Empty try/catch/finally/switch blocks
* Unused local variables, parameters and private methods
* Empty if/while statements
* Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
* Classes with high Cyclomatic Complexity measurements
PMD has plugins for JDeveloper, Eclipse, JEdit, JBuilder, Omnicore's CodeGuide, NetBeans/Sun ONE Studio, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and Emacs.
Sunday, March 06, 2005
Saturday, March 05, 2005
Friday, March 04, 2005
Thursday, March 03, 2005
JDBC URL for direct Connection to an Access database
If you want to connect to an Access Database File (*.mdb file) without creating an DSN entry in the system, you can enter all needed informations directly in the JDBC URL. Here is an example for the German Access driver
jdbc:odbc:Driver={Microsoft Access-Treiber (*.mdb)};dbq=D:\temp\example.mdb;uid=Admin
Replace the driver name you usually use in the DSN configuration and the concrete path to the mdb file and you should be able to access to the access file via JDBC.
Hope this hint helps.
Comments are welcome.
jdbc:odbc:Driver={Microsoft Access-Treiber (*.mdb)};dbq=D:\temp\example.mdb;uid=Admin
Replace the driver name you usually use in the DSN configuration and the concrete path to the mdb file and you should be able to access to the access file via JDBC.
Hope this hint helps.
Comments are welcome.
Wednesday, March 02, 2005
Subscribe to:
Posts (Atom)