| Sending Hop Limited UDP packets |
|
 |
Index ‹ java-programmer
|
- Previous
- 3
- 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
- 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>
- 3
- 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.
- 4
- 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)
- 4
- 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
- 7
- 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
- 8
- Mac version of IE tires to download sounds rather than playing them.
I've done a web site which encorporates javascripted sound behaviors.
On the PC version of Internet Explorer they do what they're supposed
to do. That is, play the sound on both "mouse over" and "mouse up"
events.
On the Macintosh version of IE it triggers off an automatic download
attempt. I have also seen this on some PC's running Netscape, but
rarely.
Opera doesn't even seem to do anything with the sound events on the
Mac. The PC version of Opera seems to work correctly.
So, my question: is there a way to code this using Dreamweaver or
some other authoring program, so it can be controlled on these
different combinations of browsers, and Computer Platforms?
I've found this most frustrating.
Thanks for any help you might give on this.
S.
- 8
- 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"
- 11
- SourceDataLine ProblemA while back I implemented sound using javax.sound.sampled into my Tandy
Color Computer 2 applet.
The Color Computer had a 6-bit DAC used to generate audio. I basically
take the values written to the DAC and then feed them (although at a
much higher rate) into a SourceDataLine.
The problem is that the sound can crackle or break up depending on the
program emulated. I can prevent this by either feeding the data to the
SorceDataLine at a higher rate or by reducing the sample rate on the
AudioFormat. Both of these methods fix the breakups but then the pitch
drops enough that the sound is no longer accurately emulated.
I just don't understand the workings of javax.sound.sampled well enough
to figure out a workaround for this problem - it seems like it should be
possible.
Any ideas?
Brad
Mocha - The Tandy Color Computer 2 Applet
http://members.cox.net/javacoco/
- 11
- 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!
- 12
- 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
- 13
- 15
- 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);
}
}
- 15
- Trying to create a database in a MS Access DB via JDBC drivers. I am trying to create a database in a MS Access DB via JDBC drivers.
I have tried both sun.jdbc.odbc.JdbcOdbcDriver and ids.sql.IDSDriver
From some reason both drivers Exceptions tell me 'Syntax error in
CREATE TABLE statement' even though I am not creating a table, but a
Database
// - - - - - - - - - - - - sun.jdbc.odbc.JdbcOdbc
aSQL=CREATE DATABASE dbtest;
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]
Syntax error in CREATE TABLE statement.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown
Source)
at JDBCDL00.createCtlg(JDL00.java:200)
at JDL00.main(JDL00.java:505)
// - - - - - - - - - - - - ids.sql
aSQL=CREATE DATABASE dbtest;
java.sql.SQLException: [42000][Microsoft][ODBC Microsoft Access
Driver] Syntax error in CREATE TABLE statement
at ids.sql.IDSSocket.error(IDSSocket.java:374)
at ids.sql.IDSSocket.verify(IDSSocket.java:320)
at ids.sql.IDSStatement.submit(IDSStatement.java:157)
at ids.sql.IDSStatement.execute(IDSStatement.java:479)
at ids.sql.IDSStatement.executeUpdate(IDSStatement.java:270)
at JDBCDL00.createCtlg(JDL00.java:200)
at JDL00.main(JDL00.java:505)
Does it mean MS Access does not have a concept of a BD, since it is
kind of a file base Data Store?
There is also something I don't quite know how to interpret.
When you ask the JdbcOdbc driver for Catalogs it gives you
. . .\Office\Samples\ADDRBOOK
. . .\Office\Samples\CONTACT
. . .\Office\Samples\INVENTRY
. . .\Office\Samples\Northwind
even if you declare the a USer DSN only to
. . .\Office\Samples\Northwind
Experimentally I dropped a copy of
. . .\Office\Samples\Northwind.mdb
in
. . .\IDS\File\examples
and set up a system DSN to got IDSExamples.mdb
However, while query the DBMS for catalogs, I got
. . .\IDS\File\examples\IDSExamples
. . .\IDS\File\examples\Northwind
Does it mean Access considers the folder containing the '.mdb' file
as sort of a 'schema'?
How could u still create a Database using JDBC in a MSAccess DB?
- 15
|
| Author |
Message |
Ashoka!

|
Posted: 2007-4-10 16:23:00 |
Top |
java-programmer, Sending Hop Limited UDP packets
Is 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
|
| |
|
| |
 |
Knute Johnson

|
Posted: 2007-4-11 0:16:00 |
Top |
java-programmer >> Sending Hop Limited UDP packets
Ashoka! wrote:
> Is 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
>
I think you would have to write your own DatagramSocketImpl. But I'm
curious as to why you would want a TTL on a unicast UDP packet. Do you
not want it to get to it's address?
--
Knute Johnson
email s/nospam/knute/
|
| |
|
| |
 |
Gordon Beaton

|
Posted: 2007-4-11 0:23:00 |
Top |
java-programmer >> Sending Hop Limited UDP packets
On Tue, 10 Apr 2007 09:15:49 -0700, Knute Johnson wrote:
> I think you would have to write your own DatagramSocketImpl. But I'm
> curious as to why you would want a TTL on a unicast UDP packet. Do
> you not want it to get to it's address?
It's one way of implementing traceroute, but I can't think of any
other uses.
/gordon
--
|
| |
|
| |
 |
Esmond Pitt

|
Posted: 2007-4-11 17:09:00 |
Top |
java-programmer >> Sending Hop Limited UDP packets
Ashoka! wrote:
> Is 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?
Use a MulticastSocket so you get the setTimeToLive() API and just send
to a unicast address.
|
| |
|
| |
 |
Gordon Beaton

|
Posted: 2007-4-11 17:23:00 |
Top |
java-programmer >> Sending Hop Limited UDP packets
On Wed, 11 Apr 2007 09:09:12 GMT, Esmond Pitt wrote:
> Use a MulticastSocket so you get the setTimeToLive() API and just
> send to a unicast address.
Does that actually work?
I was going to make the same suggestion earlier, but tested first and
couldn't see (with Wireshark) that the setting had any effect on
unicast packets. The documentation seems to confirm this:
"Set the default time-to-live for *multicast* packets sent [...]"
/gordon
--
|
| |
|
| |
 |
Esmond Pitt

|
Posted: 2007-4-12 8:21:00 |
Top |
java-programmer >> Sending Hop Limited UDP packets
Gordon Beaton wrote:
> On Wed, 11 Apr 2007 09:09:12 GMT, Esmond Pitt wrote:
>
>>Use a MulticastSocket so you get the setTimeToLive() API and just
>>send to a unicast address.
>
> Does that actually work?
oops, err, hmm, maybe not ... on investigation it turns out that there
are both IP_TTL and IP_MULTICAST_TTL, and
MulticastSocket.setTimeToLive() sets the latter, and the OP wants the
former ...
so you can't do it in Java.
|
| |
|
| |
 |
Ashoka!

|
Posted: 2007-4-26 19:42:00 |
Top |
java-programmer >> Sending Hop Limited UDP packets
I am trying to implement the tailgating algorithm to measure internet
bandwidth.
On Apr 12, 5:21 am, Esmond Pitt <email***@***.com>
wrote:
> Gordon Beaton wrote:
> > On Wed, 11 Apr 2007 09:09:12 GMT, Esmond Pitt wrote:
>
> >>Use a MulticastSocket so you get the setTimeToLive() API and just
> >>send to a unicast address.
>
> > Does that actually work?
>
> oops, err, hmm, maybe not ... on investigation it turns out that there
> are both IP_TTL and IP_MULTICAST_TTL, and
> MulticastSocket.setTimeToLive() sets the latter, and the OP wants the
> former ...
>
> so you can't do it in Java.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- 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
- 2
- 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
- 3
- 4
- 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:
- 5
- 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...
- 6
- IE AutomationI am working on developing a test application in java. I use java for UI
only. I use JNI to communicate with a VC MFC DLL. I launch an IE browser
instance in one JNI method (init()), which works fine.
OleInitialize(NULL);
CLSID clsid;
CLSIDFromProgID(OLESTR("InternetExplorer.Application"), &clsid);
HRESULT hr = CoCreateInstance(clsid, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (void**)&m_spBrowser);
I store the browser pointer (IWebBrowser2 *) as a C++ class instance
variable. BTW, I start a
thread on the native side (_beginthread) which in turn calls the method that
launches the browser.
Previously I was facing the problem of marshalling, the IWebBrowser2 pointer
was getting correupted, when used in different methods (even the simple
properties of IWebBrowser2 (like IWebBrowser2::fullname) were not
accessible). So now I have added the code of marshalling after the browser
is launched. In almost all the other methods, I first unmarshall the
interface and then marshall it back at the end of it. This solved my earlier
mentioned problem.
void CIECanvas::MarshallInterface()
{
HRESULT hr;
if(SUCCEEDED(hr = ::CreateStreamOnHGlobal(NULL, TRUE, &pstm)))
{
LARGE_INTEGER bZero = {0, 0};
pstm->Seek(bZero, STREAM_SEEK_SET, NULL);
if(SUCCEEDED(::CoMarshalInterface(pstm, IID_IWebBrowser2, m_spBrowser,
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL)))
{
pstm->Seek(bZero, STREAM_SEEK_SET, NULL);
}
}
}
void CIECanvas::UnmarshallInterface()
{
LARGE_INTEGER bZero = {0, 0};
pstm->Seek(bZero, STREAM_SEEK_SET, NULL);
HRESULT hr = ::CoUnmarshalInterface(pstm, IID_IWebBrowser2,
(void**)&m_spBrowser);
if(FAILED(hr))
{
showMessageBox("CIECanvas::UnmarshallInterface()", "%s %ld", "FAILED.
ERROR CODE = ", GetLastError());
}
}
Then for recording I use AfxConnectionAdvise(), which is working fine.
The problem I am facing is in Replaying the events.
1)The VM crashes with a hotspot error, when on the first page some link
click event is present, which loads a new page. One observation here is the
VM crashes after onBeforeNavigate2 or TitleChange events are fired.
2)I also tried Yahoo's registration page (having a lot of dropdowns and
checkboxes), it works fine for the first few events, but then the VM
crashes.
My questions are
1)Does IE handle the events like page loading (tiltle change etc.) and click
on some link in different threads? How are the events handled (any useful
info on this)?
2)How should I fix the problem?
3)Is it related to marshalling of IE COM pointers?
Please replay ASAP,
Nikhil
- 7
- 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
- 8
- 9
- [ANNOUNCE] Apache Derby 10.4.1.3 releasedThe Apache Derby project is pleased to announce a new feature release
of Derby, 10.4.1.3.
Apache Derby is a subproject of the Apache DB project.
Derby is a pure Java relational database engine which conforms to the
ISO/ANSI SQL and JDBC standards. Derby aims to be easy for developers
and end-users to work with.
Derby 10.4.1.3 can be obtained from the Derby download site:
http://db.apache.org/derby/derby_downloads.html.
Derby 10.4.1.3 introduces the following new capabilities:
* Asynchronous Replication
Allows you to maintain an up to date copy of your (master) database on
a different host (the slave). In the case of a crash on the master
database you can perform failover to the copy (slave database) and
continue serving client requests against your database.
* Security
o Shutting down the Network Server now supports user authentication,
and in fact requires credentials when authentication is enabled.
* SQL
o Table Functions. Using table functions and standard SQL, you can pose
sophisticated queries against in-memory collections, flat files, web
resources, non-relational databases, etc.. Table functions also let
you efficiently import data from web feeds, sensor logs, and other
relational databases.
o Unique constraints on nullable columns.
o SQL ROW_NUMBER() window function, (for an empty, inlined window
specification).
o Bracketed comments (/* ... */).
* Performance and Memory Usage
o New buffer manager with better concurrency.
o Statement cache in the client driver.
o Caching of isolation level and current schema in the client
driver.
* Administration
o Java Management Extensions (JMX) for Derby, allowing
local and remote monitoring and management of running Derby instances
(embedded or Network Server).
o Continuation prompt. ij adds a short "> " prompt to the next line
after a newline has been entered by the user without ending the
statement with a semicolon.
Derby 10.4.1.3 also has many bugfixes, including the fix for
DERBY-3347 which can cause unrecoverable database corruption. All
10.3 users are encouraged to upgrade to avoid potential corruption
issues.
--
Regards,
Dyre
- 10
- 11
- Data generatorDo You know if there is any data generator for databases like TurboData,
but for free?
- 12
- 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.)
- 13
- 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.
- 14
- [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
- 15
- 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.
|
|
|