Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34641 > unrolled thread

classpath issue

Started byEric Douglas <e.d.programmer@gmail.com>
First post2016-06-14 13:29 -0700
Last post2016-06-15 17:20 +0000
Articles 10 — 7 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  classpath issue Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 13:29 -0700
    Re: classpath issue Lew <lewbloch@gmail.com> - 2016-06-14 13:35 -0700
      Re: classpath issue Eric Douglas <e.d.programmer@gmail.com> - 2016-06-14 13:51 -0700
        Re: classpath issue Lew <lewbloch@gmail.com> - 2016-06-15 12:25 -0700
    Re: classpath issue Arne Vajhøj <arne@vajhoej.dk> - 2016-06-14 18:53 -0400
    Re: classpath issue Andreas Leitgeb <avl@logic.at> - 2016-06-14 23:21 +0000
    Re: classpath issue Stanimir Stamenkov <s7an10@netscape.net> - 2016-06-15 02:26 +0300
    Re: classpath issue Roedy Green <inquiry@mindprod.com> - 2016-06-15 01:30 -0700
      Re: classpath issue Eric Douglas <e.d.programmer@gmail.com> - 2016-06-15 08:06 -0700
        Re: classpath issue Martin Gregorie <martin@address-in-sig.invalid> - 2016-06-15 17:20 +0000

#34641 — classpath issue

FromEric Douglas <e.d.programmer@gmail.com>
Date2016-06-14 13:29 -0700
Subjectclasspath issue
Message-ID<1168fc92-420f-4125-8107-07098ab84ca7@googlegroups.com>
What am I missing if I run a JNLP which has this line in it

     <jar href="Public/httpclient-4.5.1.jar"/>

and I get this error:

Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest

Obviously that class exists, so the error must mean something other than what it says?

[toc] | [next] | [standalone]


#34643

FromLew <lewbloch@gmail.com>
Date2016-06-14 13:35 -0700
Message-ID<faec19be-d6ec-4f1c-9d96-8eca958dcd6d@googlegroups.com>
In reply to#34641
On Tuesday, June 14, 2016 at 1:30:10 PM UTC-7, Eric Douglas wrote:
> What am I missing if I run a JNLP which has this line in it
> 
>      <jar href="Public/httpclient-4.5.1.jar"/>
> 
> and I get this error:
> 
> Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
> 
> Obviously that class exists, so the error must mean something other than what it says?

It just doesn't exist anywhere that your environment can find it.

Hint: The error means *exactly* what it says.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#34644

FromEric Douglas <e.d.programmer@gmail.com>
Date2016-06-14 13:51 -0700
Message-ID<a5bb996b-5f68-4724-8f8b-9f0a2a913a9a@googlegroups.com>
In reply to#34643
On Tuesday, June 14, 2016 at 4:35:41 PM UTC-4, Lew wrote:
> On Tuesday, June 14, 2016 at 1:30:10 PM UTC-7, Eric Douglas wrote:
> > What am I missing if I run a JNLP which has this line in it
> > 
> >      <jar href="Public/httpclient-4.5.1.jar"/>
> > 
> > and I get this error:
> > 
> > Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
> > 
> > Obviously that class exists, so the error must mean something other than what it says?
> 
> It just doesn't exist anywhere that your environment can find it.
> 
> Hint: The error means *exactly* what it says.
> 
> -- 
> Lew

It's in the resources section, same place it found all the other jars.

[toc] | [prev] | [next] | [standalone]


#34655

FromLew <lewbloch@gmail.com>
Date2016-06-15 12:25 -0700
Message-ID<f91355aa-fd80-46a1-9cfa-a64e1758cfb7@googlegroups.com>
In reply to#34644
On Tuesday, June 14, 2016 at 1:51:25 PM UTC-7, Eric Douglas wrote:
> On Tuesday, June 14, 2016 at 4:35:41 PM UTC-4, Lew wrote:
> > On Tuesday, June 14, 2016 at 1:30:10 PM UTC-7, Eric Douglas wrote:
> > > What am I missing if I run a JNLP which has this line in it
> > > 
> > >      <jar href="Public/httpclient-4.5.1.jar"/>
> > > 
> > > and I get this error:
> > > 
> > > Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
> > > 
> > > Obviously that class exists, so the error must mean something other than what it says?
> > 
> > It just doesn't exist anywhere that your environment can find it.
> > 
> > Hint: The error means *exactly* what it says.
> > 
> > -- 
> > Lew
> 
> It's in the resources section, same place it found all the other jars.

What resources section? You haven't shown us any of that.

Nevertheless, whatever unfounded claims you make, the compiler and runtime see what they see for real. The error does mean exactly what it says. For you to decide otherwise is for you never to diagnose the problem.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#34646

FromArne Vajhøj <arne@vajhoej.dk>
Date2016-06-14 18:53 -0400
Message-ID<njq1su$lbr$1@gioia.aioe.org>
In reply to#34641
On 6/14/2016 4:29 PM, Eric Douglas wrote:
> What am I missing if I run a JNLP which has this line in it
>
>      <jar href="Public/httpclient-4.5.1.jar"/>
>
> and I get this error:
>
> Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
>
> Obviously that class exists, so the error must mean something other than what it says?

Java does not find the class. If the class is in the jar file, then the
most obvious explanation is that Java can not get the jar file.

Is the path correct?

If served via HTTP can you see if the jar file is actually downloaded?

Arne

[toc] | [prev] | [next] | [standalone]


#34647

FromAndreas Leitgeb <avl@logic.at>
Date2016-06-14 23:21 +0000
Message-ID<slrnnm14b7.456.avl@login.logic.tuwien.ac.at>
In reply to#34641
Eric Douglas <e.d.programmer@gmail.com> wrote:
> What am I missing if I run a JNLP which has this line in it
>      <jar href="Public/httpclient-4.5.1.jar"/>
> and I get this error:
> Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
> Obviously that class exists, so the error must mean something other than what it says?

It may be worth looking for "Root cause"s, or "nested exceptions".
They might point out what really went wrong - maybe some kind of
download error specific to that one jar file.

If you saw the exception in a logfile, then root causes or nested
exceptions follow right after the stack-trace of the outermost
exception, and there may be more than one root cause.

If you saw it in the error-details dialog of a jnlp-application,
then there is problably another tab for nested exceptions, besides
the one with the main exception, and one showing the jnlp-document,...

[toc] | [prev] | [next] | [standalone]


#34648

FromStanimir Stamenkov <s7an10@netscape.net>
Date2016-06-15 02:26 +0300
Message-ID<njq3rk$1va$1@dont-email.me>
In reply to#34641
Tue, 14 Jun 2016 13:29:56 -0700 (PDT), /Eric Douglas/:

> What am I missing if I run a JNLP which has this line in it
>
>       <jar href="Public/httpclient-4.5.1.jar"/>
>
> and I get this error:
>
> Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
>
> Obviously that class exists, so the error must mean something other than what it says?

See if there are previous errors that prevented the class from 
loading (errors during class initialization).  I've had such 
experiences, and subsequent references to the class confusingly have 
been reported as NoClassDefFoundError.

-- 
Stanimir

[toc] | [prev] | [next] | [standalone]


#34650

FromRoedy Green <inquiry@mindprod.com>
Date2016-06-15 01:30 -0700
Message-ID<4742mbtfru95bsm21eur57jf0kt6gf8ls7@4ax.com>
In reply to#34641
On Tue, 14 Jun 2016 13:29:56 -0700 (PDT), Eric Douglas
<e.d.programmer@gmail.com> wrote:

><jar href="Public/httpclient-4.5.1.jar"/>

did you mean "public".

See
http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR

It has so many causes.  

IIRC there is a way of embedding something in your jar that directs
java to also look in another jar. That might work where JNLP fails.


Are there idiotic rules all jars must be signed with the same cert?

[toc] | [prev] | [next] | [standalone]


#34652

FromEric Douglas <e.d.programmer@gmail.com>
Date2016-06-15 08:06 -0700
Message-ID<b04c0b84-cd0a-41ea-990d-f985ba840b78@googlegroups.com>
In reply to#34650
On Wednesday, June 15, 2016 at 4:30:20 AM UTC-4, Roedy Green wrote:
> did you mean "public".
> 
> See
> http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR
> 
> It has so many causes.  
> 
> IIRC there is a way of embedding something in your jar that directs
> java to also look in another jar. That might work where JNLP fails.
> 
> 
> Are there idiotic rules all jars must be signed with the same cert?

No I meant Public, the name of the folder under the folder the web service is pointing to, the same folder all the other jars are in which it does find as it does some processing before it gets this error.  The codebase= points to the local domain web server, setup on IIS.

You can see that class is in the jar.  This is a publicly available jar.
http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.1

It's a Java Console error, not a JNLP dialog error.
The message is:
Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
	at ... (my custom class from another jar in the same path)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest
	at java.net.URLClassLoader.findClass(Unknown Source)
	at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 25 more

All jars referenced by the JNLP are signed, by the same cert.

I can run this Java program from a command line using a -cp classpath referencing exactly the same list of jars in the JNLP resources section without error.

[toc] | [prev] | [next] | [standalone]


#34653

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-06-15 17:20 +0000
Message-ID<njs2oc$3rg$1@dont-email.me>
In reply to#34652
On Wed, 15 Jun 2016 08:06:11 -0700, Eric Douglas wrote:

> 
> No I meant Public, the name of the folder under the folder the web
> service is pointing to, the same folder all the other jars are in which
> it does find as it does some processing before it gets this error.  The
> codebase= points to the local domain web server, setup on IIS.
> 
> You can see that class is in the jar.  This is a publicly available jar.
> http://mvnrepository.com/artifact/org.apache.httpcomponents/
httpclient/4.5.1
> 
> It's a Java Console error, not a JNLP dialog error.
> The message is:
> Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError:
> org/apache/http/client/methods/HttpUriRequest
> 	at ... (my custom class from another jar in the same path)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.http.client.methods.HttpUriRequest
> 	at java.net.URLClassLoader.findClass(Unknown Source)
> 	at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source) at
> 	java.lang.ClassLoader.loadClass(Unknown Source)
> 	at com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source) at
> 	java.lang.ClassLoader.loadClass(Unknown Source)
> 	... 25 more
> 
> All jars referenced by the JNLP are signed, by the same cert.
> 
> I can run this Java program from a command line using a -cp classpath
> referencing exactly the same list of jars in the JNLP resources section
> without error.

On the assumption that org.apache.http.client.methods.HttpUriRequest is 
not in the same jarfile as your class that calls it, check that:

- the jarfile that contains it will be loaded by your JNLP setup 
  if it isn't present on the target system.

- the jarfile that contains it is listed in your jarfile's manifest

- JNLP is configured to put the org.apache jarfile where the manifest 
  expects to find it - usually in the same directory as the calling
  jarfile or an 'includes' subdirectory.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web