java


java.lang.NoClassDefFoundError with external jars in java applet


I have a Java applet which utilizes multiple external jars. In Eclipse the project runs fine. When it is exported and run embedded in a HTML file I get 22 run-time exceptions similar to..
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
mil/dcgs/mdf/webservice/ddms/ingest/CatalogIngestService
..with various classes. When I open the exported jar I see no .class files or any other traces from the external jar.
HTML
The HTML is:
<html>
<head>
<title>DIB Applet</title>
</head>
<body>
<applet
code="org.mitre.inception.Main.class"
archive="inception.jar"
WIDTH = "1020"
HEIGHT = "500">
Applet
</applet>
</body>
</html>
.classpath
My .classpath looks like the following.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/myUserName/Desktop/jars/dcgs-util.jar"/>
<!-- more jars removed for space reasons as they look the same as above -->
<classpathentry kind="output" path="bin"/>
</classpath>
The classpath mentions dcgs-util.jar. That should probably be listed in the archive attribute of the applet element. Perhaps something like:
<html>
<head>
<title>DIB Applet</title>
</head>
<body>
<applet
code="org.mitre.inception.Main.class"
archive="inception.jar,jars/dcgs-util.jar"
WIDTH = "1020"
HEIGHT = "500">
Applet
</applet>
</body>
</html>
That would be assuming inception.jar was in the same directory as the HTML, and that dcgs-util.jar is in the jars sub-directory of the dir. where the HTML is located.
Try by using the following classpath. I just changed the order of the jar files.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="C:/Users/myUserName/Desktop/jars/dcgs-util.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<!-- more jars removed for space reasons as they look the same as above -->
<classpathentry kind="output" path="bin"/>
</classpath>

Related Links

How do I put numbers in a generic list?
Splitting a comma and space separated input into two words
Java deserialized object has a null field
Best ways to parse a filename independent of the OS?
Adding observableHashMap through fxml
Jetty Remote WAR Deployment Automation
Java EE: Save HttpSession across multiple modules
JAVA cannot convert from int to short
PhantomJS is failed to find all elements on linux server
Limit JVM memory consumption in a Docker container
Opening third party applications in hidden, minimise, maximize etc states from Matlab
How to get a json from api using sync or wait for async task in android?
LWJGL binding shader twice makes nothing render
Issue with generics and <E extends …>
Using Fused Location provider for android in a non activity java class and get longitude and latitude in main Activity class
Bucket Sort with a max and min value

Categories

HOME
compiler-construction
winforms
bluetooth
pycharm
filtering
cmd
umd
django-imagekit
dacpac
qt-creator
windows-server-2012
msp430
windows-7-x64
aurigma
evopdf
zapier
kryo
ehcache
graphicsmagick
microsoft-r
wijmo
fish
spark-jobserver
intel-pin
nhapi
filezilla
opentype
saas
msys2
compatibility
subdomains
c++-amp
quote
microsoft-chart-controls
google-rich-snippets
nameservers
iframe-resizer
http-status-code-503
twilio-api
semantic-versioning
webtest
stringtemplate
android-kernel
language-concepts
web-mining
serverside-rendering
service-discovery
hilbert-curve
thin
promela
veracode
tropo
recursive-datastructures
nodebb
snmptrapd
ifs
arrow-keys
specrun
nxt
radtreelist
probability-density
ado.net-entity-data-model
clang-static-analyzer
angstrom-linux
skype4py
fadeout
hexdump
phpcas
spim
ora-00900
marching-cubes
intellij-14
emailrelay
createprocessasuser
system32
system.reflection
formatjs
dia
mdt
codeigniter-routing
nsbutton
onactivityresult
oracle-warehouse-builder
dotnetnuke-5
mylyn
rabl
pushbackinputstream
lcs
anonymous-methods
google-email-migration
first-responder
frameset
ticoredatasync
hamachi
tomcat-valve
pyinotify
w3wp.exe
modelstate
nsviewanimation
ext3
putchar
django-notification

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App