Apigee java callout:
To execute java callout, I uploaded .jar file at org level in apigee. I made reference of the jar (and Execution class) in java-callout policy, but I get error during deployment of proxy - "Could not extract the java resource". Using curl command I verified that jar is loaded as java type, and name of resource is correct.
curl command used to upload the jar.
curl -v -H "Content-Type: application/octet-stream" -X POST -d#{JARfileName.jar} http://{HOST}/v1/organizations/{ORG}/resourcefiles?"name={JARfileName.jar}&type=java"
Any idea what is the issue?
As mentioned on the documentation page for JavaCallouts, this feature is only available on paid-for Apigee orgs. If you're a paying customer I'd suggest contacting Apigee Support directly to get help with this issue.
I further investigated, it has to do with java class loader - in built(fixed) java class loader sequence is to look for dependencies in proxy-level to Apigee platform level, not in other-direction. Example - you can not reference entry class from jar uploaded at platform level and look for its dependencies at proxy level. Anyway a work-around solution works for me.
Suggestion to Apigee team -
It would be helpful if there is way to define location of dependent jars in Api-proxy(explicit jar location in java callout), this way one can explicitly manage how dependent jar/class is being referenced. And also, will be able to upload common/shared class at platform level and bundle proxy specific configuration at Proxy-level.
Regards,
Kamesh
Related
I am trying to create a scheduled task in GoDaddy windows shared hosting account. I have some logic in my .Net C# class project where I have to call a function on daily basis. I have tried by converting it to an executable(.exe) and configured in godaddy as per
https://in.godaddy.com/help/scheduling-tasks-with-plesk-shared-hosting-8970
But that doesn't work for an .exe.
Eventually I have tried calling that function from an aspx by referencing the class project in the WebApp (because that's what the URL suggests). Now I am blocked with some error which says Exception calling "DownloadString" with "1" argument(s): "URI formats are not supported."
Looks like I am doing something wrong while configuring my aspx.
These are my configuration details:
Path to an executable file:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments:
-c "(new-object system.net.webclient).downloadstring('http://DOMAIN_NAME.in\SOME_FOLDER\Default.aspx')"
Called up GoDaddy folks to provide a sample, But they said they do not any sample for the same (very irritating).
Can Someone help me with this?
Godaddy already removed task scheduler and they no longer support it since March 2018.
I have found the issue with my configuration, in fact I have just managed to make it work, here it is:
ASPX Deployment:
Path to an executable file:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Arguments:
-c "(new-object system.net.webclient).downloadstring('http://YOUR_DOMAIN.in/Default.aspx')"
Note: Default.aspx must be placed in httpdocs folder (This is the default folder where you place your website related files).
PHP Deployment:
Path to an executable file:
C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP54\php-cgi.exe
Arguments:
G:\PleskVhosts\readefy.in\httpdocs\YOUR_SCHEDULED_TASK.php
NOTE: Looks like only these 2 options are available for scheduling your tasks via windows shared hosting.
you can create a API and call it by
Executable : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Argument : Invoke-RestMethod 'mysite.com/API/MethodName"
The Invoke-RestMethod cmdlet sends HTTP and HTTPS requests to Representational State Transfer (REST) web services that returns richly structured data.
I am using a Java Application that runs on Jetty-8.
Is there any ways to have the lists of all jars that Jetty scans..
Can we print something (like jar's name or something) when jetty executes those jars.
update
The core issue is jetty-8 slow startup.
I already added metadata-complete="true", and startup time has decreased.
But the problem here is to validate this concept
"metadata tag skips scanning jars of our web application."
Just to do an experiment I have made following changes :
Try 1 :
Removed All meta data tag from web.xml
Jetty log level mode changed to DEBUG.
What I have found in debug level logs is its scanning all jars of my web application. [ That is OK]
Then,
Added metadata tag and restarted server and found it is processing same means its scanning the jars of my web application.
Here I am looking for the ways that make sure that metadata tag is skipping scanning jars from my web application.
There is a command
java -jar start.jar --dry-run
lists all the dependency jars with classpath.
java -jar start.jar --help
gives you detailed usage of start.jar
Note: Jetty 8 is EOL (End of Life). You are strongly encourage to upgrade.
The metadata-complete="true" attribute on the WEB-INF/web.xml does not prevent JAR scanning.
It merely states that the metadata is complete, and should not be modified, as a result of scanning for other metadata sources (like web fragments, class annotations, etc.)
However, there are other features of the Servlet Spec that are not metadata related, and require jar/class scanning to even function. See javax.servlet.ServletContainerInitializer and its #HandlesTypes annotation for an example.
If you were using Jetty 9, then you could control the list of jars that are scanned.
I am new to CQ5. I created a bundle that is configurable via the OSGi console. Now, I need the value that is configured on the console to be returned to my content page. I am not sure how to proceed with this. Looking for any tutorial or help. Thanks in advance.
Assuming the configured value is available via an OSGi service, you can access that service from java code using an #Reference SCR annotation with a suitable build setup to generate the corresponding OSGi metadata. You can also access OSGi services from scripts, in JSP that's done using sling.getService(YourService.class) in a script where you have called or its CQ equivalent.
My application supports running on many dbms and it requires user to configure dbms connection setting and also provide the jdbc jar file.
Now the application is to be packaged as OSGi bundle. There will be another main jar which lanches OSGi server and starts the application as bundle.
Can you please suggest how can I package the application as bundle and let user provide the jdbc jar file.
Will it require something like the main launcher jar specifying JDBC driver classes as FRAMEWORK_SYSTEMPACKAGES property?
Thanks in advance,
Aman
There are two ways of doing this:
1) Adding the driver.jar to the classpath of the main launcher and, like you say, expose its packages via the framework by specifying that property (or actually you can use the FRAMEWORK_SYSTEMPACKAGES_EXTRA property to just specify additional packages, instead of specifying all of them).
2) Manually wrapping the driver.jar as a bundle, or doing it dynamically at runtime. For example, you could try to wrap bundles that are copied to a certain folder (similar to what Apache Felix File Install does) by using Pax URL or some other tool that can create a bundle out of an ordinary jar file for you (see http://team.ops4j.org/wiki/display/paxurl/Pax+URL).
I want to do some HTTP request during the installation of a software with InnoSetup.
Can I use the class TStream to open an URL as if it was a file or must I use the Exec function with curl.exe being attached in the installer, or is there an easier way ?
Have a look at ISTool and the distributed isxdl.dll. Also Inno Setup comes with the script setup.iss in the examples folder which utilizes the isxdl.dll for downloading additional setup files.