cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Pilgrim

Not able to execute custom code

Hello,
I have written a custom code to send HTTP get request. I am not using bundled VM, instead I am using JRE 1.7+ for both compiling the custom code as well as on target system(exactly same version). In log I am getting error class not available. Please suggest if I am missing something.

Thanks,
Praveen
Labels (1)
0 Kudos
11 Replies
Highlighted
Pilgrim

Missing classes

You can do a couple of things:

[LIST=a]
  • You could bundle the JRE that you are using. There is documentation in the user guide on how to do that. See pp. 308 of the user guide on how to create a custom vm pack.
  • Pp.423 of the user guide shows you how to add the vm pack. I had to do this because we needed to carry java 1.7. It turns out that Flexera carries 1.7_10 on their website. If that is sufficient for your needs, you could download that and add it.
  • The other thing you will need to do is in the Advanced Designer, click Project -> JVM Settings and then select the Installer Settings tab. There is an Installer Valid VM List. Make that 1.7. If you don't set that to 1.7, the installer will first search on the target system for a 'valid' VM. If it is 1.6 which doesn't do what you want, you will get an error.
  • The other thing is if you are developing this using a JDK, there are extra jarfiles you may have to carry as dependencies.
  • 0 Kudos
    Highlighted
    Pilgrim

    Re: Not able to execute custom code

    Thanks a lot scarney for reply,

    Actually I already have tried the a,b,c stuffs but all in vain. Still I am getting same error. I am not sure about (d), i.e which all extra jars I need to include. Please explain this a bit.
    Even though I am not ought to bundle a VM with package, but for sake of testing I did that but could not succeed.

    Thanks,
    Praveen
    0 Kudos
    Highlighted
    Pilgrim

    Re: Not able to execute custom code

    One common root cause is that perhaps in your custom codes you import some classes provided by InstallAnywhere. In this case you need to add the required jar into dependency of your custom codes. In "Custom action" -> Properties -> Dependencies -> Add jar or zip. the jar files are located at IA_HOME\resource\services
    0 Kudos
    Highlighted
    Pilgrim

    Re: Not able to execute custom code

    Hi Jchfeng,

    I am importing
    import com.zerog.ia.api.pub.*
    in my custom code. I tried the way you suggested. First I tried adding IA_HOME\resource\services as dependency then I tried including IAClasses.zip as well, but still getting the same error. Any other case where this error is likely to occur.

    Thanks,
    Praveen
    0 Kudos
    Highlighted
    Flexera beginner

    Re: Not able to execute custom code

    Under Project->JVM Settings, did you select "Add service support for custom code"?
    0 Kudos
    Highlighted
    Pilgrim

    Re: Not able to execute custom code

    Yes, I tried this also but still am facing the same issue
    thanks,
    Praveen
    0 Kudos
    Highlighted
    Pilgrim

    Re: Not able to execute custom code

    praveengaur wrote:
    Yes, I tried this also but still am facing the same issue
    thanks,
    Praveen


    The class not found exception clearly shows that we are missing the classes in the jar/zip which we are using. You might be requiring httpclient or httpcore jar. It will be better if you can tell the class name for which class not found exception is coming
    0 Kudos
    Highlighted
    Pilgrim

    Re: Not able to execute custom code

    anilsharma wrote:
    The class not found exception clearly shows that we are missing the classes in the jar/zip which we are using. You might be requiring httpclient or httpcore jar. It will be better if you can tell the class name for which class not found exception is coming


    Thanks Anil,
    I am getting "class com.org.HttpURLConnectionCheck unavailable". exception. It is not throwing an exception for httpcore/httpclient jar, instead not able to find that class that I have created.

    thanks,
    Praveen
    0 Kudos
    Highlighted

    Re: Not able to execute custom code

    Hi,

    Are you sure you have specified the main classname correctly? Is it possible to share the custom code jar file?

    Thanks,
    Ramya
    0 Kudos