| [PATCH] jdk1.4.2, getsockname(), and ECONNRESET |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- JTable column headers - how?How do you show column headers on a JTable. I'm using j2se 5.0.
I thought this would do it;
// Sets up the table.
private JTable setupTable()
{
// The columns and data.
Vector<String> columns= new Vector<String>();
Vector<Vector> data= new Vector<Vector>();
// Get the columns.
// Note well: this relies on SyslogRecord knowing it's own data
members.
String[] dataMembers= SyslogRecord.getDataMemberNames();
// First we want a "Seen" column.
columns.add("Seen");
// Now add the rest.
for (int i= 0; i < dataMembers.length; i++)
columns.add(dataMembers[i].toString());
// Add the data
Iterator it= syslog.iterator();
while (it.hasNext())
{
Vector<String> v= new Vector<String>();
SyslogRecord sr= (SyslogRecord)it.next();
// Add the "Seen" value 1st.
v.add("No");
v.add(DateWrapper.toString(sr.getDate()));
v.add(sr.getMachine());
v.add(sr.getUser());
v.add(sr.getMessage());
data.add(v);
}
// Need to set the data model for the table.
DefaultTableModel tModel= new DefaultTableModel();
tModel.setDataVector(data,columns);
JTable jt= new JTable();
jt.setModel(tModel);
return jt;
}
This compiles fine but when I run it, I get all of my data, but no
column headers!
Any ideas?
Thanks,
John
- 5
- Printing from a text panei am making a small RTF word processor and trying to print from a
JTextPane.The setPrintable method is giving me problems as i dont know
what to pass to it
protected void printData()
{
getJMenuBar().repaint();
try
{
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintable();
if(!printJob.printDialog())
return;
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR ) );
printJob.print();
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR ) );
}
catch(PrinterException e)
{
e.printStackTrace();
System.err.println("Printing error" + e.toString() );
}
}
- 5
- suppress compile errorI'm debugging and therefore like to *return* at location I prefer. However,
compilation error
test.java:85: unreachable statement
selectCmd = "create temporary table match_detail_table as ("
+ selectCmd;
^
1 error
occurs. How to suppress this error?
...
stmt = con.createStatement();
stmt.execute(selectCmd); //String explainCmd = selectCmd;
* return;
****
selectCmd = "create temporary table match_detail_table as (" +
selectCmd;
selectCmd += ")";
...
- 5
- Real world use of CVS within JDeveloperDoes anyone have anything good to say about JDeveloper's use of CVS?
I've previously used WSAD but due to constraints (OracleAS webapp) I
want to use JDev but I'm trying to see how a team of developers would
really work as a team with CVS code control.
I've just checked in an edit on a file on one of the team PCs but I
can't see any quick and convenient way of detecting the change on
another PC. Worse still - when I edited the same file on another PC and
then tried to commit the change - it just throws an error message
stating "failed to commit to the CVS repository" / "cvs server:
Up-to-date check failed for ... cvs [server aborted]: correct above
errors first!"
This then forces me down the line of going back to find the jdev 'cvs
update' menu option to merge the changes together - and then re-edit
the CVS entries to re-fix the code. ... And then the update doesn't let
me edit the differences - it's all or nothing with jdev!
This is all a little high-maintenance; WSAD does it so much better
(with comparison edits and allowing you to selectively copy parts of
the file changes instead of the whole thing.
Does this sound familiar or have I got this wrong?
Any thoughts on a better way of doing things if I just can't change
IDE.
Many thanks
- 5
- Applet looking for class file improperlyI was having a peek at the error log on my website and discovered all
kinds of errors of this form:
[Thu Jan 12 01:13:59 2006] [error] [client 84.58.217.241] File does
not exist:
net:/com/mindprod/www/jgloss/com.html/mindprod/borders/Borders.class,
referer: http://mindprod.com/jgloss/border.html
that corresponds to
<applet code="com.mindprod.borders.Borders.class"
archive="../applets/borders.jar" width="430" height="250" alt="JPanel
Borders">
Need Java to see this.
</applet><p>
It looks like the browser is asking the server for the class even
though it has been given an archive. I don't know what browser(s) do
this.
Perhaps I should not tell it the main class, and trust the manifest.
Even so the name is screwed up. They added an .html to the first leg
of the package name.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
- 5
- carriage return in hex 0DHi,
I need some help in writing Java code in representing carriage returns
in Hex 0D. I've written a program in Java on an Unix system that
passes data to a Stratus machine via TCP/IP socket. The data I send to
the Stratus box needs to have carriage returns in it, which I've
written in Java as "\r", but the Stratus box does not seem to
recognize it. It is expecting a hex 0D instead.
Does anyone know how to code in Java to pass a hex 0D?
Thanks in advance for any advice you can provide.
Pat
- 5
- Who is the best WebSphere Studio or Oracle JDeveloper??Can anybody tell me which IDE tools, Web Sphere, JDeveloper or etc, is the
best for the enterprise applications.
I know that JDEveloper have good IDE for map database object but I am
interesting for web presentation, which has the best framework part for web
component, JSP, servlet and etc. I know that in WebSphereStudio can put
plug-in for Struts framework, but it's look very difficult for develop and
support.
ilica
_________
"If A is a success in life, then A equals x plus y plus z. Work is x; y is
play; and z is keeping your mouth shut."
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.515 / Virus Database: 313 - Release Date: 1.9.2003
- 7
- Web Usage MiningHi friends,
I am working on the project of Web usage mining. I am currently doing
the below modules..
1. Users next request prediction.
2. Transasction Clustering using k - means cluster algorithm.
For the above i have used server log data as a data set in ECLF. I
need ur suggestions and discussions reg the above. Is anybody
interested in working with WUM or did some work in WUM.. U can free to
share ur experience and difficulties you faced during the projects..
Advance Thanks...
Reg,
Seenu
- 7
- Transpose in javaHi, I have a large table in postgres database. I need to create a
screen in Java to view this table but it hast to be transposed. I'm
wondering if it's better to transpose it in Postgres or Java could do
it for me. Which is a better approach? What is the best way to
transpose a table in Java? What is the best way to transpose it in
Postgress.
Your help is greatly appreciated.
Thanks
NK
- 7
- Generics error messagesRoedy Green <email***@***.com> writes:
> Let me see if I follow:
>
> Collection<? extends Automobile> a = new ArrayList<Automobile>( 10 );
>
> a.add( new Automobile() );
Not allowed. The signature of "add" on Collection<T> is "void add(T)".
The type of "a" doesn't say what type parameter was used to create the
instance that it refers to, only that the parameter was some subclass
of Automobile.
The instance might be an ArrayList<Car>. In that case, the signature
of the actual add method would be "void add(Car)" and it would be
an error to pass an Automobile to it.
> a.add( new Car() ); // blocked
Also blocked, for the same reason, since the type parameter of the
actual instance might not be Car or a superclass of Car.
Generally, if something is only known to have type
SomeClass<? extends Foo>
then you can't call methods that expects values of the type
parameter's type, because you don't know what type that is.
Opposite, if something is only known to have a type
SomeClass<? super Foo>
then you can't (as usefully) call methods that return something
of the type paremeter's type (however, you do know that it's
at least an Object :).
> So strangely Collection<? extends Automobile> means the exact
> opposite.
>
> it means Collection<only Automobile no Cars or Trucks>
No, Liskov's Substitution Principle still holds. You can use an
instance of Car anywhere you expect an Automobile, because a Car *is*
an Automobile. If you have a Collection that you can add Automobiles
to, you can also add Cars. A type of such a collection would be
Collection<? super Automobile>
or just
Collection<Automobile>
What doesn't hold is that Collection<Car> is a Collection<Automobile>.
Neither is a subtype of the other. Instead you have a subtype diagram
that looks like this:
Collection<? extends Automobile>
/ \
Collection<Automobile> Collection<? extends Car>
/
Collection<Car>
(and:
Collection<? super Car>
/ \
Collection<? super Automobile> Collection<Car>
\
Collection<Automobile>
which doesn't draw very well on the same diagram :)
/L
--
Lasse Reichstein Nielsen - email***@***.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
- 7
- JKS and PKCS12Could someone point me to some good documentation on the differences
between JKS and PKCS12.
Thanks
- 7
- 9
- JZEE.COM for J2EE ?
Hi,
I'm selling the domain JZEE.COM. "JZEE" appears to be the popular, spoken
expression of Sun's J2EE product, so it might make a good domain for a Java
forum or the like. Anyway, I'm keener to see the domain used appropriately
than getting a few extra $$$ for it. It will not be expensive.
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=3080246726
Thanks,
Simon Sheppard
- 11
- Java 3D without OpenGL or Direct3D?Hello,
I'd like to use Java 3D applications on my Windows 2000 notebook that
has not got a 3D graphic adapter.
Is it possible to get Java 3D run using software rendering without 3D
acceleration? This mode is possible in most of computer games so I
thought this might be possible with Java 3D, too.
Best regards,
Sebastian
- 14
- Daylight Saving Time in Australia 2005/2006Daylight Saving Time in Australia 2005/2006 has been extended for one
week due to the Commonwealth Games.
When I tested Sun's J2SE v 1.4.2_10 SDK for Windows, it was still using
the old changeover date.
Does anyone know anything about this issue?
Is Sun aware of it?
Are there fixes available/imminent?
It seems all Australian states with Daylight Saving are adopting the
new end date for 2006 (TAS, VIC, ACT, NSW, SA), and so at least the
following TimeZones (from java.util.TimeZone) are affected:
Australia/Adelaide
Australia/Broken_Hill
Australia/ACT
Australia/Sydney
Australia/Tasmania
Australia/Victoria
Australia/NSW
Australia/Canberra
Australia/Hobart
Australia/Melbourne
see
http://www.lawlink.nsw.gov.au/lawlink/Corporate/ll_agdinfo.nsf/pages/community_relations_daylight_saving
for more information on DST in New South Wales.
http://www.bom.gov.au/climate/averages/tables/dst_times.shtml
|
| Author |
Message |
landonf

|
Posted: 2005-6-22 2:33:00 |
Top |
java-programmer, [PATCH] jdk1.4.2, getsockname(), and ECONNRESET
--Apple-Mail-4--662330866
Content-Type: multipart/mixed; boundary=Apple-Mail-3--662330884
--Apple-Mail-3--662330884
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=ISO-8859-1;
format=flowed
In j2se/src/solaris/native/sun/nio/ch/Net.c, getsockname() is called to=20=
determine the local address and port of a socket.
Under both Linux and Solaris, getsockname() will only fail if invalid=20
arguments are provided. If getsockname() returns an error, Java throws=20=
a java.lang.Error.
On FreeBSD, getsockname() will also return an error with errno set to=20
ECONNRESET if the connection has been reset by the peer. Consequently,=20=
Java throws a java.lang.Error.
The only way to handle this without an API change is to check for=20
ECONNRESET; In the attached patch, if errno is set to=A0ECONNRESET we=20
fill in the sockaddr structure with a port of 0, an IP of INADDR_ANY,=20
and clear out the error.
Also, any comments on the thread-safe resolver patch?
Thanks,
-landonf
--Apple-Mail-3--662330884
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream; x-unix-mode=0644;
name="getsockname-1.diff"
Content-Disposition: attachment;
filename=getsockname-1.diff
Only in getsockname: cscope.out
diff -ru bsdjdk/j2se/src/solaris/native/sun/nio/ch/Net.c getsockname/j2se/src/solaris/native/sun/nio/ch/Net.c
--- bsdjdk/j2se/src/solaris/native/sun/nio/ch/Net.c Fri May 13 18:04:33 2005
+++ getsockname/j2se/src/solaris/native/sun/nio/ch/Net.c Sun May 29 01:32:32 2005
@@ -118,8 +118,30 @@
SOCKADDR sa;
int sa_len = SOCKADDR_LEN;
if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) {
+#ifdef _BSD_SOURCE
+ /*
+ * XXXBSD:
+ * ECONNRESET is specific to the BSDs. We can not return an error,
+ * as the calling Java code with raise a java.lang.Error given the expectation
+ * that getsockname() will never fail. According to the Single UNIX Specification,
+ * it shouldn't fail. As such, we just fill in generic values.
+ */
+ if (errno == ECONNRESET) {
+ struct sockaddr_in *sin;
+ sin = (struct sockaddr_in *) &sa;
+ bzero(sin, sizeof(*sin));
+ sin->sin_len = sizeof(struct sockaddr_in);
+ sin->sin_family = AF_INET;
+ sin->sin_port = htonl(0);
+ sin->sin_addr.s_addr = INADDR_ANY;
+ } else {
+ handleSocketError(env, errno);
+ return -1;
+ }
+#else /* _BSD_SOURCE */
handleSocketError(env, errno);
return -1;
+#endif /* _BSD_SOURCE */
}
return NET_GetPortFromSockaddr((struct sockaddr *)&sa);
}
@@ -131,8 +153,30 @@
int sa_len = SOCKADDR_LEN;
int port;
if (getsockname(fdval(env, fdo), (struct sockaddr *)&sa, &sa_len) < 0) {
+#ifdef _BSD_SOURCE
+ /*
+ * XXXBSD:
+ * ECONNRESET is specific to the BSDs. We can not return an error,
+ * as the calling Java code with raise a java.lang.Error with the expectation
+ * that getsockname() will never fail. According to the Single UNIX Specification,
+ * it shouldn't fail. As such, we just fill in generic values.
+ */
+ if (errno == ECONNRESET) {
+ struct sockaddr_in *sin;
+ sin = (struct sockaddr_in *) &sa;
+ bzero(sin, sizeof(*sin));
+ sin->sin_len = sizeof(struct sockaddr_in);
+ sin->sin_family = AF_INET;
+ sin->sin_port = htonl(0);
+ sin->sin_addr.s_addr = INADDR_ANY;
+ } else {
+ handleSocketError(env, errno);
+ return NULL;
+ }
+#else /* _BSD_SOURCE */
handleSocketError(env, errno);
return NULL;
+#endif /* _BSD_SOURCE */
}
return NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
}
--Apple-Mail-3--662330884--
--Apple-Mail-4--662330866
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (Darwin)
iD8DBQFCuF1nlplZCE/15mMRAlrDAJ9rqNEWNaX6iAmWW4AQEZUVz4lX1gCfVig7
+Kz1+xJm32a/fQVBsibMm2Y=
=tLoZ
-----END PGP SIGNATURE-----
--Apple-Mail-4--662330866--
|
| |
|
| |
 |
glewis

|
Posted: 2005-6-22 5:02:00 |
Top |
java-programmer >> [PATCH] jdk1.4.2, getsockname(), and ECONNRESET
Hi Landon,
On Tue, Jun 21, 2005 at 11:33:09AM -0700, Landon Fuller wrote:
> In j2se/src/solaris/native/sun/nio/ch/Net.c, getsockname() is called to
> determine the local address and port of a socket.
>
> Under both Linux and Solaris, getsockname() will only fail if invalid
> arguments are provided. If getsockname() returns an error, Java throws
> a java.lang.Error.
> On FreeBSD, getsockname() will also return an error with errno set to
> ECONNRESET if the connection has been reset by the peer. Consequently,
> Java throws a java.lang.Error.
>
> The only way to handle this without an API change is to check for
> ECONNRESET; In the attached patch, if errno is set to?ECONNRESET we
> fill in the sockaddr structure with a port of 0, an IP of INADDR_ANY,
> and clear out the error.
On Linux and/or Solaris, what happens when you call getsockname() on a
socket that has had the connection reset by the peer? In particular,
is it compatible with what your patch does or are we introducing a new
scenario that the socket code for applications must handle?
> Also, any comments on the thread-safe resolver patch?
My bad, I haven't gotten to testing it yet :(. One concern was that
you mention the routines you're using are thread safe under 5.4 and
better and I wondered if there was an impact on 4.x users? I will
try and get this tested soon, as I want it in the next patchset.
--
Greg Lewis Email : email***@***.com
Eyes Beyond Web : http://www.eyesbeyond.com
Information Technology FreeBSD : email***@***.com
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
landonf

|
Posted: 2005-7-7 4:38:00 |
Top |
java-programmer >> [PATCH] jdk1.4.2, getsockname(), and ECONNRESET
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Jun 21, 2005, at 14:01, Greg Lewis wrote:
> Hi Landon,
>
> On Linux and/or Solaris, what happens when you call getsockname() on a
> socket that has had the connection reset by the peer? In particular,
> is it compatible with what your patch does or are we introducing a new
> scenario that the socket code for applications must handle?
I looked over the Linux network implementation to be certain. When the
socket is reset, the source address and port are reset to 0. The kernel
handles IPv6 vs. IPv4 sockets, returning the correct sockaddr type.
In our case, we're only provided with the file descriptor, leaving us
with no means to discern whether the socket was formerly connected via
IPv4 or IPv6 - as such, we're forced to improvise by returning a
sockaddr_in if an error occurs. In terms of the localPort() method,
this makes no difference to the calling Java code as only the port
number is returned.
In the localAddress() method, returning an IPv4 address should not be
fatal. For localAddress() to in turn call getsockname(), the connect()
must have been issued without a bind() first being issued (otherwise,
java would have cached the local port and address previously). There
should be no expectation by the caller that either a Inet4Address or a
Inet6Address will be returned.
It would obviously be more correct to pass up the
java.net.SocketException (as opposed to the current java.lang.Error),
but our hands are tied by the published API.
>> Also, any comments on the thread-safe resolver patch?
>
> My bad, I haven't gotten to testing it yet :(. One concern was that
> you mention the routines you're using are thread safe under 5.4 and
> better and I wondered if there was an impact on 4.x users? I will
> try and get this tested soon, as I want it in the next patchset.
It's a good question. 4.x completely lacks a thread-safe resolver
library, and getaddrinfo() makes up for this by maintaining a Giant
lock on all resolver functions. This can result in painful delays while
threads block on name resolution.
Which is worse? Occasionally crashing java using the non-thread-safe
resolver, or potentially causing significant resolution delays? I worry
about the potential for breaking mostly-working installations. Then
again, the non-thread-safe resolver may already be doing a better job
of breaking them.
- -landonf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFCzEEclplZCE/15mMRAvP8AKCLo5SBgTV/21zuz76QpkAW4BoH+QCfXyfN
c9kNkbmG9mbMhpZc2AXE/vY=
=Bxo3
-----END PGP SIGNATURE-----
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
|
| |
|
| |
 |
Landon Fuller

|
Posted: 2005-7-7 4:38:00 |
Top |
java-programmer >> [PATCH] jdk1.4.2, getsockname(), and ECONNRESET
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Jun 21, 2005, at 14:01, Greg Lewis wrote:
> Hi Landon,
>
> On Linux and/or Solaris, what happens when you call getsockname() on a
> socket that has had the connection reset by the peer? In particular,
> is it compatible with what your patch does or are we introducing a new
> scenario that the socket code for applications must handle?
I looked over the Linux network implementation to be certain. When the
socket is reset, the source address and port are reset to 0. The kernel
handles IPv6 vs. IPv4 sockets, returning the correct sockaddr type.
In our case, we're only provided with the file descriptor, leaving us
with no means to discern whether the socket was formerly connected via
IPv4 or IPv6 - as such, we're forced to improvise by returning a
sockaddr_in if an error occurs. In terms of the localPort() method,
this makes no difference to the calling Java code as only the port
number is returned.
In the localAddress() method, returning an IPv4 address should not be
fatal. For localAddress() to in turn call getsockname(), the connect()
must have been issued without a bind() first being issued (otherwise,
java would have cached the local port and address previously). There
should be no expectation by the caller that either a Inet4Address or a
Inet6Address will be returned.
It would obviously be more correct to pass up the
java.net.SocketException (as opposed to the current java.lang.Error),
but our hands are tied by the published API.
>> Also, any comments on the thread-safe resolver patch?
>
> My bad, I haven't gotten to testing it yet :(. One concern was that
> you mention the routines you're using are thread safe under 5.4 and
> better and I wondered if there was an impact on 4.x users? I will
> try and get this tested soon, as I want it in the next patchset.
It's a good question. 4.x completely lacks a thread-safe resolver
library, and getaddrinfo() makes up for this by maintaining a Giant
lock on all resolver functions. This can result in painful delays while
threads block on name resolution.
Which is worse? Occasionally crashing java using the non-thread-safe
resolver, or potentially causing significant resolution delays? I worry
about the potential for breaking mostly-working installations. Then
again, the non-thread-safe resolver may already be doing a better job
of breaking them.
- -landonf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFCzEEclplZCE/15mMRAvP8AKCLo5SBgTV/21zuz76QpkAW4BoH+QCfXyfN
c9kNkbmG9mbMhpZc2AXE/vY=
=Bxo3
-----END PGP SIGNATURE-----
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- java front end that creates database appsDoes there exist a java front end like this database admin tool:
http://qform.sourceforge.net/
but that also allows you to create database applications (similar to
Rekall if you are familiar with that, uses python)
ie. allows you to create your own forms for data input input etc,
provides reporting, scripting etc
Thanks
Wayne
- 2
- Applet won't work on the Internet, yet it works on my hard drive!!!Hi!
I have uploaded this (first in my life) applet on the Internet, along with
the HTML file for its viewing. On my hard drive I've opened the HTML with
Internet Explorer and Opera, and it works ok. Then I uploaded it on the
internet, and when I opened the Web site I got an "Invalid bytecode" message
in Opera. I've contacted the owner of the site and he says he has also
downloaded my html and .class on his hard drive and it ain't working for
him.
So what am I doing wrong? Is it that I have compiled with Java 1.4.1? I've
also uploaded the files on another web space provider, and it didn't work
there either.
This is the url:
http://www.freewebs.com/csabaland/java/pogadjanje_reci.html
You can also download the .class and .java, which is reci.java, and check it
out yourself.
Can someone tell me why isn't this working?
Gajo
- 3
- ROW ID problemHi,
I am wtiting JAVA application and getting datas from MS SQL.
This is the code:
QueryDataSet ds = new QueryDataSet();
ds.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor
(db,"select * from myTable"));
In myTable there is one column defined as "primary key".
But dataset(ds) does not get rowID automatically. I have
to disable updateRowID in MetaDataUpdate for dataset, and
then set rowID to the column manually
I had no problem in Sybase, but now I have changed to MS
SQL. Any idea? May be it is some connection property I
have not checked out?
Thanks beforehand.
- 4
- Processing of java-common_0.27_amd64.changesjava-common_0.27_amd64.changes uploaded successfully to localhost
along with the files:
java-common_0.27.dsc
java-common_0.27.tar.gz
java-common_0.27_all.deb
Greetings,
Your Debian queue daemon
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 5
- Multiple web applications, single virtual hostHello everyone,
I am attempting to create access logs on a per web application basis,
using a single virtual host in my server.xml file. Here is what I
have so far:
<Host name="www.mysite.com" autoDeploy="false"
deployOnStartup="false"
deployXML="false">
<alias>www.mysite.com</alias>
<Valve
className="org.apache.catalina.valves.AccessLogValve"
prefix="mysite_access" suffix=".log"
pattern="common"
directory="${jboss.server.home.dir}/log"/>
<Context path="" docBase="html" debug="0" reloadable="true"/>
<DefaultContext cookies="true" crossContext="true"
override="true"/>
<Context path="/Web1" docBase="C:\jboss-4.0.1RC2\server\default
\deploy" debug="0" reloadable="true">
<Valve
className="org.apache.catalina.valves.AccessLogValve"
directory="${jboss.server.home.dir}/log"
prefix="my_web1" suffix=".log" resolveHosts="false" pattern="combined"/
>
</Context>
<Context path="/images" appBase="" docBase="C:
\jboss-4.0.1RC2\server\default\images" debug="99">
</Context>
<Context path="/Web2" docBase="C:\jboss-4.0.1RC2\server\default
\deploy" debug="0" reloadable="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="${jboss.server.home.dir}/log"
prefix="my_web2" suffix=".log" resolveHosts="false" pattern="combined"/
>
</Context>
</Host>
Everything is working as it should, except that when I hit www.mysite.com/Web1
or www.mysite.com/Web2 the only log that gets updated is
mysite_access.
Can someone please explain to me how to go about writing to the
my_web1.log and my_web2.log files for those applications?
Thanks,
Monica
- 6
- How to make CLASSPATH behave like PATH on Windows?Windows (XP and NT) allows one to specify environmental variable
(such as PATH and CLASSPATH) at both the SYSTEM-wide level
as well as at the per-USER level.
And the behavior has always been that the value of one's PATH list is
the concatenation of those two ENV specifications.
So, the $64 question is: Is there some way to coerce the resulting
CLASSPATH list to also be a concatenation of both the SYSTEM
and the USER's lists?
(Hopefully, some sort of registry hack can accomplish this!?)
The reason I ask is that today, after installing a Sun 'product' called
JMF (Java Media Framework), it BROKE my existing CLASSPATH
setup. The reason it BROKE it was that BEFORE the installation,
I had my CLASSPATH defined (only) at the SYSTEM level, and it
got inherited into my USER level. But, the (stupid?) JMF kit decided
to 'add' some stuff of its own to the USER classpath, and since one
didn't exist at all, it created one and put its stuff in it.
BUT the unwanted side-effect of that (brilliant?) idea was that now
the only resulting CLASSPATH that the users have is this new one that
the kit created and all the existing entries on the SYSTEM-wide defn
of CLASSPATH now get tossed into the bit-bucket.
Any SUN Java architects out there who can rule on this? Is this a
bug or a feature of the JMF kit? (A registry hack or something similar
for a workaround would be nice.)
Cheers...
Dave
- 7
- UML to JavaHello all,
Does anybody knows a good tutorial for beginners to Make java code out of
UML?
Irlan
- 8
- SAX with JAXPHi,
I want to parse a XML document with SAX (using JAXP) and found lot's of
examples of parsing from a file. But... I have the XML in a String variable
and want to parse from there. All the 'parse' methods from the SAXParse
class receive a File, or a InputStream, or a URI... I don't want to create a
file just to be able to parse the XML (for performance reasons).
Any help appreciated,
Araxes Tharsis
- 9
- Applet is not able to call a URLHello!
I try to make a HTTP Connection through a Applet. The Url is inside
the same CodeBase.
Error message: java.net.UnknownHostException: https://www.unserserver.de
HttpMethod method = null;
try {
URL url = new URL(sUrl);
HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(url.getHost(), url.getPort(), url.getProtocol());
HttpClientParams httpClientParams = new HttpClientParams();
HttpClient httpClient = new HttpClient();
httpClient.setHostConfiguration(hostConfig);
httpClient.setParams(httpClientParams);
method = new GetMethod();
method.setQueryString(url.getQuery());
method.setPath(url.getPath());
int resultCode = httpClient.executeMethod(method);
} catch (Exception e) {
System.out.println(e);
}
I have configured the JVM to use the default settings of the browser,
to connect through the proxy.
Without proxy on my own workstation it works, but for the customer it
doesn't work, allthough he saids, that he has configured the same
settings for the JVM.
Any ideas?
best regards
Alexa
- 10
- Font dialog objectHello all..
Just wondering if there is a Font dialog object in Java. Looking at the
API's I did not see one.
Thanks in Advance...
IchBin
__________________________________________________________________________
'The meeting of two personalities is like the contact of two chemical
substances: if there is any reaction, both are transformed.'
- Carl Gustav Jung, (1875-1961), psychiatrist and psychologist
- 11
- static methods dont inherit (was: Constructor inheritance)"Andrew McDonagh" wrote...
: isamura wrote:
:
: snipped.
:
: > :
: > Can you clarify. Do you mean subclass can't inherit static methods either?
: >
: > ..K
: >
: Correct.
:
: Static methods don't belong to an object like normal (aka Instance)
: methods, they belong to the Class.
:
: When calling a static method you: 'Class.myStaticMethod()'
:
: there's no object, so no Vtable to use to look through.
:
This is going off-topic so I will change the thread topic.
That is puzzling since the following compiles and runs (JDK 1.42):
public static myStaticMethod(); // defined in ClassA
ClassB extends ClassA
ClassB.myStaticMethod(); // no problem
Please explain...
.K
- 12
- jdk 5 generic, why not the other way arround for (T[] e, Collection<T> c)Hi,
I'm trying to understand the generic concept. The following confused
me:
public static void main(String arg[])
{
Object[] oa = new Object [10];
Collection<Object> co = new ArrayList<Object>();
String[] sa = new String[10];
Collection<String> cs = new ArrayList<String>();
method(sa, co); //1
method(oa, co); //2
method(oa,cs); // 3, compile error:
//<T>method(T[],java.util.Collection<T>) in Test cannot be applied to
// (java.lang.Object[],java.util.Collection<java.lang.String>)
// method(oa,cs);
}
static <T> void method(T[]e, Collection<T> c)
{ //do nothing }
The #2 is obvious, but why #1 is ok and #3 is wrong?
- 13
- Jaxb and xsd Help requestedHi,
I'm having problems compiling the classes generated by Jaxb when using
the schema below. (Note the xsd below is part of a bigger xsd file i
just pulled out the section that was giving me issues ). If anyone can
see a problem with the xsd defined below I would appreicate the
information.
The inner interface defined within the generated java class is causing
me issues. The error I get is "Nested type GuestCountType hides an
enclosing type". i would appreciate any help with this.
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="GuestCountType">
<xs:sequence>
<xs:element name="GuestCount" maxOccurs="99">
<xs:complexType>
<xs:attributeGroup ref="GuestCountGroup"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="IsPerRoom" type="xs:boolean" use="optional"/>
</xs:complexType>
<xs:complexType name="RoomStayCandidateType">
<xs:sequence>
<xs:element name="GuestCounts" type="GuestCountType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:attributeGroup name="GuestCountGroup"/>
</xs:schema>
//
// This file was generated by the JavaTM Architecture for XML
Binding(JAXB) Reference Implementation, v1.0.4-b18-fcs
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of
the source schema.
// Generated on: 2006.05.06 at 09:47:52 EDT
//
package generated;
/**
* Java content class for GuestCountType complex type.
* <p>The following schema fragment specifies the expected content
contained within this java content object. (defined at
file:/C:/xsdfiles/test.xsd line 4)
* <p>
* <pre>
* <complexType name="GuestCountType">
* <complexContent>
* <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="GuestCount" maxOccurs="99">
* <complexType>
* <complexContent>
* <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attGroup ref="{}GuestCountGroup"/>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="IsPerRoom"
type="{http://www.w3.org/2001/XMLSchema}boolean" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface GuestCountType {
/**
* Gets the value of the isPerRoom property.
*
*/
boolean isIsPerRoom();
/**
* Sets the value of the isPerRoom property.
*
*/
void setIsPerRoom(boolean value);
/**
* Gets the value of the GuestCount property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the
GuestCount property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getGuestCount().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link generated.GuestCountType.GuestCountType}
*
*/
java.util.List getGuestCount();
/**
* Java content class for anonymous complex type.
* <p>The following schema fragment specifies the expected content
contained within this java content object. (defined at
file:/C:/xsdfiles/test.xsd line 7)
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attGroup ref="{}GuestCountGroup"/>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*/
public interface GuestCountType {
}
}
- 14
- convert DER encoded cert to PEM encoded certhi
i read a certificate from a smartcard with the pkcs#11 API. i get the
certificate in a hex string DER encoded. how can i convert a hex-string
from a DER encoded certificate to e PEM encoded certificate.
i try the method Certificate cert = cf.generateCertificate(fis);
but i works just for base64 encoded certs
-----BEGIN CERTIFICATE-----
MIIDgjCCAuugAwIBAgIBGzANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJDSDEL
MAkGA1UECBMCWkgxEDAOBgNVBAcTB1p1ZXJpY2gxFTATBgNVBAoTDE1hcmMgVGVz
dCBDQTEXMBUGA1UECxMOVGVzdCBDQ .....
-----END CERTIFICATE-----
i have this sting:
30820345308202aea003020102020102300d06092a864886f70d01 ....
has anyone a idea?
thanks
carla
- 15
- Smoking assertions?With regard to assertions it appears that the compiler default has
changed from 1.4 to 1.5. The 1.5 default compiles as-if "-source
1.5" instead of the old 1.4 way "-source 1.3".
All well and good but 1.5 doesn't appear to let me compile with
"-source 1.3" to have an identifier named "assert". Apparently you
could do this with 1.4. If I try to 1.5 compile with "-source 1.3"
it returns the error that "assert is a keyword, try compiling
with -source 1.4, blah blah".
Does anybody know if this is correct and why they removed the
ability to compile as 1.3?
|
|
|