Pages

Wednesday, April 17, 2013

how to kill process that is runnung on perticular port in windows?

This has very handy information. sometime windows fails to kill process properly and it lefts the port running/open with that process.

  • To List the processes running on ports
    • netstat -a -o -n
  • Find the specific ip/prot you are looking for  and get the PID of it.
    • taskkill /F /PID




Tuesday, April 16, 2013

change local/language of admin console of weblogic

Hi We are doing migration of weblogic 10 to 12 and I suddenly noticed that weblogic default language was changed from english to Deutsch.
well I tried to search how is this behavior got changed and there is no way i found that how could i change it
mine is windows machine with default language setup set to Deutsch (german)  after digging for long time I could not reach to any conclusion how to change language setting for weblogic but I found interesting note about weblogic that weblogic uses browser  language setting, so I tried following
I open up Internet Explorer >>options>>General Settings>>presentation>> language>>
click on add button>> select english-US>> move it up as first preference if you have another language pre selected in list. save and apply.
thats it. and try to login again to weblogic console and you will see it now in english langauge.


Monday, April 8, 2013

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javelin/jsp/JspFunctionMapper

Recently I come across above error on weblogic 12c migration project, since  for my test I used fexisting old ear that was built for weblogic 10.0.2 version. Later I found that this error has caused a problem because application is using pre-compiled jsps inside, I also noticed that weblogic 10.3.0  this jsp compilation has been depricated. so the solution was to remove the pre-compiled jsp classes from your war file or compile them again using weblogic 12c, I took a shortcut to remove classes and guess what, it failed again, since you must also know that who wants to use pre-complied jsps also use JSPClassServlet servlet to make sure that
weblogic at runtime should not try to recompile them and must always use pre-compiled. So that was additional task for me to remove this servlet and its mapping from web-inf to make sure my shortcut way should work.


Thursday, March 7, 2013

weblogic error: package net.sf.jasperreports.engine does not exist

I just recently come across while deploying sample report application on weblogic. and it was giving me error for all of jasper report classes not found in stack trace.
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: C:\MW_WL12C_Domains\test\report32name_1362666859233_104255.java:4: error: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; ^ C:\MW_WL12C_Domains\test\report32name_1362666859233_104255.java:5: error: package net.sf.jasperreports.engine.fill does not exist import net.sf.jasperreports.engine.fill.*;
I thought of why even after giving all jar files in web-inf/lib folder it did not work? after searching i found that if you tried to compile report from jrxml to jasper in your web application  it needs jdt compiler jar which was missing along with other jar. so for any report to compile and run it need all following jar and importantly to remove above errors you need jdt-compiler.jar
commonly all required jars are as below
commons-beanutils-x.x.jar, commons-collections-x.x.jar, commons-digester-x.x.jar, commons-logging-x.x.x.jar, commons-logging-api-x.x.x.jar, itext-x.x.x.jar, jdt-compiler-x.x.x.jar
more additional jars if you have database connection, chart, images etc.

Monday, July 2, 2012

Axis2 too many open file handle or low disc space

one of our project team using webservices using Axis2 in their project discovered that, Axis is creating lot of temp files in temp folder and that was casuing to too many file handles open and out of disc space problems.
This has caused because of Axis2 was creating modules jars files on every request initiated by the client code. this is an unavoidable situation because Axis2 classloader requires these files.
after investigate how this files are created we got a solution to cache its instance of context for all client request so that Axis2 will not crete module files for each request. here is the sample before and after
old--
insidemethod {

AxisConfigurator configurator = null;
        configurator = new URLBasedAxisConfigurator(new URL(resourceXml), new URL(resourceRepo));
        ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContext(configurator);
        ...
        ...
        }
new--

private static ConfigurationContext configurationContext = null;

insidemethod {

ConfigurationContext ctx = getAxis2ConfigurationContext();
....
....
}
private static synchronized ConfigurationContext getAxis2ConfigurationContext() throws Exception {
if (configurationContext == null) {
    AxisConfigurator configurator = null;
    configurator = new URLBasedAxisConfigurator(new URL(resourceXml), new URL(resourceRepo));
    configurationContext = ConfigurationContextFactory.createConfigurationContext(configurator);
}
return configurationContext;
}