| [ANNOUNCE] Apache Derby 10.4.1.3 released |
|
 |
Index ‹ java-programmer
|
- Previous
- 1
- mozilla and firefox java plugins on jdk1.5.0 Hi all
Have java plugins to firefox and mozilla browsers jdk1.5.0 on Freebsd?
this not work already...
ln -s /usr/local/jdk1.4.2/jre/plugin/i386/ns610/libjavaplugin_oji.so \
/usr/X11R6/lib/browser_plugins/
I have jdk1.5.0 and the dir /plugin is dissapeared :-(
%pwd
/usr/local/jdk1.5.0/jre
%ll
total 36
drwxr-xr-x 2 root wheel 512 14 feb 22:12 .systemPrefs
-r--r--r-- 1 root wheel 2487 14 feb 21:53 COPYRIGHT
-r--r--r-- 1 root wheel 969 14 feb 21:53 CHANGES
-r--r--r-- 1 root wheel 9223 14 feb 21:53 LICENSE
-r--r--r-- 1 root wheel 11172 14 feb 21:53 README
-r--r--r-- 1 root wheel 969 14 feb 21:53 Welcome.html
drwxr-xr-x 2 root wheel 512 14 feb 22:11 bin
drwxr-xr-x 14 root wheel 1024 14 feb 22:11 lib
I have installed too...
%java -version
java version "1.5.0-p1"
linuxpluginwrapper-20050119_1
thanks in advance!
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 1
- Certificate Login ModuleHi All,
If I am correct JBoss has added a SSL certificate login module in
version 4.0. I wanted to have a peek in it, but the source code of JBoss
4.0 is not available.
Can anybody please let me know from where can I get the source code of
JBoss 4.0? Or better, can anybody please send me the source code of such
a Login Module.
Any pointers in this direction will be highly appreciated.
Thanks in Advance,
-DN
- 1
- Scroll JList to bottom automatic .
Hi,
How to automatic scroll a JList to bottom of the list, i.e when inserting
new elements. My list have i created like this:
JList jlist = new JList(objectArray);
JScrollPane scroll = new JList(jlist);
Any simple code to do this?
Best Regards
/Jonny
- 1
- Cannot draw on mutable imageHi,
I got a problem with drawing on an image created with the
createImage(int width, int height) method. I use MIDP 1.0 and
everything works fine in the emulator. But when running it on my
T-630, I just get a white image with the defined size. It doesn't
matter what I draw on the Graphics-object, my phone just displays a
white rectangle.
The code should be ok, since it works in the emulator. I also used
several examples from the internet - all with the same result.
Any ideas what might be wrong?
Thanks in advance
Dirk
- 2
- best approach for transaprent boxes
I'm hoping for some guidance on the best way to do the following, since I am fairly new to the Java language.
I am building an applet that uses a canvas to show a map (awt only - no swing). I want to display semi-transaparent boxes over the top of the map to show things like status, or have options, and the boxes should be able to process mouse events. The canvas is using a double-buffered strategy and uses Graphics2D.
My first thought was to simply design lightweight components - but they require a container, which the Canvas is not.
So then I thought I would extend the Canvas class to work with another completely custom "decorator" class that would be able to buffer the area of the canvas it covers for quick updating if it changes, and draw it's own info on top - but I just can't figure out how to grab a part of the rendered parent canvas to store offscreen and paint again later.
So my question is: Is the second method a good way to go about this, or is there a better "Java" way of doing this (I'm still probably thinking in a Delphi mindset)? And if the second way is ok, then how do I buffer just part of the parent canvas?
Phil.
- 3
- JNDI Authenticate UserHi All,
I have the below code which is supposed to return a true if the user is
authenticated against active directory and false if the user is not.
This works fine if you send it a correct username and correct password. It
also works if you send it a correct username with an incorrect password. It
also works if you send it an in-correct username with a password.
My problem is that a few accounts in the directory don't have passwords set.
I.e. password is blank. If I send any username without a password then it
always returns true, even if that user has a password set or the user
doesn't exist. Does anyone have any ideas why this is?
<code>
public boolean authenticateUser(String userName, String password){
//Try to log in with the supplied username and password
//If it fails then either the user doesn't exist or the wrong
crudentials where supplied
try{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, ldapConnectionString);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, userName + "@" +
ADName);
env.put(Context.SECURITY_CREDENTIALS, password);
DirContext ctx = new InitialDirContext(env);
return true;
}catch(Exception ex){
//Authentication failed
return false;
}
}
</code>
- 7
- Using a JList with a cell renderer within an applet/cell renderer not workingI have a cell renderer for a JList that is supposed to render the foreground
color in blue, and also insert tabs into the lines. When this code is
changed to run as an application, the cell renderer performs as expected.
When the code is run as an applet, the cell renderer has no impact at all.
Any help would be appreciated.
I am using SDK 1.4.0, Windows XP Professional.
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import java.text.DecimalFormat;
import javax.swing.text.MaskFormatter;
import java.text.ParseException;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import java.util.StringTokenizer;
public class TempConvert extends JApplet {
public JFormattedTextField low;
public JFormattedTextField high;
public JFormattedTextField incr;
public TempConvert() {
getContentPane().setLayout(new BorderLayout());
createGrid();
setSize(270,400);
}
private void createGrid() {
JPanel panel = new JPanel(new BorderLayout());
// add selection panel
MaskFormatter mf1 = null;
MaskFormatter mf2 = null;
try
{
mf1 = new MaskFormatter("####");
mf1.setPlaceholderCharacter('_');
//mf1.setCommitsOnValidEdit(true);
mf2 = new MaskFormatter("###");
mf2.setPlaceholderCharacter('_');
//mf2.setCommitsOnValidEdit(true);
}
catch (ParseException e){
}
low = new JFormattedTextField(mf1);
low.setFocusLostBehavior(JFormattedTextField.COMMIT);
high = new JFormattedTextField(mf1);
high.setFocusLostBehavior(JFormattedTextField.COMMIT);
incr = new JFormattedTextField(mf2);
incr.setFocusLostBehavior(JFormattedTextField.COMMIT);
JPanel select = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.NONE;
addgbc(select, new JLabel("Low Temperature Range . . ."),gbc,0,0);
addgbc(select, low,gbc,1,0);
addgbc(select, new JLabel("High Temperature Range . ."),gbc,0,1);
addgbc(select, high,gbc,1,1);
addgbc(select, new JLabel("Increment Degrees . . . . ."),gbc,0,2);
addgbc(select, incr,gbc,1,2);
panel.add(select, BorderLayout.NORTH);
// add temperature list
final JList list = new JList();
TabListCellRenderer renderer = new TabListCellRenderer();
//renderer.setTabs(new int[] {50,200,300,});
list.setCellRenderer(renderer);
JScrollPane scroller = new JScrollPane();
scroller.getViewport().add(list);
panel.add(scroller, BorderLayout.CENTER);
// add buttons
JPanel buttons = new JPanel(new FlowLayout(FlowLayout.CENTER,5,5));
JButton ok = new JButton("OK");
JButton cancel = new JButton("Cancel");
buttons.add(ok);
buttons.add(cancel);
panel.add(buttons, BorderLayout.SOUTH);
getContentPane().add(panel);
//pack();
setVisible(true);
// register action listeners for the buttons
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (verifyData())
{
list.setListData(calculateTemps());
list.revalidate();
list.repaint();
}
}
});
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// stop();
// destroy();
}
});
}
private int getIntValue(JFormattedTextField field)
{
try
{
return Integer.parseInt(field.getText().toString().replace('_','
').trim());
}
catch (NumberFormatException e){}
return 0;
}
private boolean verifyData()
{
int lowTemp = getIntValue(low);
int highTemp = getIntValue(high);
int incrTemp = getIntValue(incr);
if (lowTemp < 0)
{
JOptionPane.showMessageDialog(this, "If low temperature is entered, must
be greater than zero");
return false;
}
if (highTemp == 0)
{
JOptionPane.showMessageDialog(this, "High temperature must be entered");
return false;
}
if (highTemp <= lowTemp)
{
JOptionPane.showMessageDialog(this, "High temperature must be greater
than low temperature");
return false;
}
if (incrTemp == 0)
{
JOptionPane.showMessageDialog(this, "Increment degrees must be
entered.");
return false;
}
return true;
}
private void addgbc(Container cont, JComponent comp, GridBagConstraints
gbc, int x, int y) {
gbc.gridx=x; gbc.gridy=y;
cont.add(comp,gbc);
}
private TempData[] calculateTemps() {
int lowTemp = getIntValue(low);
int highTemp = getIntValue(high);
int incrTemp = getIntValue(incr);
int range = highTemp-lowTemp;
TempData[] tempdata = new TempData[range/incrTemp +1];
int j=0;
for (int i=lowTemp; i<=highTemp; i+=incrTemp) {
tempdata[j] = new TempData(i);
j++;
}
return tempdata;
}
public static void main (String[] args) {
new TempConvert();
}
public class TempData {
int fahrenheit;
int celsius;
public TempData(int fahrenheit) {
this.fahrenheit = fahrenheit;
calculateTemp();
}
private void calculateTemp() {
double temp = 5/9 * (fahrenheit-32);
celsius = (int)temp;
}
public String toString() {
return fahrenheit + "\t" + celsius;
}
}
}
class TabListCellRenderer
extends JLabel
implements ListCellRenderer {
protected static Border m_noFocusBorder;
protected FontMetrics m_fm = null;
protected Insets m_insets = new Insets(0, 0, 0, 0);
protected int m_defaultTab = 50;
protected int[] m_tabs = null;
public TabListCellRenderer() {
m_noFocusBorder = new EmptyBorder(1, 1, 1, 1);
setOpaque(true);
setBorder(m_noFocusBorder);
}
public Component getListCellRendererComponent(JList list,
Object value, int index, boolean isSelected, boolean cellHasFocus) {
setText(value.toString());
System.out.println("getText = " + getText());
setBackground(isSelected ? list.getSelectionBackground() :
list.getBackground());
//setForeground(isSelected ? list.getSelectionForeground() :
list.getForeground());
setForeground(Color.blue);
//setBackground(Color.blue);
setFont(list.getFont());
setBorder((cellHasFocus) ?
UIManager.getBorder("List.focusCellHighlightBorder") : m_noFocusBorder);
return this;
}
public void setDefaultTab(int defaultTab) {
m_defaultTab = defaultTab;
}
public int getDefaultTab() {
return m_defaultTab;
}
public void setTabs(int[] tabs) {
m_tabs = tabs;
}
public int[] getTabs() {
return m_tabs;
}
public int getTab(int index) {
if (m_tabs == null)
return m_defaultTab*index;
int len = m_tabs.length;
if (index>=0 && index<len)
return m_tabs[index];
return m_tabs[len-1] + m_defaultTab*(index-len+1);
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
Color colorRetainer = g.getColor();
m_fm = g.getFontMetrics();
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
getBorder().paintBorder(this, g, 0, 0, getWidth(), getHeight());
g.setColor(getForeground());
g.setFont(getFont());
m_insets = getInsets();
int x = m_insets.left;
int y = m_insets.top + m_fm.getAscent();
StringTokenizer st = new StringTokenizer(getText(), "\t");
while (st.hasMoreTokens()) {
String sNext = st.nextToken();
System.out.println("next token = " + sNext);
g.drawString(sNext, x, y);
x += m_fm.stringWidth(sNext);
if (!st.hasMoreTokens())
break;
int index = 0;
while (x >= getTab(index))
index++;
x = getTab(index);
}
g.setColor(colorRetainer);
}
}
- 10
- 14
- JAX-RPC: Strange Exception with Dynamic Proxy ClientHello there
I am using currently SUN's Webservice Development Kit 1.4 and try to
realise a JAX-RPC "rpc/encoded" webservice.
My applicatio is currently running if I am using a static client
(stubs geenerated by wscompile). If am going forward to use a dynamic
proxy client, I am getting a strange exception during the
deserialization of the xml data on the client: "trailing block
elements must have an id attribute". see stack trace at the end of the
messsage.
As far as I understand is that it must somewthing be with the
"ArrayList" or arrays which I am using in my JavaBean which I sent
from the server to the client. Here my extract from my JavaBean:
public class Article
{
long id;
Date date;
String category;
String title="";
String lead="";
List texts;
}
If I am taking out the member "List texts" then it will work
correctly. The list contains only Strings. I tried also to use
String[] array, but this didn't help either.
So here, my questions perhaps someone has some ideas what I did wrong.
- Why does it work with the stastic cleint but not with the dynamic
proxy?
- Does anybody know an example on the net where in JavaBeans Lists or
Arrays has been used?
- Anybody an idea why this error appears? Did I something wrong?
Thank you in advance
Mark Egloff
trailing block elements must have an id attribute
at com.sun.xml.rpc.encoding.SOAPDeserializationContext.deserializeMultiRefObjects(SOAPDeserializationContext.java:81)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:226)
at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:80)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:489)
at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:122)
at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:86)
at $Proxy0.getArticle(Unknown Source)
at tagesanzeiger.client.ManagerDynamicClient.main(ManagerDynamicClient.java:43)
- 15
- 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
- 16
- 16
- 16
- integration with JSTL
Hallo, here is my question. I have a Java API
to access some data (collections and strings).
How do I make sure that my API is such that i can access data trhough
the JSTL?
I want to be able to do things like the following
in my JSPs:
<c:if test="$someobj.property == 'john'">
Hallo John
</c:if>
Thanks
Luca
- 16
- Something FunHere's something fun that you may find interesting. I don't really have
enough know-how to do anything with it yet, but some of you might.
http://mtg.upf.edu/reactable/
One of the releases is in Java. Here's a video of it finished.
http://youtube.com/watch?v=0h-RhyopUmc
If anyone does anything with this, let me know!
- 16
- 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.)
|
| Author |
Message |
Dyreatnews

|
Posted: 2008-4-26 18:21:00 |
Top |
java-programmer, [ANNOUNCE] Apache Derby 10.4.1.3 released
The 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
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Data generatorDo You know if there is any data generator for databases like TurboData,
but for free?
- 2
- 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:
- 3
- 4
- 5
- 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();
}
}
- 6
- 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...
- 7
- 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?)
- 8
- 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
- 9
- 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.
- 10
- 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
- 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
- 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.
- 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
- 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
- 15
- 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
|
|
|