Tuesday, August 23, 2022

Resolving "Retrieving the COM class factory for component with CLSID ..." error message in IIS.

Problem Statement

On attempting to access  or performing any operation on a web application that is hosted on IIS, you may get the following error:-

Retrieving the COM class factory for component  with CLSID {....

Resolution

While there could be couple of reasons why this can occur, the most likely cause is due to lack of folder permission for the IIS_IUSR group for the folder that has the application code.

The base folder that contains the application code needs to have access for the IIS_IUSR group.
 
Once the folder is provided access as follows, the issue should be resolved:-

 

 

 

 

 

 

Friday, December 31, 2021

Updating Log4J to latest version in existing package without rebuilding the package jar.

 Description

This post talks about how to update an existing jar file that was built using the vulnerable Log4J2 jars (currently 2.17) without having to rebuild the jar from the source location.


This can be used by companies who want to patch their components already on the field for quick fix.

Pre-Requisite

  1. 7zip downloaded and installed.
  2. The vulnerable jar file (say myapplication.jar ) that has the vulnerable Log4J2 binaries embedded. For this example, our application has the following vulnerable log4j files:-
    1. log4j-api-2.13.0.jar
    2. log4j-core-2.13.0.jar
    3. log4j-jul-2.13.0.jar
    4. log4j-slf4j-impl-2.13.0.jar
  3. Download latest Log4J2 jar files from:- https://logging.apache.org/log4j/2.x/download.html
    1. log4j-api-2.17.0.jar
    2. log4j-core-2.17.0.jar
    3. log4j-jul-2.17.0.jar
    4. log4j-slf4j-impl-2.17.0.jar
  4. Extract the vulnerable jar file (myapplication.jar using 7zip and check the location where the vulnerable jar files are packaged. Typically they are stored in:- \BOOT-INF\lib

Note:- At the time of creating the blog, the latest version was 2.17 that has the fix for the vulnerabilities- 

CVE-2021-45046, CVE-2021-44228 and CVE-2021-45105 .
 

Methodology
At a high level the following are the tasks we will be performing.
  • Using 7Zip, we will first remove the vulnerable Jars from the final Package (Jar file) .
  • Using 7Zip will add the updated Log4J jars to the existing Package.
Steps:-
1. Open command prompt and ensure 7zip command is there in the path.
 
2. CD to the directory where the vulnerable jar file(say myapplication.jar  is located (say c:\TestApp\) 
 
3. Run the following command:- 
c:\TestApp>7Z.EXE d myapplication.jar -r log4j-api-2.13.0.jar 

Repeat this for Other jars as well:-

c:\TestApp>7Z.EXE d myapplication.jar -r log4j-core-2.13.0.jar
c:\TestApp>7Z.EXE d myapplication.jar -r log4j-jul-2.13.0.jar

c:\TestApp>7Z.EXE d myapplication.jar -r log4j-slf4j-impl-2.13.0.jar 

Note:-  The -r option will recursively look for the specified log4j file within the myapplication.jar        file and delete the occurrences.  
 
4. Create the folder structure in the same directory that replicates the location of the jar files inside the package (as determined in the  step 4 of per-requisites, i.e. \BOOT-INF\lib) and place the new log4j jar files (version 2.17.0) in the folder. So the directory structure will look like:- c:\TestApp\BOOT-INF\lib)
 
5. Run the following command to add the updated log4j files:-
c:\TestApp>7Z.EXE a -mx=0 .\myapplication.jar BOOT-INF\lib\log4j-api-2.17.0.jar
and repeat for the other jars as well as follows:-
 
 c:\TestApp>7Z.EXE a -mx=0 .\myapplication.jar BOOT-INF\lib\log4j-core-2.17.0.jar
c:\TestApp>7Z.EXE a -mx=0 .\myapplication.jar BOOT-INF\lib\log4j-jul-2.17.0.jar
c:\TestApp>7Z.EXE a -mx=0 .\myapplication.jar BOOT-INF\lib\log4j-slf4j-impl-2.17.0.jar
 
myapplication.jar is now updated with the new log4j2 files!
 
Note:-  The -mx=0 option is important else the application will not startup complaining that the jar files should not be compressed on startup.
 else you would get  the following error:-
 
Exception in thread "main" java.lang.IllegalStateException: 
Unable to open nested entry 'BOOT-INF/lib/log4j-core-2.17.0.jar'. 
It has been compressed and nested jar files must be stored without compression.
 Please check the mechanism used to create your executable jar file


Wednesday, January 29, 2014

Errors occurred during the build. Errors running builder 'Android Package Builder' on project 'HelloAndroid'. sun/security/x509/X500Name

Problem:

Got the error 

"Errors occurred during the build. Errors running builder 'Android Package Builder' on project 'HelloAndroid'. sun/security/x509/X500Name"

While attempting to run an android project on an emulator.

Description:

 In my case the problem was that I had installed IBM JDK as the default java runtime. Android requires Sun JDK(Now Oracle JDK) for runtime or else it requires signed certificate to run in jvm other than what is supplied by Oracle.

Resolution:

Installed Oracle JDK and relaunched the Android ADT.

Solution Link:

“resource is out of sync with the filesystem” in eclipse after importing an Android project.

Problem:

Got the error : “resource is out of sync with the filesystem” for the default.properties file after importing an existing android project into a new workspace.

Resolution:
Right click on the project -> select "Refresh"

Source for resolution:

avoiding “resource is out of sync with the filesystem”

Tuesday, March 20, 2012

Increase Number of telnet connections to a Windows telnet server.

Windows Telnet server has a limit of 2 telnet connections by default. In order to increase the limit the following command can be used:

tlntadmn config maxconn=100

This command can be used to increase the limit of connections to 100.

Executing just :tlntadmn would list the settings for the settings.

Tuesday, June 9, 2009

"lmgrd" startup fails in Linux.

Starting "lmgrd" on Redhat Linux gives error "Failed to open the TCP port number in the license."

Problem: On attempting to start the flexlm license server on Redhat Linux, an error message is written to the log file and the license server is not able to startup. The error message is:

"Failed to open the TCP port number in the license."

Solution:
Add the following entry to the /etc/hosts file:

127.0.0.1 localhost

In our case this entry was missing from the /etc/hosts file. On adding the entry, and attempting to start the license server IT WORKED.

(This is one of the probable causes for this problem to occur and hence the solution worked us).

Monday, June 8, 2009

Start a scheduled task in minimized form.

Problem: Had a task scheduled which used to pop up a command window on top of any application. The command executed within the bat file was:"test.exe 192828@servername.com featurename 40" Needed to make sure that it was started in minimized format.

Solution: use the command "start /min test.exe 192828@servername.com featurename 40" instead within the bat file. Problem Solved!!!!