Vinvin Parpar

Greenhorn
+ Follow
since Sep 16, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vinvin Parpar

Hi Bill,

Yeah that's what I noticed when doing tests on this.

I also tried posting questions in Jasypt Forum but unfortunately no one has replied.

http://forum.jasypt.org/Spring-Jasypt-Integration-XML-Config-org-jasypt-exceptions-EncryptionInitializationException-td5706242.html

If I ever fix this I'll post my solution here.
11 years ago
Hi Bill,

Sorry it took me a while to reply. I tried your advice, but unfortunately the same exception happened, I posted the whole exception below.

I'm starting to think that before other property placeholders are loaded the decryption of text comes first along with the configurations of it, that's just an assumption based on tests.

application-context.xml



Whole Exception:

STATUS | wrapper | 2012/07/24 09:38:05 | Launching a JVM...
INFO | jvm 1 | 2012/07/24 09:38:06 | Wrapper (Version 3.2.0) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2012/07/24 09:38:06 |
INFO | jvm 1 | 2012/07/24 09:38:06 | Jul 24, 2012 9:38:06 AM org.apache.catalina.startup.Catalina load
INFO | jvm 1 | 2012/07/24 09:38:06 | INFO: Initialization processed in 475 ms
INFO | jvm 1 | 2012/07/24 09:38:08 | SLF4J: Class path contains multiple SLF4J bindings.
INFO | jvm 1 | 2012/07/24 09:38:08 | SLF4J: Found binding in [jar:file:/D:/lib/slf4j-jdk14-1.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
INFO | jvm 1 | 2012/07/24 09:38:08 | SLF4J: Found binding in [jar:file:/D:/lib/slf4j-simple-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
INFO | jvm 1 | 2012/07/24 09:38:08 | SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
INFO | jvm 1 | 2012/07/24 09:38:09 | ERROR [WrapperSimpleAppMain] (ContextLoader.java:227) - Context initialization failed
INFO | jvm 1 | 2012/07/24 09:38:09 | org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException: ${TEST_JASYPT_ALGO} SecretKeyFactory not available
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:708)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:553)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:705)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.jasypt.properties.PropertyValueEncryptionUtils.decrypt(PropertyValueEncryptionUtils.java:72)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer.convertPropertyValue(EncryptablePropertyPlaceholderConfigurer.java:111)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperty(PropertyResourceConfigurer.java:112)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperties(PropertyResourceConfigurer.java:95)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:72)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:623)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:941)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardHost.start(StandardHost.java:862)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardService.start(StandardService.java:525)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
INFO | jvm 1 | 2012/07/24 09:38:09 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2012/07/24 09:38:09 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO | jvm 1 | 2012/07/24 09:38:09 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2012/07/24 09:38:09 | at java.lang.reflect.Method.invoke(Method.java:601)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
INFO | jvm 1 | 2012/07/24 09:38:09 | at net.covalent.tomcat.wrapper.ThreadDumpWrapper.main(ThreadDumpWrapper.java:74)
INFO | jvm 1 | 2012/07/24 09:38:09 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2012/07/24 09:38:09 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
INFO | jvm 1 | 2012/07/24 09:38:09 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO | jvm 1 | 2012/07/24 09:38:09 | at java.lang.reflect.Method.invoke(Method.java:601)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:197)
INFO | jvm 1 | 2012/07/24 09:38:09 | at java.lang.Thread.run(Thread.java:722)
INFO | jvm 1 | 2012/07/24 09:38:09 | Caused by: java.security.NoSuchAlgorithmException: ${TEST_JASYPT_ALGO} SecretKeyFactory not available
INFO | jvm 1 | 2012/07/24 09:38:09 | at javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:121)
INFO | jvm 1 | 2012/07/24 09:38:09 | at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:159)
INFO | jvm 1 | 2012/07/24 09:38:09 | at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:695)
INFO | jvm 1 | 2012/07/24 09:38:09 | ... 44 more
11 years ago
Hi Bill,

Thanks for the prompt reply, I haven't read the whole thing just some few important notes on how to configure jasypt - spring, but because of this exception I'm trying to read the whole thing.

I totally agree with you on the EnvironmentStringPBEConfig, but as per requirement I need to place all configurations in property files.

So I tried to add order and ignoreUnresolvablePlaceholders in my application context:

application-context.xml


and when I started my application I saw this same exception upon initialization:

org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException: $A{TEST_JASYPT_ALGO} SecretKeyFactory not available
at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:708)
at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:553)

Is it ignoring the order of placeholder?

Thanks,
Vincent
11 years ago
Hi guys,
I just want to ask, how can I externalize into a property file the "algorithm", "password", "stringOutputType" of SimpleStringPBEConfig? Because whenever I try to, I keep having this exception:

Exception:

org.jasypt.exceptions.EncryptionInitializationException: java.security.NoSuchAlgorithmException:${TEST_JASYPT_ALGO} SecretKeyFactory not available
at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.initialize(StandardPBEByteEncryptor.java:708)
at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.initialize(StandardPBEStringEncryptor.java:553)

Here is my configuration:

jasypt.properties:
TEST_JASYPT_ALGO=PBEWithMD5AndDES
TEST_JASYPT_PASS=Password
TEST_JASYPT_STROUT_TYPE=hexadecimal

database.properties
DB_DRIVER=<driver class here>
DB_URL=<url here>
DB_USER=<user here>
DB_PWD=ENC(<encrypted pass here>)

application-context.xml:


Any ideas?

Thanks,
Vincent
11 years ago
Hi Guy and David!

Ok, I will try both of them, once I'm done I'll post my results.

Thanks,
Vincent
12 years ago
Yeah, I've read some articles about hooks in Liferay, it might actually be the answer to my question, but Guy have you tried creating your own hook in Liferay 6.xx? I'm having a hard time looking for resources on hooks.
12 years ago
Hi,

I'm using Liferay 6.0.5 bundled with Tomcat and I'm having problems with the window state of my portlets. Once the user is logged in by default the portlets are in a NORMAL window state.. so is there any way that I can control that?..

Is it possible to modify the default window state of portlets within Liferay from NORMAL to MINIMIZE? How would I do that?

Here is what I'm currently using..

Liferay 6.0.5 w/ Tomcat
Spring 3
Java 1.6

Thanks,
Vincent
13 years ago
Yeah, so basically it all depends on my browser whether or not I have TXT/PDF reading plugins / capabilities..

I tried the same code on a different file type (jar, zip), it shows a save prompt.

Thanks for the answer Lester it really gave me an idea on how to solve this.
13 years ago
You're right Lester, I tried it and it works, I used a hotlink on my page and whenever the user clicks on it the page displays the contents of the file.


How can I automate the download of file without displaying the contents of it on the web page? If this is not achievable I'll have to stick with the client side jar to invoke the download.

Thanks!
13 years ago
Hello!

I have a question regarding Apache's FTPClient.retrieveFile(), here's the situation, I've created a simple web application and I was planning on letting the users download files from a FTP Server whenever the user clicks a button or link on my web page. I found a library from Apache that contains FTP manipulations, and I want to use it as the method of downloading files from the FTP Server into the local drive of the user.

How will I achieve this?

I've tried to using retrieveFile() but it only downloads the files from the FTP Server into the Application Server not to the local drive (Client Side) of the user..

Is there a way I can do this?
13 years ago
I see, so If I embed a signed applet and use ServerSocket I'll be able to invoke applications (executable JAR for example) from the client side?

Here's the code I used back then when we were still testing ActiveX and when we were allowed to use IE:



As you can see I created a simple (just for testing) function call to a javascript just to invoke the JAR placed on the client side.

Thanks,
Vincent
13 years ago
Hi Lester,

Thanks for the quick reply, you see I've tried doing this with ActiveX and it works,
but our requirements changed so I no longer have the option to use IE as my web browser.

What other options could I use to replicate the behavior of ActiveX on other web browsers like Firefox and Google Chrome, any suggestions?

Thanks again,
Vincent
13 years ago
Hi guys,

I don't know if I'm in the right thread to post this but I figured that I should post it here since my question it involves Web technologies (HTML, JavaScript, JSP and such), but on the other hand maybe I'm supposed to post this in the Applet thread?..

Anyways, my question is...

How do I invoke client side applets from a web application? (Servlets)

Thanks,
Vince
13 years ago