Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

having trouble using signed java applet

4 views
Skip to first unread message

Darren

unread,
Sep 20, 2005, 1:59:03 PM9/20/05
to
Hi i wrote an applet recently and posted a request here for help in allowing
it to open a socket. I got some excellent info on creating self signed jar
files that allow me access to functions normally prohibited to java applets.
Now i've follwoed the instructions but now my heml code has trouble
accessing the jar file.

here's the steps i took in creating the self signed jar file.
firstly i created the certificate
c:\j2sdk1.4.2_06\bin\keytool -genkey -keyalg rsa -alias dazkey
c:\j2sdk1.4.2_06\bin\keytool -export -alias dazkey -file dazsuncert.crt
then i created the jar
c:\j2sdk1.4.2_06\bin\jar cvf c:\applets\Helloserver.jar
c:\applets\Helloserver.class
then signed and verified it
c:\j2sdk1.4.2_06\bin\jarsigner c:\applets\Helloserver.jar dazkey
c:\j2sdk1.4.2_06\bin\jarsigner -verify -verbose -certs
c:\applets\Helloserver.jar

to test it i put the jar file and html file on there own on my website

Helloserver.htm
Helloserver.jar

the content of the html file are as follows
<HTML>
<HEAD>
</HEAD>
<BODY>
<CENTER>
<APPLET
codebase = "."
archive = "Helloserver.jar"
code = "Helloserver.class"
width = "500"
height = "300"
>
</APPLET>
</CENTER>
</BODY>
</HTML>

The java consol stated the following
Java Plug-in 1.5.0_04
Using JRE version 1.5.0_04 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS


load: class Helloserver.class not found.
java.lang.ClassNotFoundException: Helloserver.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
Exception in thread "Thread-4" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-Helloserver.class"
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

now when i put the class file instead of the jar and removed the jar file
and the archive tag from the html file the class loads ok but again i get
the security problems.

Help

Roedy Green

unread,
Sep 20, 2005, 3:06:36 PM9/20/05
to
On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

> archive = "Helloserver.jar"
> code = "Helloserver.class"

You don't post a class without a package. That is only for
experimenting. I suspect signing presumes packages.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.

Roedy Green

unread,
Sep 20, 2005, 3:08:23 PM9/20/05
to
On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

> codebase = "."

that does not do anything. Just leave it out.

Roedy Green

unread,
Sep 20, 2005, 3:10:43 PM9/20/05
to
On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

> archive = "Helloserver.jar"
> code = "Helloserver.class"

An Applet should always have a package. Also be careful. Java and some
servers are case sensitive. To avoid getting bitten, I consistently
use a convention:

1. packages are always lower case.
2. jar names are always lower case.
3. classes always start with a capital letter.

e.g.

code="com.mindprod.wassup.Wassup.class"
archive="wassup.jar"

Roedy Green

unread,
Sep 20, 2005, 3:13:02 PM9/20/05
to
On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>load: class Helloserver.class not found.

look in your jar. Is the class in there with no package, spelled
EXACTLY like that including case. Use Winzip or the like to peek.

JarLook will produce a list of what is in a jar.


see http://mindprod.com/products1.html#JARLOOK

Roedy Green

unread,
Sep 20, 2005, 3:14:59 PM9/20/05
to
On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>now when i put the class file instead of the jar and removed the jar file


>and the archive tag from the html file the class loads ok but again i get
>the security problems.

Obviously. You can't sign a class file, only a jar.

Darren

unread,
Sep 20, 2005, 4:47:48 PM9/20/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:ccn0j19g43vs6hrht...@4ax.com...

> On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> > archive = "Helloserver.jar"
> > code = "Helloserver.class"
>
> You don't post a class without a package. That is only for
> experimenting. I suspect signing presumes packages.
by package you mean like 'java.net' or 'java.io'?
does my package name need to be in a similar format?
how do i include it in my html applet tag?

Darren

unread,
Sep 20, 2005, 5:25:18 PM9/20/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:jfn0j1p7v0rt3vdpu...@4ax.com...

> On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> > codebase = "."
>
> that does not do anything. Just leave it out.
Will do. Wasn't sure if java was finnicky about such things.

Oliver Wong

unread,
Sep 20, 2005, 5:35:14 PM9/20/05
to
"Darren" <D...@devslashnul.net> wrote in message
news:Uz_Xe.11826$zw1...@newsfe2-gui.ntli.net...

> by package you mean like 'java.net' or 'java.io'?
> does my package name need to be in a similar format?
> how do i include it in my html applet tag?

Here's a tutorial on how to use packages in java:

http://jarticles.com/package/package_eng.html

- Oliver


Darren

unread,
Sep 20, 2005, 5:34:45 PM9/20/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:dhn0j1pc0n93nmi9m...@4ax.com...

> On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> > archive = "Helloserver.jar"
> > code = "Helloserver.class"
>
> An Applet should always have a package. Also be careful. Java and some
> servers are case sensitive. To avoid getting bitten, I consistently
> use a convention:
>
> 1. packages are always lower case.
> 2. jar names are always lower case.
> 3. classes always start with a capital letter.
>
> e.g.
>
> code="com.mindprod.wassup.Wassup.class"
> archive="wassup.jar"

How is the com.mindprod.wassup constructed. Is it something you made up on
bespoke or is there a reason the syntax is like that? Also when i put
package in my applet. e.g 'package helloserver;' it creates a subdirector
called helloserver and i suspect if i were to call my package
"com.g7wap.helloserver" it would create a directory tree starting with com
then one below would be g7wap and the one below would be helloserver. if
this is the case then how would i reflect this in the jar archive? would jar
create the directory structure automatically based on the "package" entry in
the applet?

Roedy Green

unread,
Sep 20, 2005, 7:24:16 PM9/20/05
to
On Tue, 20 Sep 2005 20:47:48 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>by package you mean like 'java.net' or 'java.io'?


>does my package name need to be in a similar format?
>how do i include it in my html applet tag?

See http://mindprod.com/jgloss/package.html
http://mindprod.com/jgloss/applet.html

also see http://mindprod.com/jgloss/gettingstarted.html

You need an intro textbook of some sort, even a very out of date one
to explain these basic.

Roedy Green

unread,
Sep 20, 2005, 7:27:42 PM9/20/05
to
On Tue, 20 Sep 2005 21:34:45 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>How is the com.mindprod.wassup constructed. Is it something you made up on


>bespoke or is there a reason the syntax is like that?

I own the domain mindprod.com. So I name all my packages
com.mindprod. That insures they will be globally unique.

wassup is the name of a package, a group of related classes.

Wassup in the name of my Applet and the main class, the one that is
used to get the whole ball rolling.

so archive="wassup.jar" ( to contain all the wassup class files)
code="com.mindprod.wassup.Wassup" to tell the browser the package
and class name of my main class.

If you want to examine the code and html, see
http://mindprod.com/applets/wassup.html

I have posted all kinds of applets you can play with and modify.

Roedy Green

unread,
Sep 20, 2005, 7:32:07 PM9/20/05
to
On Tue, 20 Sep 2005 21:34:45 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>called helloserver and i suspect if i were to call my package


>"com.g7wap.helloserver" it would create a directory tree starting with com

Your package name reflects your directory structure.

What I am about to say is not completely true, but true enough for
your level:

I create a directory structure like this:

C:\com\mindprod\wassup

Than I put my Wassup.java file there.
Then I compile to create Wassup.class in that same directory
then I jar to create wassup.jar
then I sign the jar (a step you can leave out for now).
then I post that on my website or run the jar locally.

I usually give my Applet a main method so I can run it as as
application to debug it without the fuss of a browser.

If you use an IDE it creates the package directories for you in
project directories. You organise your related packages into
projects.

Roedy Green

unread,
Sep 20, 2005, 7:34:55 PM9/20/05
to
On Tue, 20 Sep 2005 21:34:45 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

> jar


>create the directory structure automatically based on the "package" entry in
>the applet?

not quite automatically, but the jar had bloody BETTER reflect the
package structure with the member name hierarchy. See
http://mindprod.com/jgloss/jar.html
http://mindprod.com/jgloss/jarexe.html
http://mindprod.com/jgloss/classpath

For all this compiling, jaring etc, sooner or later you will want to
use ant scripts. You are welcome to use any of mine posted at
http://mindprod.com/products.html
and strip out what you don't need.

Darren

unread,
Sep 20, 2005, 8:24:01 PM9/20/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:4f61j1l6vo38oif2d...@4ax.com...

> On Tue, 20 Sep 2005 20:47:48 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >by package you mean like 'java.net' or 'java.io'?
> >does my package name need to be in a similar format?
> >how do i include it in my html applet tag?
>
> See http://mindprod.com/jgloss/package.html
> http://mindprod.com/jgloss/applet.html
Lovely site that. :)

path like a directory structure, got it :)
>
> also see http://mindprod.com/jgloss/gettingstarted.html

>
> You need an intro textbook of some sort, even a very out of date one
> to explain these basic.

I have a book on java 2 somewhere, probably in the attic. Bloody hell i hate
the dark. :)

Darren

unread,
Sep 20, 2005, 8:32:31 PM9/20/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:sn61j1l22t5sjaa14...@4ax.com...

> On Tue, 20 Sep 2005 21:34:45 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >called helloserver and i suspect if i were to call my package
> >"com.g7wap.helloserver" it would create a directory tree starting with
com
>
> Your package name reflects your directory structure.
>
> What I am about to say is not completely true, but true enough for
> your level:
>
> I create a directory structure like this:
>
> C:\com\mindprod\wassup
>
> Than I put my Wassup.java file there.
> Then I compile to create Wassup.class in that same directory
> then I jar to create wassup.jar
> then I sign the jar (a step you can leave out for now).
> then I post that on my website or run the jar locally.
>
> I usually give my Applet a main method so I can run it as as
> application to debug it without the fuss of a browser.
>
> If you use an IDE it creates the package directories for you in
> project directories. You organise your related packages into
> projects.

Do you need to include the directory info in the jar?

Roedy Green

unread,
Sep 20, 2005, 10:31:20 PM9/20/05
to
On Wed, 21 Sep 2005 00:24:01 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>I have a book on java 2 somewhere, probably in the attic. Bloody hell i hate
>the dark. :)

You can get something on eBay or in one of those cheap computer
bookstores that specialise in slightly out of date books.

Roedy Green

unread,
Sep 20, 2005, 10:34:17 PM9/20/05
to
On Wed, 21 Sep 2005 00:32:31 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>Do you need to include the directory info in the jar?

You need at least a main class. Its java name is for example:

com.mindprod.wassup.Wassup.class

In the jar in will have the name:

com/mindprod/wassup/Wassup.class

You don't need an entry for each directory level, just the files.
Jar.exe handles that. You just tell it which classes and resources you
want in there.

When you sign it will add some additional files of the digests and
digital signatures.


Verify you got it right with Winzip or something similar.

Dag Sunde

unread,
Sep 21, 2005, 3:04:04 AM9/21/05
to
"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:ccn0j19g43vs6hrht...@4ax.com...

> On Tue, 20 Sep 2005 17:59:03 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
>> archive = "Helloserver.jar"
>> code = "Helloserver.class"
>
> You don't post a class without a package. That is only for
> experimenting. I suspect signing presumes packages.

Signing does not presume/need packages, but I agree with you.
(One should use them to keep things globally unique)

I suspect "jar" messes up a little when he doesn't use packages,
but gives a full ms-dos path to his .class file

<quote>


c:\j2sdk1.4.2_06\bin\jar cvf c:\applets\Helloserver.jar
c:\applets\Helloserver.class

c:\j2sdk1.4.2_06\bin\jarsigner c:\applets\Helloserver.jar dazkey
c:\j2sdk1.4.2_06\bin\jarsigner -verify -verbose -certs
c:\applets\Helloserver.jar

</quote>

I think the results will be different if he change to "c:\applets"
and try to jar, and sign it from there, the results might be different:
c:\applets> jar cvf helloserver.jar Helloserver.class
c:\applets> jarsigner helloserver.jar dazkey
c:\applets> jarsigner -verify -verbose -certs helloserver.jar

And Darren...

Can you give us the result the last command you run:
"jarsigner -verify -verbose -certs helloserver.jar"

--
Dag.


Dag Sunde

unread,
Sep 21, 2005, 4:29:56 AM9/21/05
to
"Darren" <D...@devslashnul.net> wrote in message
news:H5YXe.11784$zw1....@newsfe2-gui.ntli.net...

> Hi i wrote an applet recently and posted a request here for help in
> allowing
> it to open a socket. I got some excellent info on creating self signed jar
> files that allow me access to functions normally prohibited to java
> applets.
> Now i've follwoed the instructions but now my heml code has trouble
> accessing the jar file.

Hello Darren...

I promised in another thread to sign an applet, and send it to you
so you could test if it worked at all...

I sendt a test-setup with source & a signed applet to your
"devslashnul.net" address, but i suspect that isn't a valid one.

If you mail me your address, I'll send it to you.

--
Dag.


Darren

unread,
Sep 21, 2005, 6:40:47 AM9/21/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:neh1j1dnu0ftov9ge...@4ax.com...

> On Wed, 21 Sep 2005 00:24:01 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
That's interesting. I tried to open the jar i created and winzip replied
"failed to load main-class manifest attribute" and when i compress the class
file with jar i get "manifest added"

Darren

unread,
Sep 21, 2005, 6:47:24 AM9/21/05
to

"Dag Sunde" <m...@dagsunde.com> wrote in message
news:EB7Ye.5894$qE.12...@juliett.dax.net...

141 Wed Sep 21 11:46:20 BST 2005 META-INF/MANIFEST.MF
194 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.SF
932 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.RSA
0 Wed Sep 21 11:38:40 BST 2005 META-INF/
smk 2224 Wed Sep 21 01:30:54 BST 2005 Helloserver.class

X.509, CN=myname, OU=Unknown, O=g7wap, L=myhome, ST=mylocal, C=uk (
dazkey)


s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope

jar verified.

>
> --
> Dag.
>
>


Dag Sunde

unread,
Sep 21, 2005, 7:51:40 AM9/21/05
to
"Darren" <D...@devslashnul.net> wrote in message
news:0TaYe.16673$6p.1...@newsfe4-gui.ntli.net...

>
> "Dag Sunde" <m...@dagsunde.com> wrote in message
> news:EB7Ye.5894$qE.12...@juliett.dax.net...
>> And Darren...
>>
>> Can you give us the result the last command you run:
>> "jarsigner -verify -verbose -certs helloserver.jar"
>
> 141 Wed Sep 21 11:46:20 BST 2005 META-INF/MANIFEST.MF
> 194 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.SF
> 932 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.RSA
> 0 Wed Sep 21 11:38:40 BST 2005 META-INF/
> smk 2224 Wed Sep 21 01:30:54 BST 2005 Helloserver.class
>
> X.509, CN=myname, OU=Unknown, O=g7wap, L=myhome, ST=mylocal, C=uk (
> dazkey)
>
>
> s = signature was verified
> m = entry is listed in manifest
> k = at least one certificate was found in keystore
> i = at least one certificate was found in identity scope
>
> jar verified.

Looks perfectly Ok!

Can you send me your mail-address?

--
Dag.


Roedy Green

unread,
Sep 21, 2005, 5:38:56 PM9/21/05
to
On Wed, 21 Sep 2005 10:40:47 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>hat's interesting. I tried to open the jar i created and winzip replied


>"failed to load main-class manifest attribute" and when i compress the class
>file with jar i get "manifest added"

This makes no sense. Winzip knows nothing about manifests.

Start winzip.

Do a file open of xxx.jar

View the contents.

You don't use Winzip to manipulate jars, just peek inside them.

Jar.exe requires you to write a tiny skeleton manifest file, that
jar.exe includes and augments. This is all described under
http://mindprod.com/jgloss/jarexe.html
and
http://mindprod.com/jgloss/jar.html

When you look in the jar you should see at least two members,
your main class and the manifest file.

Roedy Green

unread,
Sep 21, 2005, 5:40:20 PM9/21/05
to
On Wed, 21 Sep 2005 10:47:24 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

> 141 Wed Sep 21 11:46:20 BST 2005 META-INF/MANIFEST.MF


> 194 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.SF
> 932 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.RSA
> 0 Wed Sep 21 11:38:40 BST 2005 META-INF/
>smk 2224 Wed Sep 21 01:30:54 BST 2005 Helloserver.class

this is looking good, with one exception. Your main class still is not
in a package.

Does it have no dependent classes, not even those $ ones?

Roedy Green

unread,
Sep 21, 2005, 5:42:58 PM9/21/05
to
On Wed, 21 Sep 2005 08:29:56 GMT, "Dag Sunde" <m...@dagsunde.com> wrote
or quoted :

>I promised in another thread to sign an applet, and send it to you
>so you could test if it worked at all...

you can download the source and jar for a signed applet at
http://mindprod.com/products1.html#WASSUP
It also has an ant script for building it.

Dag Sunde

unread,
Sep 21, 2005, 6:25:38 PM9/21/05
to
"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:rtk3j15o649cuovqt...@4ax.com...

> On Wed, 21 Sep 2005 08:29:56 GMT, "Dag Sunde" <m...@dagsunde.com> wrote
> or quoted :
>
>>I promised in another thread to sign an applet, and send it to you
>>so you could test if it worked at all...
>
> you can download the source and jar for a signed applet at
> http://mindprod.com/products1.html#WASSUP
> It also has an ant script for building it.

Sorry for the confusion, Rondey...

I promised Darren to write and sign the applet he needs
in another thread.

Just so he could verify that a signed applet would solve his
problem...

It was not meant as a response to your post...

--
Dag.


Darren

unread,
Sep 21, 2005, 8:23:48 PM9/21/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:qgk3j15djb5i5slhi...@4ax.com...

> On Wed, 21 Sep 2005 10:40:47 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >hat's interesting. I tried to open the jar i created and winzip replied
> >"failed to load main-class manifest attribute" and when i compress the
class
> >file with jar i get "manifest added"
>
> This makes no sense. Winzip knows nothing about manifests.
Apparently it does

>
> Start winzip.
>
> Do a file open of xxx.jar

Yep that's what i did and i got the error message
>
> View the contents.
That was my intention


>
> You don't use Winzip to manipulate jars, just peek inside them.

I know, but it knows how to handle jar files apparently.


>
> Jar.exe requires you to write a tiny skeleton manifest file, that
> jar.exe includes and augments. This is all described under
> http://mindprod.com/jgloss/jarexe.html
> and
> http://mindprod.com/jgloss/jar.html
>
> When you look in the jar you should see at least two members,
> your main class and the manifest file.

I tried viewing with jar itself.
Jar -t -f Helloserver.jar
and it sat there waiting for me as if it was trying to get standard input. I
got the same without the -f flag so i assumned the -f flag would cover it
but i guess not.

Darren

unread,
Sep 21, 2005, 8:25:03 PM9/21/05
to

"Dag Sunde" <m...@dagsunde.com> wrote in message
news:gPbYe.5900$qE.12...@juliett.dax.net...

If yours is genuine I can. :)

>
> --
> Dag.
>
>


Darren

unread,
Sep 21, 2005, 9:00:46 PM9/21/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:6gh1j1p3r9m4krcub...@4ax.com...

> On Wed, 21 Sep 2005 00:32:31 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >Do you need to include the directory info in the jar?
>
> You need at least a main class. Its java name is for example:
>
> com.mindprod.wassup.Wassup.class
>
> In the jar in will have the name:
>
> com/mindprod/wassup/Wassup.class
Strange. I added a package to the java
uk.me.g7wap.helloserver
and when i compiled it, it created a directory tree that matched the package
path $CODEBASE/uk/me/g7wap/helloserver/
where it placed the class file, then i jar it
then i read the jar file with jar

H:\public_html>c:\j2sdk1.4.2_06\bin\jar tf helloserver.jar
META-INF/
META-INF/MANIFEST.MF
Helloserver.class

Shouldn't the Helloserver.class be in a directory namely
uk/me/g7wap/helloserver or is jar taking that as red for the codebase?

>
> You don't need an entry for each directory level, just the files.
> Jar.exe handles that. You just tell it which classes and resources you
> want in there.
>
> When you sign it will add some additional files of the digests and
> digital signatures.
>
>
> Verify you got it right with Winzip or something similar.

Winzip won't open it

Darren

unread,
Sep 21, 2005, 9:02:40 PM9/21/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:kok3j11ntmcd21r11...@4ax.com...

> On Wed, 21 Sep 2005 10:47:24 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> > 141 Wed Sep 21 11:46:20 BST 2005 META-INF/MANIFEST.MF
> > 194 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.SF
> > 932 Wed Sep 21 11:46:22 BST 2005 META-INF/DAZKEY.RSA
> > 0 Wed Sep 21 11:38:40 BST 2005 META-INF/
> >smk 2224 Wed Sep 21 01:30:54 BST 2005 Helloserver.class
>
> this is looking good, with one exception. Your main class still is not
> in a package.
>
> Does it have no dependent classes, not even those $ ones?
It proves your claim that it definately did need to be in a package.

Now what was the applet tag for adding the package data?

Darren

unread,
Sep 21, 2005, 9:17:40 PM9/21/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:qgk3j15djb5i5slhi...@4ax.com...

ok now i'm getting this from the java console
Why is it giving me a wrong name? the name of the package mathed the one
specified below (replacing slashes with dots of course)

java.lang.NoClassDefFoundError: Helloserver (wrong name:
uk/me/g7wap/helloserver/Helloserver)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-5" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-9" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-null" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Roedy Green

unread,
Sep 22, 2005, 1:23:24 AM9/22/05
to
On Thu, 22 Sep 2005 00:23:48 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>> This makes no sense. Winzip knows nothing about manifests.
>Apparently it does

I have been bugging Winzip for many years to add some jar support, but
every time they refuse. They won't even make jar a configurable
extension.

Are you using Beta 10.0?

I am trying to figure out how Winzip could possibly generate that
message. Main-Class in an entry INSIDE the manifest. Winzip is not
involved with content. It is just a container.

If you posted the weird jar somewhere, perhaps I could figure out what
you did.

Roedy Green

unread,
Sep 22, 2005, 1:24:04 AM9/22/05
to
On Thu, 22 Sep 2005 00:23:48 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>> You don't use Winzip to manipulate jars, just peek inside them.


>I know, but it knows how to handle jar files apparently.

don't use it to add elements. It uses compression techniques that
Java does not understand.

Roedy Green

unread,
Sep 22, 2005, 1:28:13 AM9/22/05
to
On Thu, 22 Sep 2005 00:23:48 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>Jar -t -f Helloserver.jar

for some reason the fool thing insists you collapse flags

jar -tf Helloserver.jar

Dag Sunde

unread,
Sep 22, 2005, 2:47:45 AM9/22/05
to
"Darren" <D...@devslashnul.net> wrote in message
news:zRmYe.11155$st1....@newsfe3-gui.ntli.net...
<snip/>

> If yours is genuine I can. :)
>
it is...
:-)

--
dag.


Roedy Green

unread,
Sep 22, 2005, 3:00:36 AM9/22/05
to
On Thu, 22 Sep 2005 01:17:40 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>java.lang.NoClassDefFoundError: Helloserver (wrong name:
>uk/me/g7wap/helloserver/Helloserver)

If you posted your code and your bat files we would not be playing
doctor in the dark.

I trust you have code like this:

package uk.me.g7wap/helloserver;
public class Helloserver

in a file called C:\uk\me\g7wap\helloserver\Helloserver.java

I trust you created your jar with some code like this:

c:
cd \

rem your main.mft should look like this:
rem Main-Class uk/me/g7wap/helloserver.Helloserver
rem following should be on one line:
jar.exe -cvfm
uk\me\g7wap\helloserver.jar
uk\me\g7wap\helloserver\main.mft
uk\me\g7wap\helloserver\*.class

then you signed it with:

jarsigner.exe helloserver.jar mycert

Roedy Green

unread,
Sep 22, 2005, 3:01:26 AM9/22/05
to
On Thu, 22 Sep 2005 01:17:40 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>java.lang.NoClassDefFoundError: Helloserver

at this point you can also read the generic advice for this exception:

see http://mindprod.com/jgloss/caq.html

Roedy Green

unread,
Sep 22, 2005, 3:02:48 AM9/22/05
to
On Thu, 22 Sep 2005 01:02:40 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>Now what was the applet tag for adding the package data?

hint. Whatever you want to know about, look up that word in the java
glossary at http://mindprod.com/jgloss.html

In this case the entry is at http://mindprod.com/jgloss/applet.html

Roedy Green

unread,
Sep 22, 2005, 3:19:34 AM9/22/05
to
On Thu, 22 Sep 2005 01:00:46 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>


>Shouldn't the Helloserver.class be in a directory namely
>uk/me/g7wap/helloserver or is jar taking that as red for the codebase?

Please re-read the examples I gave you at:

http://mindprod.com/jgloss/javacexe.html
http://mindprod.com/jgloss/jarexe.html
http://mindprod.com/jgloss/jar.html
http://mindprod.com/jgloss/jarsigner.html
http://mindprod.com/jgloss/classpath.html

You have repeatedly refused to post code or bat files. I can't tell
what you are doing. You are demanding surgery by flashlight.

Your class should be in a package. That package name should be
reflected in its member name in the jar.

I think what you are doing is:

c:
cd \uk\me\g7wap\helloserver
jar.exe -cvfm helloserver.jar main.mft *.class

which is wrong. Jar.exe is incredibly stupid. You must have the
precise package info on the command line as I show you at
http://mindprod.com/jgloss/jarexe.html

Darren

unread,
Sep 22, 2005, 7:53:50 AM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:ilf4j1p9vtjk8b5vi...@4ax.com...

> On Thu, 22 Sep 2005 00:23:48 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >> This makes no sense. Winzip knows nothing about manifests.
> >Apparently it does
>
> I have been bugging Winzip for many years to add some jar support, but
> every time they refuse. They won't even make jar a configurable
> extension.

Well i won't argue with you. You know far more about this sort of thing than
I do but perhaps winzip was on about the directory?


>
> Are you using Beta 10.0?

No. 9.


>
> I am trying to figure out how Winzip could possibly generate that
> message. Main-Class in an entry INSIDE the manifest. Winzip is not
> involved with content. It is just a container.

Hey I'm with you on that one but what can I say? That#s what it said


>
> If you posted the weird jar somewhere, perhaps I could figure out what
> you did.

Alt.binaries perhaps?

Darren

unread,
Sep 22, 2005, 7:55:07 AM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:quf4j19k36krcjfqi...@4ax.com...

> On Thu, 22 Sep 2005 00:23:48 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >> You don't use Winzip to manipulate jars, just peek inside them.
> >I know, but it knows how to handle jar files apparently.
>
> don't use it to add elements. It uses compression techniques that
> Java does not understand.
I had no intention of using it for that only for viewing jar file contents.

Darren

unread,
Sep 22, 2005, 7:56:20 AM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:46g4j1hr3kjn0f8p0...@4ax.com...

> On Thu, 22 Sep 2005 00:23:48 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >Jar -t -f Helloserver.jar
>
> for some reason the fool thing insists you collapse flags
>
> jar -tf Helloserver.jar
hey no i got it with 'jar tf Helloserver.jar'
the help doc is misleading.

Darren

unread,
Sep 22, 2005, 8:20:44 AM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:32l4j19vb0jm2db2d...@4ax.com...

> On Thu, 22 Sep 2005 01:17:40 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >java.lang.NoClassDefFoundError: Helloserver (wrong name:
> >uk/me/g7wap/helloserver/Helloserver)
>
> If you posted your code and your bat files we would not be playing
> doctor in the dark.

I did once and I got mocked for doing so but if you prefer here it is.

package uk.me.g7wap.helloserver;
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.io.*;
import java.security.*;
import java.lang.*;
public class Helloserver extends Applet
{
private String hostname = "http://g7wap.dyndns.org/";
private String protocol = "http://";
private String port="80";
private String buf;
private URL location;
private Object content;
private String tmpStr = "GET / HTTP / 1.1\r\n\r\n";//Accept:
*/*\r\n\r\n";//Accept-Language: en-gb\r\n\r\nXXXXXXXXXXXXXXX:
XXXXXXXXXXXXX\r\n\r\nUser-Agent: HelloServer 1\r\n\r\n";
private byte[] getStr = tmpStr.getBytes();
public void init()
{
hello();
}
public void paint(Graphics g)
{
g.drawString(buf, 50, 60 );
}

/**
* Method hello
*
*
* @return
*
*/
protected boolean hello()
{
String str,server;
byte[] ba = new byte[1024];
int bytesRead;
Socket socket=new Socket();
buf="";
try
{
// O P E N
socket = new Socket();
socket.setSoTimeout(3000);
socket.connect(new InetSocketAddress("10.0.0.254", 80),3000 );

}
catch(AccessControlException u)
{
buf=u.getMessage();
}
catch(MalformedURLException u)
{
buf=u.getMessage();
}
catch (UnknownHostException u)
{
return false;
}

catch(SocketTimeoutException u)
{
return false;
}
catch(IOException u)
{

}
try
{

InputStream is = socket.getInputStream();
try
{

OutputStream os= socket.getOutputStream();
try
{
os.write(getStr,0,tmpStr.length());
}
catch(IOException u)
{

}
}
catch(IOException u)
{
}
// R E A D
// -1 means eof.
// You don't necessarily get all you ask for in one read.
// You get what's immediately available.
bytesRead = is.read( ba, 0 /* offset in ba */, ba.length /* bytes to
read */ );
if (bytesRead!=-1)
{
System.out.println(bytesRead);
buf=new String(ba);
System.out.println(buf);
is.close();
}
}
catch(IOException u)
{
}
// C L O S E
try
{
socket.close();
}
catch(IOException u)
{
}
return true;
}

}

>
> I trust you have code like this:
>
> package uk.me.g7wap/helloserver;

no
package uk.me.g7wap.helloserver;

> public class Helloserver
>
> in a file called C:\uk\me\g7wap\helloserver\Helloserver.java

no the java is located elsewhre but the class is produced in


C:\uk\me\g7wap\helloserver\

so C:\uk\me\g7wap\helloserver\Helloserver.class


>
> I trust you created your jar with some code like this:
>
> c:
> cd \
>
> rem your main.mft should look like this:
> rem Main-Class uk/me/g7wap/helloserver.Helloserver
> rem following should be on one line:
> jar.exe -cvfm
> uk\me\g7wap\helloserver.jar
> uk\me\g7wap\helloserver\main.mft
> uk\me\g7wap\helloserver\*.class
>
> then you signed it with:
>
> jarsigner.exe helloserver.jar mycert

no more like
C:\>cd C:\applets\uk\me\g7wap\helloserver

C:\applets\uk\me\g7wap\helloserver>

C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jar cvf
Helloserver.jar Helloserver.class
added manifest
adding: Helloserver.class(in = 2224) (out= 1332)(deflated 40%)
C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jarsigner
Helloserver.jar dazkey
Enter Passphrase for keystore:

C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jarsigner -verify -v
erbose -certs Helloserver.jar

141 Thu Sep 22 13:16:28 BST 2005 META-INF/MANIFEST.MF
194 Thu Sep 22 13:16:30 BST 2005 META-INF/DAZKEY.SF
932 Thu Sep 22 13:16:30 BST 2005 META-INF/DAZKEY.RSA
0 Thu Sep 22 13:14:26 BST 2005 META-INF/
smk 2224 Thu Sep 22 01:28:36 BST 2005 Helloserver.class

X.509, CN=darren simpson, OU=Unknown, O=g7wap, L=mylocation,
ST=myprovince, C=uk (
dazkey)


s = signature was verified
m = entry is listed in manifest
k = at least one certificate was found in keystore
i = at least one certificate was found in identity scope

jar verified.

Is your way better. Is your manifest file an executable script?

Dag Sunde

unread,
Sep 22, 2005, 9:12:21 AM9/22/05
to
"Darren" <D...@devslashnul.net> wrote in message
news:wkxYe.8837$1A....@newsfe1-gui.ntli.net...
>
<snipped/>

> no more like
> C:\>cd C:\applets\uk\me\g7wap\helloserver
>
> C:\applets\uk\me\g7wap\helloserver>
>
> C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jar cvf
> Helloserver.jar Helloserver.class
<snipped/>


Ahh... There we have your class not found error!

When you "jar" a class in a package, you must position yourself
one step above the package (In the case above, in C:\), and execute
jar from there. Giving it the full path down to your class-files.

c:\> jar -cfv helloserver.jar uk\me\g7wap\helloserver\*.class

Now, helloserver.jar will be present in the C:\ root, and it will
contain the full package.

--
DFag.

Darren

unread,
Sep 22, 2005, 12:32:17 PM9/22/05
to

"Dag Sunde" <m...@dagsunde.com> wrote in message
news:V4yYe.5953$qE.12...@juliett.dax.net...

> "Darren" <D...@devslashnul.net> wrote in message
> news:wkxYe.8837$1A....@newsfe1-gui.ntli.net...
> >
> <snipped/>
> > no more like
> > C:\>cd C:\applets\uk\me\g7wap\helloserver
> >
> > C:\applets\uk\me\g7wap\helloserver>
> >
> > C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jar cvf
> > Helloserver.jar Helloserver.class
> <snipped/>
>
>
> Ahh... There we have your class not found error!
>
> When you "jar" a class in a package, you must position yourself
> one step above the package (In the case above, in C:\), and execute
> jar from there. Giving it the full path down to your class-files.
>
you mean in C:\applets\

> c:\> jar -cfv helloserver.jar uk\me\g7wap\helloserver\*.class

Ah hence the c flag. It would be easier if jar read an enironment vairiable,
documentroot or codebase or something.


>
> Now, helloserver.jar will be present in the C:\ root, and it will
> contain the full package.

I'll try it and let you know

well the jar file looks more encouraging
C:\applets>c:\j2sdk1.4.2_06\bin\jarsigner -verify -verbose -certs
uk\me\g7wap\helloserver\Helloserver.jar

165 Thu Sep 22 17:22:48 BST 2005 META-INF/MANIFEST.MF
218 Thu Sep 22 17:22:48 BST 2005 META-INF/DAZKEY.SF
932 Thu Sep 22 17:22:48 BST 2005 META-INF/DAZKEY.RSA
0 Thu Sep 22 17:21:58 BST 2005 META-INF/


smk 2224 Thu Sep 22 01:28:36 BST 2005

uk/me/g7wap/helloserver/Helloserver.class

It's strange. I thought the package would have forced the directory
structure but then again jar is just an archiver

Now the clas not found is gone. I get


java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-5" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-null" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

>
> --
> DFag.
>
>
>


Darren

unread,
Sep 22, 2005, 12:36:08 PM9/22/05
to

"Dag Sunde" <m...@dagsunde.com> wrote in message
news:lssYe.5940$qE.12...@juliett.dax.net...
That's brave :)

> --
> dag.
>
>


Darren

unread,
Sep 22, 2005, 12:37:42 PM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:jnl4j15apfv5ur68i...@4ax.com...

> On Thu, 22 Sep 2005 01:02:40 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >Now what was the applet tag for adding the package data?
>
> hint. Whatever you want to know about, look up that word in the java
> glossary at http://mindprod.com/jgloss.html
>
> In this case the entry is at http://mindprod.com/jgloss/applet.html

It's an excellent site and though i have added to my favourites the next
time i do a rebuild because I'm senile i'll completely forget to back up my
favourites and bookmarks so with your permission i'll add it to my web site.

Darren

unread,
Sep 22, 2005, 12:52:12 PM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:18m4j1l6al54apvrp...@4ax.com...

> On Thu, 22 Sep 2005 01:00:46 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >
> >Shouldn't the Helloserver.class be in a directory namely
> >uk/me/g7wap/helloserver or is jar taking that as red for the codebase?
>
> Please re-read the examples I gave you at:
>
> http://mindprod.com/jgloss/javacexe.html
> http://mindprod.com/jgloss/jarexe.html
> http://mindprod.com/jgloss/jar.html
> http://mindprod.com/jgloss/jarsigner.html
> http://mindprod.com/jgloss/classpath.html
>
> You have repeatedly refused to post code or bat files. I can't tell
> what you are doing. You are demanding surgery by flashlight.

Not true. I have posted my code twice though my code has changed sonce the
first time and the socond time was in another part of this thread today as
you've probably already read :)


>
> Your class should be in a package. That package name should be
> reflected in its member name in the jar.
>
> I think what you are doing is:
>
> c:
> cd \uk\me\g7wap\helloserver
> jar.exe -cvfm helloserver.jar main.mft *.class
>
> which is wrong. Jar.exe is incredibly stupid. You must have the
> precise package info on the command line as I show you at
> http://mindprod.com/jgloss/jarexe.html

I've got you page open as i'm replying One would think that sun would add a
tag in jar to include path information relative to the class base directory
but then again who am i to argue with sun. :)

Darren

unread,
Sep 22, 2005, 12:57:46 PM9/22/05
to

"Dag Sunde" <m...@dagsunde.com> wrote in message
news:8S8Ye.5896$qE.12...@juliett.dax.net...

> "Darren" <D...@devslashnul.net> wrote in message
> news:H5YXe.11784$zw1....@newsfe2-gui.ntli.net...
> > Hi i wrote an applet recently and posted a request here for help in
> > allowing
> > it to open a socket. I got some excellent info on creating self signed
jar
> > files that allow me access to functions normally prohibited to java
> > applets.
> > Now i've follwoed the instructions but now my heml code has trouble
> > accessing the jar file.
>
> Hello Darren...

>
> I promised in another thread to sign an applet, and send it to you
> so you could test if it worked at all...
>
> I sendt a test-setup with source & a signed applet to your
> "devslashnul.net" address, but i suspect that isn't a valid one.

Indeed its a faux address, your mail will bounce. I've used a similar
protocol to another poster (Roedy Green I think) who took his domain name,
reversed it and made a package out of it.
>
> If you mail me your address, I'll send it to you.
ukWIBBLEmeWIBBLEg7wapWOBBLEdarren

reverse the whole thing it, replace WOBBLE with at and WIBBLE with dot and
you have it.
>
> --
> Dag.
>
>


Darren

unread,
Sep 22, 2005, 12:59:40 PM9/22/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:rtk3j15o649cuovqt...@4ax.com...

> On Wed, 21 Sep 2005 08:29:56 GMT, "Dag Sunde" <m...@dagsunde.com> wrote
> or quoted :
>
> >I promised in another thread to sign an applet, and send it to you
> >so you could test if it worked at all...
>
> you can download the source and jar for a signed applet at
> http://mindprod.com/products1.html#WASSUP
> It also has an ant script for building it.

There's some good stuff on there :)

Oliver Wong

unread,
Sep 22, 2005, 1:19:01 PM9/22/05
to
"Darren" <D...@devslashnul.net> wrote in message
news:eoBYe.11744$st1....@newsfe3-gui.ntli.net...

> ukWIBBLEmeWIBBLEg7wapWOBBLEdarren
>
> reverse the whole thing it, replace WOBBLE with at and WIBBLE with dot and
> you have it.

I don't presume to know your e-mail address better than you, but
shouldn't you replace WOBBLE and WIBBLE *BEFORE* doing the reversing? And is
the reversing a character by character reversing, or a word by word one? =)
Or was giving an intentionally faulty algorithm part of the "trick" to evade
havester-bots? (if so, sorry for spoiling it)

Woe betide the day when our e-mail obfuscation techniques require
something more powerful than a Turing Machine to solve.

(E.g. Here's a set of 160 programs written in java. If the nth program
eventually terminates, then the nth bit in the ASCII representation of my
e-mail is a 1, otherwise it is a 0).

- Oliver


Darren

unread,
Sep 22, 2005, 4:42:20 PM9/22/05
to

"Oliver Wong" <ow...@castortech.com> wrote in message
news:9IBYe.244447$9A2.232009@edtnps89...

> "Darren" <D...@devslashnul.net> wrote in message
> news:eoBYe.11744$st1....@newsfe3-gui.ntli.net...
> > ukWIBBLEmeWIBBLEg7wapWOBBLEdarren
> >
> > reverse the whole thing it, replace WOBBLE with at and WIBBLE with dot
and
> > you have it.
>
> I don't presume to know your e-mail address better than you, but
> shouldn't you replace WOBBLE and WIBBLE *BEFORE* doing the reversing? And
is
> the reversing a character by character reversing, or a word by word one?
=)
> Or was giving an intentionally faulty algorithm part of the "trick" to
evade
> havester-bots? (if so, sorry for spoiling it)

Now that's just nit picking. ;)
BTW how do you reverse a . and a @ but he who was to decypher it managed ok.

Oliver Wong

unread,
Sep 22, 2005, 5:19:12 PM9/22/05
to

"Darren" <D...@devslashnul.net> wrote in message
news:MGEYe.9084$1A....@newsfe1-gui.ntli.net...

>
> "Oliver Wong" <ow...@castortech.com> wrote in message
> news:9IBYe.244447$9A2.232009@edtnps89...
>> "Darren" <D...@devslashnul.net> wrote in message
>> news:eoBYe.11744$st1....@newsfe3-gui.ntli.net...
>> > ukWIBBLEmeWIBBLEg7wapWOBBLEdarren
>> >
>> > reverse the whole thing it, replace WOBBLE with at and WIBBLE with dot
> and
>> > you have it.
>>
>> I don't presume to know your e-mail address better than you, but
>> shouldn't you replace WOBBLE and WIBBLE *BEFORE* doing the reversing? And
> is
>> the reversing a character by character reversing, or a word by word one?
> =)
>> Or was giving an intentionally faulty algorithm part of the "trick" to
> evade
>> havester-bots? (if so, sorry for spoiling it)
>
> Now that's just nit picking. ;)
> BTW how do you reverse a . and a @ but he who was to decypher it managed
> ok.

The reverse of the string "." is ".", in my opinion (and similarly for
"@"). If I were to follow your instructions literally, I'd start with the
string "ukWIBBLEmeWIBBLEg7wapWOBBLEdarren", reverse it to get
"nerradELBBOWpaw7gELBBIWemELBBIWku", replace "WOBBLE" with at (no changes
since WOBBLE never occurs in the new string), replace WIBBLE with dot (no
change because WIBBLE never occurs either) and end up with
"nerradELBBOWpaw7gELBBIWemELBBIWku"

- Oliver


Darren

unread,
Sep 22, 2005, 6:10:27 PM9/22/05
to

"Oliver Wong" <ow...@castortech.com> wrote in message
news:kdFYe.263577$HI.139785@edtnps84...

Fortunately you would be too clever to do something silly like that but
thanks for the laughs though. I creased myself.
>
> - Oliver
>
>


Roedy Green

unread,
Sep 23, 2005, 1:55:27 AM9/23/05
to
On Thu, 22 Sep 2005 11:53:50 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>> If you posted the weird jar somewhere, perhaps I could figure out what
>> you did.
>
>Alt.binaries perhaps?

you could post it on a website or email it to me.
my email address is shown as a graphic at
http://mindprod.com/feedback/feedback.html

Roedy Green

unread,
Sep 23, 2005, 1:57:12 AM9/23/05
to
On Thu, 22 Sep 2005 11:56:20 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>> >Jar -t -f Helloserver.jar

>hey no i got it with 'jar tf Helloserver.jar'

the first is wrong, the second is ok, the - is optional, combining the
flags is not.

Roedy Green

unread,
Sep 23, 2005, 1:59:06 AM9/23/05
to
On Thu, 22 Sep 2005 12:20:44 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>I did once and I got mocked for doing so but if you prefer here it is.
There are people here for the sole purpose of ragging newbies.

All you can do is put them in your killfile. The correct thing to do
is post code, preferably a SSCCE. See
http://mindprod.com/jgloss/snippet.html

Roedy Green

unread,
Sep 23, 2005, 2:08:07 AM9/23/05
to
On Thu, 22 Sep 2005 12:20:44 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

Here is your problem, as I predicted two posts back. You are in the
wrong directory to create your jar. You must be in the directory BELOW
your master package. e.g. C:\applets.

Please read the http://mindprod.com/jarexe.html entry again, and also
the sample bat stuff I posted.

There is further confusion if the class files live in


C:\applets\uk\me\g7wap\helloserver

or

C:\uk\me\g7wap\helloserver

I am assuming the first.

Start with
cd C:\applets
THEN build your jar. The command line will have the full package name
spelled out over and over.
You can use set package=uk\me\g7wap\helloserver
and %package% to abbreviate.

>no more like
>C:\>cd C:\applets\uk\me\g7wap\helloserver
>
>C:\applets\uk\me\g7wap\helloserver>
>
>C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jar cvf
>Helloserver.jar Helloserver.class
>added manifest
>adding: Helloserver.class(in = 2224) (out= 1332)(deflated 40%)
>C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jarsigner
>Helloserver.jar dazkey
>Enter Passphrase for keystore:
>
>C:\applets\uk\me\g7wap\helloserver>c:\j2sdk1.4.2_06\bin\jarsigner -verify -v
>erbose -certs Helloserver.jar

Roedy Green

unread,
Sep 23, 2005, 2:12:20 AM9/23/05
to
On Thu, 22 Sep 2005 16:32:17 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>Ah hence the c flag. It would be easier if jar read an enironment vairiable,


>documentroot or codebase or something.

As I warn you in http://mindprod.com/jgloss/jarexe.html jar.exe is
braindamaged with no common sense at all. It will happily create jars
with package names and member names out of sync with not so much as a
warning message.

Roedy Green

unread,
Sep 23, 2005, 2:13:02 AM9/23/05
to
On Thu, 22 Sep 2005 16:37:42 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>It's an excellent site and though i have added to my favourites the next


>time i do a rebuild because I'm senile i'll completely forget to back up my
>favourites and bookmarks so with your permission i'll add it to my web site.

You don't need my permission.

Roedy Green

unread,
Sep 23, 2005, 2:28:11 AM9/23/05
to
On Thu, 22 Sep 2005 16:57:46 GMT, "Darren" <D...@devslashnul.net> wrote
or quoted :

>Indeed its a faux address, your mail will bounce. I've used a similar


>protocol to another poster (Roedy Green I think) who took his domain name,
>reversed it and made a package out of it.

Note how sun packages for sun use are com.sun. *. IBM packages are
com.ibm. * mine are com.mindprod.*

It is the standard way to make up package names. I did not invent it.

Darren

unread,
Sep 23, 2005, 8:49:43 AM9/23/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:5777j19au5kemrpcd...@4ax.com...

> On Thu, 22 Sep 2005 16:37:42 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >It's an excellent site and though i have added to my favourites the next
> >time i do a rebuild because I'm senile i'll completely forget to back up
my
> >favourites and bookmarks so with your permission i'll add it to my web
site.
>
> You don't need my permission.

Maybe not but i always seek permission from the owner of a website bedore i
put a link to it on mine. Not a legal requirement but it's the way i do
things.

Darren

unread,
Sep 23, 2005, 8:50:33 AM9/23/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:6a77j1li678k8j89a...@4ax.com...

> On Thu, 22 Sep 2005 16:57:46 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >Indeed its a faux address, your mail will bounce. I've used a similar
> >protocol to another poster (Roedy Green I think) who took his domain
name,
> >reversed it and made a package out of it.
>
> Note how sun packages for sun use are com.sun. *. IBM packages are
> com.ibm. * mine are com.mindprod.*
>
> It is the standard way to make up package names. I did not invent it.

Whatever. it works for me. :)

Darren

unread,
Sep 23, 2005, 4:59:17 PM9/23/05
to

"Roedy Green" <loo...@mindprod.com.invalid> wrote in message
news:e567j1pce1bvhfnkc...@4ax.com...

> On Thu, 22 Sep 2005 11:53:50 GMT, "Darren" <D...@devslashnul.net> wrote
> or quoted :
>
> >> If you posted the weird jar somewhere, perhaps I could figure out what
> >> you did.
> >
> >Alt.binaries perhaps?
>
> you could post it on a website or email it to me.
> my email address is shown as a graphic at
> http://mindprod.com/feedback/feedback.html

No need i got the jar thing down
The problem was something to do with the sourcecode. So i ripped it to
peices and got it working with a little help. :)

0 new messages