I have a Java 8 Wep App on Azure.
I am using the default JRE build in application settings for the webapp. I am running on Tomcat.
I am having trouble installing Java Cryptography Extension to handle some encryption. I dont have access to Java Home to install it, I can only upload the WAR files to web app.
Does anyone know how to install JCE on Azure?
Thanks!
Fab
For people who are still having trouble with this I share my solution by example:
Copy JDK from D:\Program Files (x86)\Java\jdk1.8.0_111 to D:\home\site\jdk1.8.0_111
Download and extract jce policy files from: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
copy files local_policy.jar and US_export_policy.jar to D:\home\site\jdk1.8\jre\lib\security (replace existing files)
Set application setting in Azure portal: JRE_HOME = D:/home/site/jdk1.8.0_111/jre
Now the JDK has JCE enabled. The "Java minor version" selected in the Azure portal is no longer used or this App Service.
On Azure Webapp, you only have the operation permission for the path D:\home\, but no permission for the others include %JAVA_HOME% and Apache Tomcat at the path D:\Program Files (x86)\.
Generally for using some packages, you can directly import these jar files into the directory WEB-INF\lib of the project or the war file. This way is only effective for the current project, and it's safe for the others to avoid clash.
For the file structure of the path D:\home, you can refer to the wiki page https://github.com/projectkudu/kudu/wiki/File-structure-on-azure to know.
However, according to the doc README.txt in the JCE, it seems to be not possible for installing on Azure Webapp, so I think you can try to use other cryptography packages instead of JCE for your app, such as apache commons codec.
Related
I was working with some encryption and SSL handshake errors and I found that the fix was to place new UnlimitedJCEPolicy files in my java7. Two files namely local_policy.jar and US_export_policy.jar needs to be replaced. I don't have write permissions for java folder in my local machine. How can I refer them externally? I would like to add them in eclipse run configuration in arguments tab.
You can refer this link for some more ideas: How to avoid installing "Unlimited Strength" JCE policy files when deploying an application?
But I think the easiest way should be get write permission in your local machine, it will save you lots of time
I might be barking up the wrong tree here as I have no experience with java programming.
I came across jsprit a java based VRP solver which looks very impressive and I was wondering if it can be used in a php based web app.
I have installed tomcat and JavaBridge, I have downloaded the jsprit source and binaries.
Is it possible...
to use the binaries directly by creating and deploying a .war file?
or
use the .jar files via JavaBridge?
or would I need some kind of java web app to act as a wrapper?
I have seen an app on github which looks to be a wrapper but it doesn't look finished or still active.
Thanks for any help...
After further research I found the anser myself.
I downloaded the JavaBridge template .war file and renamed it to jsprit.war.
I then downloaded the binaries for jsprit.
Using 7-zip I added the jsprit binaries to the newly renamed jsprit.war in the WEB-INF\lib folder.
Installed and setup tomcat.
Installed php5.cli.
Using tomcat web app manager I deployed the jsprit.war file.
Now, by including http://localhost:8080/JavaBridge/java/Java.inc in my php page I am now able to access the jsprit classes using: $location = new java('jsprit.core.problem.Location');
Hope this helps someone else in the future.
Why Java Web Start does not download Jar files which specified in resources?
I'm using jdk 1.5 to build my application. There is good reasons to use jdk 1.5 so that I can not upgrade it.
Jdk demo and samples used a servlet to specify location of JNLP and security checking. If I use this servlet, jnlp does not work and its jar files does not download while if write address of jnlp directly in codebase attribute by prefixing file:/localhost/ it works!
I think I found the problem! I was in an exploaded artifact environment which was a location other than actual tomcat/webapps/ROOT so that addresses in jnlp don't match to where they should point to. If I package all JWS in a war file and deploy it manually it works fine.
I'm a beginner java developer and i'm not very confident with java world tools.
i'm using eclipse helios, jsdk 1.5, axis2 plugin and tomcat 6.0.29 on windows to port a very old webservice , preaviosuly deployed on a websphere.
I've added a tomcat server to my eclipse project, when i start the server i get the following message : the APR based Apache Tomcat Native library ... etc ... was not found on the java.library.path .
How do i change that variable (or any environment variable in general ) from inside eclipse ?
Then i've another problem i don't know if can be solved with some kind of configuration : i must use some third party .class library grouped togheter into a zip file. I've added the zip to the shared.loader property of the tomcat catalina.properties file and my project can't see them. If i rename the .zip file to .jar everything works fine . How can i use classes inside zip file without renaming it to jar ?
thank you in advance
A Jar is based on the same format as that of Zip. All the third party classes are bundled as Jars (Java Archives) and should be used like that instead of Zip. So if you happen to have a zip housing your classes you should rename it to jar as per java's conventions.
You can check where java.library.path variable is pointing to? using System.getProperty("java.library.path"); and see if the native libs are present in there..you should use the jar instead as its the standard format for archiving java class files
when i start the server i get the following message : the APR based Apache Tomcat Native library ... etc ... was not found on the java.library.path
The exact message is:
INFO: The APR based Apache Tomcat Native library which
allows optimal performance in production environments
was not found on the java.library.path
As you can see, the message is logged as INFO and the easiest thing would be to ignore it, especially in a development environment. But if want to make things more complicated, go to the Apache Portable Runtime (APR) based Native library for Tomcat and follow the install instructions.
(...) I've added the zip to the shared.loader property of the tomcat catalina.properties file and my project can't see them. If i rename the .zip file to .jar everything works fine . How can i use classes inside zip file without renaming it to jar?
In other words, using a (standard) *.jar worked, but a *.zip didn't. I'm tempted to answer: use a .jar extension.
I've been developing a java application with the eclipse RCP which requires the Java Communications API. Now as the javax.comm has to be setup first (install javax.comm.properties, win32comm.dll and comm.jar) my question ist: How should I deploy my application to make sure javax.comm will be setup on the user's machine? Should I provide an installer which does the setup or should I let the application itself export the files in their respective directories?
I have never before done such a thing, so I'd appreciate any help.
Thanks
I'm using RXTX instead of Java Comm, but the problem is the same, i think. The RXTX site has a documentation about it, please see the Wiki. The description is for Eclipse 3.3, but works for 3.5 too.
How would you like to distribute your application? As a JAR, I assume? In this case you need to setup the JAR's manifest.mf file with a Class-Path entry which contains semicolonseparated relative paths to the desired resources (relative from the JAR file itself on). You can distribute your application with the javax.comm stuff included and if necessary write a readme.txt with installation instructions.