cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
geetcs
Level 4

ClassNotFoundException for custom code

We are using InstallAnywhere 2011 Enterprise Edition to create POC.

We are following the below mentioned steps to create a new project:
1) Choosing “Typical Project Template” to create a new Project.
2) Clicking on “Save As” and providing path and file name.
3) Then we go to the Advanced Designer.
4) All the basic Project Information is provided in the “Project” tab.
5) All the UI related information are provided in the “Installer UI” tab.
6) Then in the “Pre-Install” tab Pre-Install Action List is provided as follows:
a) Clicking on “Add Action” button and then selecting “Panel: Custom Code” for GUI panels or “Console: Custom Code” for Console mode.
b) Then for the each “Custom Code” we provide the “Path” to the jar file and the “Fully Qualified Class Name” for JAVA class file.
c) We also provide the jar file on which the above jar may be dependent.
We have two jar files (e.g. a.jar, b.jar) which includes the custom implementation of classes extended from classes provided by IA.
e.g com.mycomp.MyCustomCodePanel extended from com.zerog.ia.api.pub.CustomCodePanel.



When we create the application installer we can see our jar files included in the application installer, but when we try to execute the application installer it throws following exception:

java.lang.ClassNotFoundException: com.mycomp.IACustomPanelPleaseWait
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.zerog.ia.installer.actions.InstallPanelAction.g(DashoA10*..)
at com.zerog.ia.installer.LifeCycleManager.a(DashoA10*..)
at com.zerog.ia.installer.LifeCycleManager.a(DashoA10*..)
at com.zerog.ia.installer.LifeCycleManager.m(DashoA10*..)
at com.zerog.ia.installer.LifeCycleManager.a(DashoA10*..)
at com.zerog.ia.installer.Main.main(DashoA10*..)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.zerog.lax.LAX.launch(DashoA10*..)
at com.zerog.lax.LAX.main(DashoA10*..)

Please help me to resolve this issue
Labels (1)
0 Kudos
(10) Replies
SunnyBoy
Level 6

Kindly try the following steps and let me know if this resolves.

Pre-Install > Add Action > General tab > Execute custom code.

Provide the corresponding entries and run the installer.

Cheers
SunnyBoy
0 Kudos
geetcs
Level 4

SunnyBoy wrote:
Kindly try the following steps and let me know if this resolves.

Pre-Install > Add Action > General tab > Execute custom code.

Provide the corresponding entries and run the installer.

Cheers
SunnyBoy


It didn't work....
0 Kudos
madhavbantwal
Level 6

Hi geetcs,

Is a.jar and b.jar dependent on each other if so then u have to include the one which is dependent on other in the dependency section or also can try "Additional Classpath"

If Possible can u share us some more information which depicts your scenario.

Thanks,
Madhav Pai
0 Kudos
geetcs
Level 4

madhavbantwal wrote:

Here is the scenario

1. We have a few utility classes written using java(e.g. a.jar), which again depend on a few jar files (e.g. k.jar, l.jar, x.jar, y.jar, z.jar).Classes in the mentioned jars are not dependent on InstallAnywhere's class e.g. com.zerog.ia.api.pub.CustomCodeAction

2. Similary we have one jar file (e.g. b.jar), classes in this jar file is dependent on one of the mentioned class
1. com.zerog.ia.api.pub.CustomCodeAction
2. com.zerog.ia.api.pub.CustomCodeConsoleAction
3. com.zerog.ia.api.pub.CustomCodePanel

But classes in b.jar is dependent on classes in a.jar

So when I create installer using InstallAnywhere 2011, and run the same installer I do see class not found error.Errors seem to be related to dependent classes of a.jar.

When I check the Execute.zip content, I could only a.jar and b.jar being extracted as folder (i.e. com/mycompany/*), but dependent classes of a.jar are not extracted (e.g. k.jar , l.jar, x.jar, y.jar, z.jar).

Please let me know why the class not found errors being shown, even though jars are being bundled in Execute.zip.

Hi,

Please let me know whether you have configured as per the screenshot provided (1.png)

The Alternative is to navigate to Project-->JVM Settings-->Installer Settings -->Additional Classpath settings (2.png)

One thing we need to remember here is relative path should be given w.r.t $EXTRACTOR_DIR$ i.e the place where your install.exe or install.bin resides.

Hope his Helps!

Thanks,
Madhav pai
Attached Images


Hi Madhav,

Thanks for detailed explanations.

We have configured as per the screenshot provided (1.png).But I would like know that for each custom class, do we need to specify all the jar files in classpath list e.g. a.jar k.jar , l.jar, x.jar, y.jar, z.jar as shown in 1.png.
0 Kudos
madhavbantwal
Level 6

Hi,

Please let me know whether you have configured as per the screenshot provided (1.png)

The Alternative is to navigate to Project-->JVM Settings-->Installer Settings -->Additional Classpath settings (2.png)

One thing we need to remember here is relative path should be given w.r.t $EXTRACTOR_DIR$ i.e the place where your install.exe or install.bin resides.

Hope his Helps!

Thanks,
Madhav pai
0 Kudos
geetcs
Level 4

madhavbantwal wrote:
Hi,

Please let me know whether you have configured as per the screenshot provided (1.png)

The Alternative is to navigate to Project-->JVM Settings-->Installer Settings -->Additional Classpath settings (2.png)

One thing we need to remember here is relative path should be given w.r.t $EXTRACTOR_DIR$ i.e the place where your install.exe or install.bin resides.

Hope his Helps!

Thanks,
Madhav pai

Hi Madhav,

Thanks for detailed explanations.

We have configured as per the screenshot provided (1.png).But I would like know that for each custom class, do we need to specify all the jar files in classpath list e.g. a.jar k.jar , l.jar, x.jar, y.jar, z.jar as shown in 1.png.

Regards,
Geet
0 Kudos
madhavbantwal
Level 6

Hi geets,

As you mentioned

"We have a few utility classes written using java(e.g. a.jar), which again depend on a few jar files (e.g. k.jar, l.jar, x.jar, y.jar, z.jar)."

So i suggested including the dependencies as per 1.png.

The Trick here is to include only the Jars which your custom code class is dependent on and not all.

Please let me know if this is working fine!

Hope this Helps!

Thanks,
Madhav Pai
0 Kudos
geetcs
Level 4

madhavbantwal wrote:
Hi geets,

As you mentioned

"We have a few utility classes written using java(e.g. a.jar), which again depend on a few jar files (e.g. k.jar, l.jar, x.jar, y.jar, z.jar)."

So i suggested including the dependencies as per 1.png.

The Trick here is to include only the Jars which your custom code class is dependent on and not all.

Please let me know if this is working fine!

Hope this Helps!

Thanks,
Madhav Pai


Hi Madhav,

We are doing exactly as you mentioned in 1.png, but the it throws ClassNotFoundException exception.

But when we set classpath manually lax.class.path= in setup.lax, it goes through.As per tutorial we should not be doing this manually changing the classpath.

So what might be the problem, are we missing any steps.
0 Kudos
madhavbantwal
Level 6

Hi geetcs,

Request you to post a sample project which replicates the issue.

Thanks,
Madhav Pai
0 Kudos
SunnyBoy
Level 6

In addition, check the "Add service support for custom code" checkbox found under Project > JVM Setttings. Checking this checkbox ensures that the InstallShield MultiPlatform API services are built into the installer and made available at runtime.
0 Kudos