Japplet throws ClassNotFoundException
I've built an applet (from JApplet) that consumes several other jar files. I've signed the jar that contains the main class and included all of the jars I need (I think). However, no matter what I try, I consistently get "java.lang.ClassNotFoundException: newposting" where 'newposting' is the main class within my signed jar. I'm using the following html for this:
<p><applet code="newposting" archive="HartfordRowingNewPosting.jar, javax.mail.jar, jcalendar-1.4.jar, junit-4.6.jar, jgoodies-common-1.2.0.jar, jgoodies-looks-2.4.1.jar, mysql-connector-java-5.1.25-bin.jar" width="500" height="850">
<param name="permissions" value="sandbox" /> <param name="codebase" value="HartfordRowingNewPosting" /></applet></p>
I've been frustrated with this on and off for the last month or so. Can someone shed some light on this? Am I getting this error because of JApplet?
I doubt it's to do with JApplet.
It's too long ago for me to remember what, if any, is the significance to the applet of your codebase parameter (as opposed to attribute), but I'm a bit suspicious of that and also of the code attribute: does signed code have to be in a package, or is it OK for it to be in the default package? Certainly, the applet class name "newposting" is contrary to convention, though that wouldn't cause an error in itself.. So I'd be tempted to refactor to put your classes in a package (i.e. include the package statement in your .java files).
What does your web server access log say? Lot's of 200 and 304 status codes, or 404?
Similar Messages
-
KODO 2.5.3
I am trying to use the SchemaTool java class for schema manipulations. When
I try to construct a SchemaTool object I get the following exception:
com.solarmetric.kodo.runtime.FatalUserException:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
NestedThrowables:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
I am passing an instance of MultiLoaderClassResolver (constructed using a
custom URLClassLoader) as the ClassResolver argument to the SchemaTool
constructor. The orcale jar "classes12.jar" is one of the URLs in the
URLClassResolver. Before constructing a SchemaTool object, a call to
canResolveClass("oracle.jdbc.driver.OracleDriver") on the class resolver
returns true. So why is SchemaTool not able to find this class?
Thanks
VijayMarc,
It might well be problems with my custom class loader (which are a pain to
debug indeed) or my lack of understanding of some of your schema tool
classes, but the basic problem I encountered (before getting to the Logger
issue) is as follows:
I have an instance of MultiLoaderClassResolver constructed using my custom
class loader.
A call to resolveClass("orcale.jdbc.driver.OrcaleDriver") on this instance
returns the correct Class (does not throw a ClassNotFound exception).
The same MultiLoaderClassResolver instance is passed as an argument to
SchemaTool(). SchemaTool.refresh() throws an exception:
ClassNotFound: orcale.jdbc.driver.OrcaleDriver
So it seems to me that somewhere in the SchemaTool code you are trying to
resolve orcale.jdbc.driver.OrcaleDriver using something other than the
instance of MultiLoaderClassResolver that I passed in. From the stack trace
in my earlier message, it seems like that is happening in:
com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.createPKColumns(ClassM
apping.java:1584)where an instance of ConfigurationConnector is constructed. BTW, this is how
I construct and pass a ConfigurationConnector to SchemaTool:
JDBCConfiguration conf = new JDBCSimpleConfiguration(someProps);
ClassResolver resolver = new MultiLoaderClassResolver(myCustomClassLoader);
Connector connector = new ConfigurationConnector(conf, resolver, false);
SchemaTool sTool = new SchemaTool(conf, resolver, connector);
Vijay
"Marc Prud'hommeaux" <[email protected]> wrote in message
news:[email protected]...
Vijay-
Custom ClassLoader problems are often very hairy to debug. The first
error message you are receiving indicates a problem:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log4JLogger does not implement LogThis indicates to me that the
"org.apache.commons.logging.impl.Log4JLogger" and
"org.apache.commons.logging.Log" classes are being loaded in different
ClassLoaders, which is generally a bad thing. Is your URLClassLoader
deferring to the parent ClassLoader?
I think that the first step is to identify why the class loaders are
different for these two classes (which should be easy to do with some
printlns in a test program that uses your URLClassLoader).
Bear in mind that this isn't technicall a Kodo issue, but a general
ClassLoader issue. However, we are happy to try to provide hints and
guidance about how to isolate the source of the problem.
In article <[email protected]>, Vijay Ganesan wrote:
After trying out some combinations, the stack trace at the bottom of
this
message gives a better clue of what my problem is:
Looks like a new ConfigurationConnector is created in ClassMapping.javathat
ignores my class resolver (based on my custom class loader) that Icreated
as follows:
JDBCConfiguration conf = new JDBCSimpleConfiguration(someProps);
ClassResolver resolver = newMultiLoaderClassResolver(myCustomClassLoader);
>>
Connector connector = new ConfigurationConnector(conf, resolver, false);
SchemaTool sTool = new SchemaTool(conf, resolver, connector);
Adding the following line before the schema related code solves theproblem:
Thread.currentThread().setContextClassLoader(myCustomClassLoader);
However, that causes another error which, from a brief look at
LogFactoryImpl, seems surely related to custom class loaders. Don't knowhow
to get past this one:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log4JLogger does not implement Log
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.ja
va:532)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.ja
va:272)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
at
com.solarmetric.kodo.impl.jdbc.runtime.ConfigurationConnector.createConnecti
onFactory(ConfigurationConnector.java:140)
--------Stack trace------------
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at
com.solarmetric.util.classes.LoaderClassResolver.resolveClass(LoaderClassRes
olver.java:34)
at
com.solarmetric.kodo.impl.jdbc.runtime.ConfigurationConnector.createConnecti
onFactory(ConfigurationConnector.java:113)
at
com.solarmetric.kodo.impl.jdbc.runtime.ConfigurationConnector.<init>(Configu
rationConnector.java:67)
at
com.solarmetric.kodo.impl.jdbc.runtime.ConfigurationConnector.<init>(Configu
rationConnector.java:59)
at
com.solarmetric.kodo.impl.jdbc.runtime.ConfigurationConnector.<init>(Configu
rationConnector.java:39)
at
com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.createPKColumns(ClassM
apping.java:1584)
at
com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.install(ClassMapping.j
ava:1416)
at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMapping(Mapping.java:
169)
at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMappings(Mapping.java
:116)
at
com.solarmetric.kodo.impl.jdbc.ormapping.Mapping.createMappings(Mapping.java
:86)
at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.createMappings(SchemaTool.j
ava:831)
at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:333
at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:321
at
com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.refresh(SchemaTool.java:311
"Stephen Kim" <[email protected]> wrote in message
news:[email protected]...
My guess is that your custom classloader is preventing instanceof. Can
you try using the system classloader or see if java.sql.Driver is
assignable from oracle.jdbc.dirver.OracleDriver?
Vijay Ganesan wrote:
KODO 2.5.3
I am trying to use the SchemaTool java class for schema
manipulations.
When
I try to construct a SchemaTool object I get the following exception:
com.solarmetric.kodo.runtime.FatalUserException:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
NestedThrowables:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
I am passing an instance of MultiLoaderClassResolver (constructed
using
a
custom URLClassLoader) as the ClassResolver argument to the
SchemaTool
constructor. The orcale jar "classes12.jar" is one of the URLs in the
URLClassResolver. Before constructing a SchemaTool object, a call to
canResolveClass("oracle.jdbc.driver.OracleDriver") on the classresolver
returns true. So why is SchemaTool not able to find this class?
Thanks
Vijay
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Cluster: lookup throw ClassNotFoundException when MyObject was bind
I have problem with lookup MyObject (whitch implements serializable) from InitialContext on cluster machine 1, when I bind it on machine 2.
Lookup throw:
binding java.lang.ClassNotFoundException: MyObject
java.lang.Class com.evermind.naming.ContextClassLoader.findClass(java.lang.String)
ContextClassLoader.java:456
second time lookup return object not found. On Machine where i bind object lookup work good.
With standard objects (String, HashMap,...) this bind an lookup work on both machines perfect.
Aplication is deployed as distributable, and i configured RMI replication.
Can you help me?
AppServer: OC4J 9.0.3
JDK: 1.3.1I doubt you'll get much response on an Oracle specific question concerning naming in a clustered configuration.
This forum is concerned with Sun's J2EE 1.4 SDK and related technologies.
Perhaps you could post this question in an Oracle specific resource:
http://otn.oracle.com/tech/java/oc4j/index.html -
Unserialization throws ClassNotFoundException
This is my first stab at creating a generic class so bear with me....I've created a class like so (simplified for example's sake - but it is basically a Queue implementation backed by a file which can be used to recover it after a crash):
public class MyClass<E extends Serializable> implements Queue<E>
private Queue<E> list = new LinkedList<E> ();
public void add(E item)
appendItemToFile(item);
list.add(item);
private void appendItemToFile(Serializable item) throws IOException
synchronized (fileLock)
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(fileName, true));
oos.writeObject(item);
oos.flush();
oos.close();
private void readListFromFile() throws IOException
synchronized (fileLock)
FileInputStream fis = new FileInputStream(fileName);
list.clear();
while (fis.available() > 0)
Object item = null;
try
ObjectInputStream ois = new ObjectInputStream(fis);
item = ois.readObject();
list.add((E) item);
catch (Exception e)
throw new IOException(e.toString());
fis.close();
}The idea being that multiple Objects are written to a file via the appendItemToFile() method. The next time the program is ran, it should read each object in the file into a LinkedList via ReadListFromFile(). When I create a MyClass instance:
MyClass<AnotherTypeNotExplicitlyImportedInMyClass> foo = new MyClass<AnotherTypeNotExplicitlyImportedInMyClass> ();
foo.add(new AnotherTypeNotExplicitlyImportedInMyClass());
foo.add(new AnotherTypeNotExplicitlyImportedInMyClass());
foo.add(new AnotherTypeNotExplicitlyImportedInMyClass());Everything works fine and the Objects are written to the file. The problem comes when I try to read the file back in...I get a ClassNotFoundException: AnotherTypeNotExplicitlyImportedInMyClass from item = ois.readObject(); I have tried making item type E as well as Serializable without any luck. I am hoping that there is a way to read this file without explicitly importing any type that I may or may not want to have MyClass handle. Any ideas?ClassNotFoundException: AnotherTypeNotExplicitlyImportedInMyClassThe fact that it isn't specifically imported, or serializable, is irrelevant to this exception. The only issue here is that the .class file concerned isn't available when you deserialize.
-
Cache entrySet EqualsFilter ClassNotFoundException
Hello,
While using namedCache.entrySet(new EqualsFilter("attributeAccessor", value), null) I get a ClassNotFoundException.
Notes:_
- I have created my cache with the ClassLoader of the class I am trying to find instances for.
- Able to namedCache.put() with no issues
- Able to deserialize the same container object when I use namedCache.get()
- Tried both single and multiple attributeAccessor navigations: attr1 and attr1.attr2
- In the case of attr1 I get the ClassNotFoundException for the container object
- In the case of attr1.attr2 I get the ClassNotFoundException for the contained object
- I use a fluent API, which means my getters don't start with "get"; thus, attribute1 is accessed with method attribute1()
- I have attempted to create getAttribute1() and getAttribute2() methods with "getAttribute1.getAttribute2" just in case
- It is only a problem when using entrySet() with a Filter
Stack trace:_
(Wrapped: Failed request execution for DistributedCache service on Member(Id=1, Timestamp=2011-04-13 15:34:03.656, Address=XXX:8088, MachineId=61697, Location=machine:MACHNAME,process:3508, Role=CoherenceServer)) java.io.IOException: readObject failed: java.lang.ClassNotFoundException: packagename.ContainedClassName
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
at com.tangosol.io.ResolvingObjectInputStream.resolveClass(ResolvingObjectInputStream.java:68)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2180)
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2311)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2233)
at com.tangosol.util.filter.ComparisonFilter.readExternal(ComparisonFilter.java:204)
at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2004)
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2308)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:1)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheRequest.partialRequest.FilterRequest.read(FilterRequest.CDB:7)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$QueryRequest.read(PartitionedCache.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.deserializeMessage(Grid.CDB:42)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:31)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:619)
ClassLoader: null
at com.tangosol.util.Base.ensureRuntimeException(Base.java:293)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.tagException(Grid.CDB:36)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onQueryRequest(PartitionedCache.CDB:72)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$QueryRequest.run(PartitionedCache.CDB:1)
at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheRequest.onReceived(DistributedCacheRequest.CDB:12)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:11)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: readObject failed: java.lang.ClassNotFoundException: packagename.ContainedClassName
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
at com.tangosol.io.ResolvingObjectInputStream.resolveClass(ResolvingObjectInputStream.java:68)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2180)
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2311)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2233)
at com.tangosol.util.filter.ComparisonFilter.readExternal(ComparisonFilter.java:204)
at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2004)
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2308)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:1)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheRequest.partialRequest.FilterRequest.read(FilterRequest.CDB:7)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$QueryRequest.read(PartitionedCache.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.deserializeMessage(Grid.CDB:42)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:31)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:619)
ClassLoader: null
at com.tangosol.util.ExternalizableHelper.readSerializable(ExternalizableHelper.java:2188)
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2311)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2233)
at com.tangosol.util.filter.ComparisonFilter.readExternal(ComparisonFilter.java:204)
at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2004)
at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2308)
at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:1)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheRequest.partialRequest.FilterRequest.read(FilterRequest.CDB:7)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$QueryRequest.read(PartitionedCache.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.deserializeMessage(Grid.CDB:42)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:31)
... 4 more
Thanks for your help!
Kind regards,
VaughnI am using out-of-the-box configuration. I have not changed a thing about it. I have whittled down the code into a sandbox with unit test. I am using default Java serialization. The point was to get the simplest thing working.
In the code below, see CoherenceProductRepository#allProductsOfTenant(). If you comment out the statement with EqualsFilter and uncomment the other statement, the test works. If you use EqualsFilter it throws ClassNotFoundException.
The code is wired a bit differently than the actual code because I have removed a bunch of dependencies. Still it produces the same error.
Vaughn
Product.java
==========
package sandbox;
import java.io.Serializable;
public class Product implements Serializable {
private static final long serialVersionUID = 1L;
private String description;
private String name;
private Tenant tenant;
public Product(Tenant aTenant, String aName, String aDescription) {
this();
this.setDescription(aDescription);
this.setName(aName);
this.setTenant(aTenant);
this.initialize();
public void rename(String aName) {
this.setName(aName);
public String description() {
return this.description;
public String name() {
return this.name;
public Tenant tenant() {
return this.tenant;
@Override
public boolean equals(Object anObject) {
boolean equalObjects = false;
if (anObject != null && this.getClass() == anObject.getClass()) {
Product typedObject = (Product) anObject;
equalObjects =
this.name().equals(typedObject.name()) &&
this.description().equals(typedObject.description());
return equalObjects;
@Override
public int hashCode() {
int hashCodeValue =
+ (169853 * 229)
+ this.name().hashCode()
+ this.description().hashCode();
return hashCodeValue;
@Override
public String toString() {
return
"Product"
+ " description = " + this.description()
+ " name = " + this.name();
protected Product() {
super();
protected void setDescription(String aDescription) {
if (aDescription == null || aDescription.length() == 0) {
throw new IllegalArgumentException("Description is required.");
if (aDescription.length() > 500) {
throw new IllegalArgumentException("Description must be 500 characters or less.");
this.description = aDescription;
protected void setName(String aName) {
if (aName == null || aName.length() == 0) {
throw new IllegalArgumentException("Name is required.");
if (aName.length() > 100) {
throw new IllegalArgumentException("Name must be 100 characters or less.");
this.name = aName;
protected void setTenant(Tenant aTenant) {
if (aTenant == null) {
throw new IllegalArgumentException("The tenant is required.");
this.tenant = aTenant;
private void initialize() {
// begin-user-code: initialize()
// end-user-code: initialize()
Tenant.java
=========
package sandbox;
import java.io.Serializable;
public class Tenant implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
public Tenant(String anId) {
super();
this.setId(anId);
this.initialize();
public Tenant(Tenant aTenant) {
this(aTenant.id());
public String id() {
return this.id;
@Override
public boolean equals(Object anObject) {
boolean equalObjects = false;
if (anObject != null && this.getClass() == anObject.getClass()) {
Tenant typedObject = (Tenant) anObject;
equalObjects =
this.id().equals(typedObject.id());
return equalObjects;
@Override
public int hashCode() {
int hashCodeValue =
+ (175819 * 311)
+ this.id().hashCode();
return hashCodeValue;
@Override
public String toString() {
return
"Tenant"
+ " id = " + this.id();
protected Tenant() {
super();
private void initialize() {
// begin-user-code: initialize()
// end-user-code: initialize()
private void setId(String anId) {
if (anId == null || anId.length() == 0) {
throw new IllegalArgumentException("The tenant identity is required.");
if (anId.length() > 36) {
throw new IllegalArgumentException("The tenant identity must be 36 characters or less.");
this.id = anId;
CoherenceProductRepository.java
======================
package sandbox;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.tangosol.net.CacheFactory;
import com.tangosol.net.NamedCache;
import com.tangosol.util.filter.EqualsFilter;
public class CoherenceProductRepository {
public CoherenceProductRepository() {
super();
public void add(Product aProduct) {
this.cache().put(this.idOf(aProduct), aProduct);
public void addAll(Collection<Product> aProductCollection) {
if (!aProductCollection.isEmpty()) {
Map<String,Product> productsMap =
new HashMap<String,Product>(aProductCollection.size());
for (Product product : aProductCollection) {
productsMap.put(this.idOf(product), product);
this.cache().putAll(productsMap);
@SuppressWarnings("unchecked")
public Collection<Product> allProductsOfTenant(Tenant aTenant) {
Set<Map.Entry<String, Product>> entries =
this.cache().entrySet(new EqualsFilter("tenant.id", aTenant.id()), null);
// Set<Map.Entry<String, Product>> entries =
// this.cache().entrySet();
Collection<Product> products =
new HashSet<Product>(entries.size());
for (Map.Entry<String, Product> entry : entries) {
products.add(entry.getValue());
return products;
public Product productOfName(String aName) {
return (Product) this.cache().get(aName);
public void remove(Product aProduct) {
this.cache().remove(this.idOf(aProduct));
public void removeAll(Collection<Product> aProductCollection) {
for (Product product : aProductCollection) {
this.remove(product);
private NamedCache cache() {
NamedCache cache = CacheFactory.getCache("coherence.sandbox.product");
return cache;
private String idOf(Product aProduct) {
return aProduct.name();
CoherenceProductRepositoryTest.java
========================
package sandbox;
import junit.framework.TestCase;
import java.util.Arrays;
import java.util.Collection;
public class CoherenceProductRepositoryTest extends TestCase {
private CoherenceProductRepository productRepository;
private Tenant tenant;
public CoherenceProductRepositoryTest() {
super();
public void testSaveProduct() throws Exception {
Tenant tenant = new Tenant("01234567");
Product product =
new Product(
tenant,
"My Product",
"This is the description of my product.");
this.productRepository().add(product);
Product readProduct =
this.productRepository().productOfName(product.name());
assertNotNull(readProduct);
assertEquals(readProduct.tenant(), tenant);
assertEquals(readProduct.name(), product.name());
assertEquals(readProduct.description(), product.description());
public void testFindMultipleProducts() throws Exception {
Product product1 =
new Product(
tenant,
"My Product 1",
"This is the description of my first product.");
Product product2 =
new Product(
tenant,
"My Product 2",
"This is the description of my second product.");
Product product3 =
new Product(
tenant,
"My Product 3",
"This is the description of my third product.");
this.productRepository().addAll( Arrays.asList(product1, product2, product3) );
assertNotNull(this.productRepository().productOfName(product1.name()));
assertNotNull(this.productRepository().productOfName(product2.name()));
assertNotNull(this.productRepository().productOfName(product3.name()));
Collection<Product> allProducts =
this.productRepository().allProductsOfTenant(tenant);
assertEquals(allProducts.size(), 3);
@Override
protected void setUp() throws Exception {
this.setProductRepository(new CoherenceProductRepository());
this.tenant = new Tenant("01234567");
super.setUp();
@Override
protected void tearDown() throws Exception {
Collection<Product> products =
this.productRepository().allProductsOfTenant(tenant);
this.productRepository().removeAll(products);
protected CoherenceProductRepository productRepository() {
return this.productRepository;
protected void setProductRepository(CoherenceProductRepository aProductRepository) {
this.productRepository = aProductRepository;
} -
Class.forName() throws null exception in servlet
Hi, just wondering if anyone having this similar problem:
when i try to load a class using Class.forName() method inside a servlet, it throws null exception.
1) The exception thrown is neither ClassNotFoundException nor any other Error, it's "null" exception.
2) There's nothing wrong with the code, in fact, the same code has been testing in swing before, works perfectly.
3) I have include all necessary jars/classes into the path, even if i haven't, it should throw ClassNotFoundException instead, not "null" exception.I have tried to detect any possible nullable variable, and it is able to run until line 15. The exception thrown is actually null only... not NullPointerException... which is why i have confused...
the message i received is "PlugInException: null".
The code is at follow:
* Load plugin
* @return ArrayList of plugins
* @exception PlugInException PlugInException
01 public ArrayList loadPlugin()
02 throws PlugInException
03 {
04 PlugIn plugin;
05 ArrayList plugins = new ArrayList();
06
07 for (int i = 0; i < configLoader.getPluginTotal(); i++)
08 {
09 try
10 {
11 if (debugger > 0)
12 {
13 System.out.print("Loading " configLoader.getPluginClass(i) "...");
14 }
15 if (Class.forName(configLoader.getPluginClass(i)) == null)
16 {
17 if (debugger > 0)
18 {
19 System.out.print(" not found");
20 }
21 }
22 else
23 {
24 if (debugger > 0)
25 {
26 System.out.println(" done");
27 }
28 plugin = (PlugIn)(Class.forName(configLoader.getPluginClass(i)).newInstance());
29 plugin.setContainer(container);
30 plugins.add(plugin);
31 }
32 }
33 catch (Exception e)
34 {
35 throw new PlugInException("PlugIn Exception: " + e.toString());
36 }
37 }
38
39 return plugins;
40 } -
Throws Exception when jdbc connect to Oracle
Hi! I'm waiting for your answers.
When i use jdbc to connect Oracle,system throws exceptions as follows:
java.lang.ClassCastException: oracle.sql.converter.CharacterConverter12Byte
oracle.sql.CharacterSet1Byte oracle.sql.CharacterSet1Byte.getInstance (int,racle.sql.converter.CharacterConverter)
CharacterSet1Byte.java:82
oracle.sql.CharacterSet oracle.sql.CharacterSetWithConverter.getInstance(int) CharacterSetWithConverter.java:85
I code in Oracle9i Jdeveloper 9.0.2. The Oracle version is 9.0.2.
My code example is as follows:
package mypackage2;
import java.sql.*;
import oracle.jdbc.driver.*;
public class Class1
public Class1()
public static void main(String[] args)
Class1 class1 = new Class1();
Connection conn = null;
try
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//exception throws in getConnection()
conn = DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:CR","system","CR2001");
catch (Exception e)
e.printStackTrace();import java.io.*;
import java.sql.*;
import java.text.*;
import oracle.jdbc.driver.*;
public class viewtable
Connection con;
Statement st;
public viewtable (String args[]) throws ClassNotFoundException,FileNotFoundException,IOException,SQLException
url="jdbc:oracle:thin:system/manager@IP:1521:SID";
Class.forName ("oracle.jdbc.driver.OracleDriver");
try
con=DriverManager.getConnection(url);
st = con.createStatement ();
doexample ();
st.close ();
con.close ();
}catch(SQLException e)
System.err.println(e.getMessage());
public void doexample () throws SQLException
ResultSet rs = st.executeQuery("select * from sales");
if(rs!=null) {
while(rs.next())
int a = rs.getInt("no"); System.out.println("NO = "+a);
rs.close();
public static void main (String args[])
System.out.println ("Oracle Exercise 1 \n");
try
viewtable test = new viewtable(args);
} catch (Exception ex)
System.err.println ("Exception caught.\n"+ex);
ex.printStackTrace ();
the above is the full code, please check the problem....many thanks -
Classnotfoundexception eventhough the class is inside jar
Hi guys,
I encountered weird problem where sometimes it throws classnotfoundexception eventhough the class is inside jar. I terminate the program and start it again then it works fine. I compiled the jar using ant
<target name="compile" depends="clean" description="">
<echo message="using java version : ${java.version}"/>
<echo message="using ant.java.version: ${ant.java.version}" />
<javac srcdir="${src.dir}"
destdir="${build.dir}"
debug="on"
source="1.5"
excludes="com/csg/cs/mud/junit/*"
/>
<jar destfile="${mmd.jar}"
basedir="${build.dir}"
excludes="org/css/cs/mmd/juni*,org/css/cs/mmd/utility/MDDClient.class"
/>
</target> it shows :
*[echo] using java version : 1.5.0_04*
*[echo] using ant.java.version: 1.5*
and I deployed this jar to sun solaris (SunOS sg123-456 5.8 Generic_117350-44 sun4u sparc SUNW,Ultra-80) and sun solaris box is using jre1.5.0_06.
Appreciate any advice please. thanks in advance!
Cheers,
Mark
Edited by: kmthien on Aug 2, 2010 3:05 AMIs it public?
Is it spelt correctly, and the same, in the jar file and the code?
Is it in its correct package in the jar file?
Why are you excluding a class from the jar file? -
ERROR OF throws IN ODBC PLEASE
hello people, please help me in this code:
THIS A FUNCTION:
public void resultado () throws ClassNotFoundException, SQLException {
String className = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@educacion04:1521:ora92";
String v_Seccion="";
String v_Informe="";
String v_Desc="";
int v_Aplica=0;
String v_AplicaS="";
Class.forName(className);
Connection conn=DriverManager.getConnection(url,"ora1", "oracle");
Statement stmt1 = conn.createStatement();
ResultSet res1 = stmt1.executeQuery("select cod_seccion,cod_informe,desc_seccion,aplica from secciones");
v_Seccion = res1.getString("cod_seccion");
v_Informe = res1.getString("cod_informe");
v_Desc = res1.getString("desc_seccion");
v_Aplica = res1.getInt("aplica");
v_AplicaS.valueOf(v_Aplica);
secciontxt.setText(v_Seccion);
informetxt.setText(v_Informe);
descripciontxt.setText(v_Desc);
aplicatxt.setText(v_AplicaS);
stmt1.close();res1.close();conn.close();
THIS EVENT OD A BUTTON FOR CALL A THE FUNCTION resultado:
private void aceptarBoton_actionPerformed(ActionEvent e)
resultado ();
BUT SEND THIS ERROR:
Error(101,15): unreported exception: java.sql.SQLException; must be caught or declared to be thrownFor goodness' sake:
private void aceptarBoton_actionPerformed(ActionEvent event)
try
resultado();
catch (Exception ex)
ex.printStackTrace(System.err); -
Getting ClassNotFoundException in Applet by using JDK1.6_20
In my web application, we are using an applet which gets invoked from the jsp.
Its working fine with jdk1.5 and 1.4 but when I am executing it on machine having JDK1.6_20 its throwing ClassNotFoundException. (Please see the log below)
I cleared the cache and history but still getting this issue.
I tried by switching off to Next Generation Java Plugin but still its not working.
load: class com.idautomation.linear.BCApplet not found.
java.lang.ClassNotFoundException: com.idautomation.linear.BCApplet
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)
Please provide the solution of it.am_mehra wrote:
Hi,
In my jsp, we have used the following lines to show an apple.
<applet name="myApplet" width="390" height="105" align="Baseline">
<param name="code" value="com.idautomation.linear.BCApplet">
<param name="archive" value="LinearBarCode.jar">
<param name="name" value="BarCodeApplet">
<param name = "BARCODE" value = "<%= boOrderReturn.getString("return_no")%>">
<param name = "CODE_TYPE" value = "CODE128">
<param name = "BAR_HEIGHT" value = "2">
<param name = "LEFT_MARGIN" value = "0">
<param name = "TEXT_FONT" value = "ARIAL|BOLD|11">
<param name="scriptable" value="true">
</applet>Looking at this in code tags, which makes things more clear, suggests various problems to me..
<applet name="myApplet" width="390" height="105" align="Baseline">
<param name="code" value="com.idautomation.linear.BCApplet">
<param name="archive" value="LinearBarCode.jar">
<param name="name" value="BarCodeApplet">
<param name = "BARCODE" value = "<%= boOrderReturn.getString("return_no")%>">
<param name = "CODE_TYPE" value = "CODE128">
<param name = "BAR_HEIGHT" value = "2">
<param name = "LEFT_MARGIN" value = "0">
<param name = "TEXT_FONT" value = "ARIAL|BOLD|11">
<param name="scriptable" value="true">
</applet>1) [Values for align|http://www.w3.org/TR/REC-html40/struct/objects.html#adef-align-IMG] can be bottom|middle|top|left|right. Note that none of those is 'Baseline'. You cannot just 'make up' HTML and expect it to work.
2) The code and archive attributes should be in the applet opening element, not specified as params.
3) Does that applet truly accept a 'name' param?
4) The barcode param value looks suspiciously like it it is malformed.
Fixing those things (barring point 4, but also removing the redundant spaces in the param elements) might result in something like..
<applet
name="myApplet"
code="com.idautomation.linear.BCApplet"
archive="LinearBarCode.jar"
width="390"
height="105"
align="bottom">
<param name="name" value="BarCodeApplet">
<param name="BARCODE" value='<%= boOrderReturn.getString("return_no")%>'>
<param name="CODE_TYPE" value="CODE128">
<param name="BAR_HEIGHT" value="2">
<param name="LEFT_MARGIN" value="0">
<param name="TEXT_FONT" value="ARIAL|BOLD|11">
<param name="scriptable" value="true">
</applet>
The above code is working in JDK1.4 and 1.5 but throwing classnotfoundexception.Did you mean ClasNotFoundException? If so, then please use the correct capitals, so there is no confusion. This is even more important on an international technical forum.
I am not clear with the response "Change line 114, column 28 of the source from a '.' to a ','. All the problems should be gone." , kindly explain where I need to change this.That was commonly known as sarcasm. It meant I cannot fix code that I cannot see. That is why I requested you post the SSCCE (please read the link).
It's an internal application not publicly available.OK - understood. -
ClassNotFoundException is not thrown
Hi,
I compiled my source code using jre 1.4.1_03-b02 and running them using jre 1.4.1_02-bo6.The problem is, JVM is not throwing ClassNotFoundException if some .jar files required for running the application are missing.
Can anyone tell me why JVM is not throwing the exception and suggest some workaround for the same.
Thanx in advanceI doubt that is the case.
If the JVM does not find a class (it has nothing to do with jars) it throws the exception.
So if isn't throwing it then it is finding it somewhere.
There are possible reasons for this. For example if the class tree is in the class path (along with the jar.) -
ClassNotFoundException when using Class.forName(), thx
in a study app, i try to use Class.forName() to load any class then get its properties (fields, methods etc. vs reflect).
the (Frame based) app is in directory:
c:\app\StudyApp.class
there is a "Open class" button on the app, click the button, i use FileChooser to open any class file.
i.e. open a class (assume it is not packaged)
d:\dir\TheClass.class
coding in StudyApp.java is:
Class cls=Class.forName("TheClass");
now a ClassNotFoundException throws when call Class.forName() above.
it is easy to understand why throw the exception because i never tell where the class is. it is in directory
d:\dir
my question is: how to tell VM the directory.
the directory d:\dir can not be applied to -classpath when run java.exe StudyApp, because the directory is random one at run-time.
i tried to change System property (i.e. "java.class.path", 'user.dir" etc. none of them can fix the problem.
thanks in advance for any helpThis probably does a lot more than you need:
import java.util.*;
import java.io.*;
import java.util.jar.*;
import java.lang.*;
public class ClassFileFinder extends ClassLoader
List cpath = new LinkedList();
void addFile(File f) {
if(f.isDirectory() || (f.isFile() && f.canRead() &&
f.getName().endsWith(".jar")))
cpath.add(f);
public byte[] classData(String className) {
String cname = className.replace('.', File.separatorChar) + ".class";
Iterator it = cpath.iterator();
while(it.hasNext()) {
File f = (File)it.next();
try {
if(f.isDirectory()) {
File cFile = new File(f, cname);
if(cFile.isFile()) {
byte[] buf = new byte[(int)cFile.length()];
InputStream in = new FileInputStream(cFile);
int off = 0, l;
while((l = in.read(buf, off, buf.length - off)) > 0) {
off += l;
if(off >= buf.length) break;
in.read(buf);
in.close();
return buf;
} else if (f.isFile()) {
JarFile jar = new JarFile(f);
JarEntry ent = jar.getJarEntry(cname);
if(ent != null) {
byte[] buf = new byte[(int)ent.getSize()];
int off = 0, l;
InputStream in = jar.getInputStream(ent);
while((l = in.read(buf, off, buf.length - off)) > 0) {
off += l;
if(off >= buf.length) break;
in.close();
return buf;
} catch (IOException e) {
return null;
public Class findClass(String className) throws ClassNotFoundException{
byte[] data = classData(className);
if(data == null)
return getParent().loadClass(className);
else
return defineClass(className,data,0, data.length);
}Create an instance, Add directories and/or jar files with addFile then loadClass the class you want. -
When trying to connect, java.lang.ClassNotFoundException;
I can't seem to resolve this error:
SearchServlet.java [48:1] unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
db.connect();
^
=========The error is in the following Servlet:
SinglesSearch.Database db=new SinglesSearch.Database();
db.connect(); //this line throws the exception
=========
I've searched the web for servlets connecting to the database, but couldn't find anything that would help me figure out this issue.
Can you help ?
thanks,
Dennis
P.S.
My database helper class.
* Database.java
package SinglesSearch;
import java.sql.*;
import java.io.*;
public class Database {
//Helper Class -- Takes care of DB connections and SQL
/** Creates a new instance of Database */
public String dbURL = "jdbc:mysql://localhost/singles";
public String dbDriver = "com.mysql.jdbc.Driver";
private Connection dbCon;
public Database() {
super();
public boolean connect() throws ClassNotFoundException,SQLException
{ //Connect to DB
Class.forName(dbDriver);
dbCon = DriverManager.getConnection(dbURL,"test", "test");
return true;
public void close() throws SQLException
{ //Close connection to DB
dbCon.close();Why is writing a servlet is so tough ?
It seems it must be simpler. .. I mean I had to specify every last exception handling.
I mean compare these 4 lines:
Class.forName(dbDriver);
dbCon = DriverManager.getConnection(dbURL,"xxx", "xxx");
Statement stmt= dbCon.createStatement();
ResultSet rs = stmt.executeQuery(sql);
To the monster (in P.S.) I had to write, just for the thing to compile !!
Is that supposed to be like that ? Or am I missing something ?
thanks,
Dennis
P.S.
//Start connection to the database
Connection dbCon=null;
Statement stmt=null;
try {
Class.forName("com.mysql.jdbc.Driver");
} catch(ClassNotFoundException cne) {
//Exception handling here
out.println(cne);
try {
dbCon = DriverManager.getConnection("jdbc:mysql://localhost/singles","singles", "zaq123");
} catch(SQLException sqle) {
out.println(sqle);
ResultSet rs = null ;
try {
stmt= dbCon.createStatement(); }
catch(SQLException cne) {
out.println(cne);
try { rs = stmt.executeQuery("SELECT libnum FROM profiles"); }
catch(SQLException cne) {
out.println(cne);
if (rs == null)
out.println("<P>NOTHING in the database</P>");
else
try {
while(rs.next())
out.println("<BR>");
out.println( rs.getString("libnum") );
} catch(SQLException cne) {
out.println(cne);
} -
From JSP- Japplet and Back.
I know it's possible from JSP -> Japplet by the use of throwing parameters .
but how can the Japplet throw back data out for JSP to catch?Ron
Here's what i wanted to do. I'm writing a Cinema ticket online booking system for my Group Project. I want to write an applet that can access the Oracle database indirectly thru JSP. (this is bcs I've tried JDBC and it's kind of slow and you need the user to install the JDBC package) . So the only way I came up with is thru Applet -> JSP -> ORACLE and back. Is this possible? or is there any way where i can decrease the d/l part for the JDBC package? (takes too long for 56k users).
John -
Applet help, class not found?
hi all ! This is the first time I try a applet.
I have my applet declared in my JSP
<APPLET CODE = "AppletViewer.class" ARCHIVE = "MedPro.jar" WIDTH = "600" HEIGHT = "400">
/*creating space for better reading of the code*/ AppletViewer.class is part of a package called beans, and MedPro.jar is the jar generated when building the whole app.
Im getting in the applet "viewer" something like:
java.lang.ClassNotFoundException: AppletViewer.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:https://localhost:8443/MedPro/servlet/AppletViewer/class.class
Im using SSL to make the app secure, but what I dont get is why its not finding the class, isnt that independant from the connection? Plus the applet code is not asking for any connection atm. Im just trying to load it.
Any help is appreciated.
Thanks!
Edited by: juanmanuelsanchez on Jan 28, 2009 10:33 PM
Edited by: juanmanuelsanchez on Jan 28, 2009 10:33 PMwell what Im trying to do is to implement jasper reports in a viewer. So for that Im using
public class AppletViewer extends javax.swing.JApplet {
private javax.swing.JPanel pnlMain;
public AppletViewer()
throws ClassNotFoundException
initComponents();
private void initComponents() {//GEN-BEGIN:initComponents
pnlMain = new javax.swing.JPanel();
pnlMain.setLayout(new java.awt.BorderLayout());
getContentPane().add(pnlMain, java.awt.BorderLayout.CENTER);
}//GEN-END:initComponents
public void init()
public void ViewReport(String jasperFileName) throws net.sf.jasperreports.engine.JRException,javax.naming.NamingException,java.sql.SQLException,
java.net.MalformedURLException
/* HashMap hm = null;
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/MedPro");
Connection conexion = ds.getConnection();
// Create arguments
// Map params = new HashMap();
hm = new HashMap();
// Generate jasper print
//JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(new URL(getCodeBase(), "../MedPro/Reportes/"));
JasperPrint jasperPrint = (JasperPrint) JasperFillManager.fillReport(jasperFileName, hm, conexion);
// JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(jasperFileName);
JRViewer viewer = new JRViewer(jasperPrint);
this.pnlMain.add(viewer, BorderLayout.CENTER);
}That class is part of a package called beans in a project called Medpro wich is compiled as a .WAR archive since its a webapp. The examples show a jar file instead wich is for libraries... so Im confused there. There is no documentation about it :(
I still get the error
java.lang.ClassNotFoundException: beans.AppletViewer.class I have tried everything, still nothing
Thanks for any help you guys can give me
Maybe you are looking for
-
iTunes keeps telling me my debit card is declined, when I am trying to use an iTunes card that I added today. The amount from the iTunes card shows on the account.
-
Format tab for form field properties
This question was posted in response to the following article: http://help.adobe.com/en_US/acrobat/pro/using/WS58a04a822e3e50102bd615109794195ff-7de4.w.h tml
-
IPhoto moved all my 75-100 events to one event!
I've got 18,000 photos in iPhoto on my iMac which were in around 75-100 folders/albums all with different titles; for example; Wedding, Simon's birthday, Tenerife holiday etc. Each folder obviously contained those photos relative to the event. I've g
-
Can I connect my ipod Hi-Fi to my Ipad?
What can I use to connect my ipod Hi-Fi to my Ipad?
-
Two EJB's, separate JARS?
Hi, I have a MDB, consuming messages from a Q, a Java Bean and a Stateless Session Bean. The MDB has a message sent to it, consumes the message, calls the Bean and the bean then passes the Remote interface of the EJB back to the MDB. I have packaged