Nginx with Java library

Jennie Jia Jennie.Jia at amdocs.com
Fri May 24 22:28:54 UTC 2019


Actually by dumping a few dependency jar inside of the jar folder of the ngnix-clojure-0.4.5.  (jvm_classpath "jars/*";).  It seems working.. but I am not sure if it is the correct or best way to do it

-----Original Message-----
From: nginx <nginx-bounces at nginx.org> On Behalf Of Jennie Jia
Sent: Friday, May 24, 2019 3:32 PM
To: nginx at nginx.org
Subject: RE: Nginx with Java library

Thank you, Patrick!   I am trying figure out  how to port the ONAP crypto config to the nginx-clojure app.  But no luck so far... 

Here is what  did:

1)  I added the dependency in the pom.xml  here https://github.com/nginx-clojure/nginx-clojure/blob/master/example-projects/c-module-integration-example/pom.xml
    <dependency>
        <groupId>org.onap.portal.sdk</groupId>
        <artifactId>epsdk-fw</artifactId>
        <version>2.5.0</version>
     </dependency>
2) Build jar  and put it under the jar/lib folder of nginx-clojure-0.4.5.   
3) Start nginx
4) Send HTTP request (with cookie)  to nginx,  My java code  is triggered, but got NoClassDefFoundError

2019-05-24 13:41:56[error][16860][main]server unhandled exception!
java.lang.NoClassDefFoundError: org/onap/portalsdk/core/onboarding/util/CipherUtil
	at example.MyHandler.invoke(MyHandler.java:37)
	at nginx.clojure.java.NginxJavaHandler.process(NginxJavaHandler.java:125)
	at nginx.clojure.NginxSimpleHandler.handleRequest(NginxSimpleHandler.java:187)
	at nginx.clojure.NginxSimpleHandler.execute(NginxSimpleHandler.java:105)
	at nginx.clojure.NginxClojureRT.eval(NginxClojureRT.java:1133)
Caused by: java.lang.ClassNotFoundException: org.onap.portalsdk.core.onboarding.util.CipherUtil
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

-----Original Message-----
From: nginx <nginx-bounces at nginx.org> On Behalf Of Patrick
Sent: Thursday, May 23, 2019 10:03 PM
To: nginx at nginx.org
Subject: Re: Nginx with Java library


On 2019-05-23 21:29, Jennie Jia wrote:
> Here is my code to do the logic, but I checking the java library 
> provided by this nginx-clojure 
> https://github.com/nginx-clojure/nginx-clojure/tree/master/src/java/nginx/clojure/java.
> I can not figure out how to get  "cookie" header value from the http 
> request ( it use NginxJavaRequest.java here.  Any help are 
> appreciated.!

> 	public Object[] invoke(Map<String, Object> request) throws 
> IOException {
>
> 		NginxJavaRequest req = ((NginxJavaRequest)request);
>
> 		// TODO  Need Figure out how to get Cookie from the request
 		//String encryptedCookie = req.getVariable("cookie");
 		String encryptedCookie = (String) ((Map)request.get(HEADERS)).get("cookie");


If all that is needed is the decrypted cookie contents, and the backend is written in another language, consider porting the cookie decryption code to that language as ONAP uses the SunJCE flavor of AES/CBC/NoPadding

Note that to decrypt the cookie, the ONAP crypto config needs to be ported to the nginx-clojure app as well.

Patrick
_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdocs.com/about/email-terms-of-service <https://www.amdocs.com/about/email-terms-of-service>

_______________________________________________
nginx mailing list
nginx at nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
This email and the information contained herein is proprietary and confidential and subject to the Amdocs Email Terms of Service, which you may review at https://www.amdocs.com/about/email-terms-of-service <https://www.amdocs.com/about/email-terms-of-service>



More information about the nginx mailing list