Posts

Showing posts from 2011

URL redirection from IIS to Tomcat

Image
One of the cleaner ways of hosting our web applications is to mask the port number and abbreviate the URL so that the end users who like to memorize the URL, it will be easy. Like for example: Original URL: https://servername:8443/application1/sub-context/app/index.html URL 1  with masked port#: https://servername/application1/sub-context/app/index.html URL 2  with masked port# as well as shortened:  https://servername/appRedirect (The end user will hit this URL and it will be redirected to the URL 1. Its a two step process: 1. Masking Port number :  The port numbers 443 and 80 are standard default HTTPS and HTTP ports which are directly recognized by IIS even without even specifying them. I hosted my Flex based web application on Apache Tomcat 7.x server on HTTPS port 8443 and i wanted to prevent users from typing in the port number each time they access the application as well as for security reasons its not advisable to display the port number to the end users. In order to

BlazeDS Flex Error: Channel disconnected before an acknowledgement was received.

I developed an application with Flex as UI and Java as backend. BlazeDS as the integration between the two and the application was deployed on Tomcat 7 server.  The initial release was on simple http so there were no issues until recently when we were asked to move all the applications over to SSL for security reasons. The SSL configuration on Tomcat is fairly easy and i was able to access my Flex application on HTTPS with no issues. However there was a strange issue that was occurring everytime the application was left idle for some time. Upon catching the error message it was: faultString:'Channel disconnected'  faultDetail:'Channel disconnected before an acknowledgement was received'. I tried adding few additional configuration parameters to services-config.xml such as:  <login-after-disconnect>true</login-after-disconnect>  But it didnt work. Finally this is the resolution which took care of this channel disconnect issue permanently: 1.

Unable to cast COM object of type 'Microsoft.Office.Interop.Access.Dao.DBEngineClass' to interface type 'Microsoft.Office.Interop.Access.Dao._DBEngine'.

While trying to import the Access DB into a MS SQL Server, you may encounter the following exception: Access Object Collector error: Database      Unable to cast COM object of type 'Microsoft.Office.Interop.Access.Dao.DBEngineClass' to interface type 'Microsoft.Office.Interop.Access.Dao._DBEngine'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00000021-0000-0010-8000-00AA006D2EA4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).      An error occurred while loading database content. Resolution : The issue is the DAO related DLL is not registered in the system. Please ensure that you have this DLL at  C:\Program Files\Common Files\Microsoft Shared\DAO\Dao360.dll And then try to register it using the following command on a command prompt: regsvr32  C:\Program Files\Common Files\Microsoft Shared\DAO\Dao360.dll 9 out of 10 times, this s

HTTP Error 500.24: An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Server Error in Application "DEFAULT WEB SITE" Internet Information Services 7.0 Error Summary HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. Detailed Error Information Module ConfigurationValidationModule Notification BeginRequest Handler StaticFile Error Code 0x80070032 Requested URL http://xxx:80/appName Physical Path C:\inetpub\wwwroot\ appName Logon Method Not yet determined Logon User Not yet determined Most likely causes: ·          system.web/identity@impersonate is set to true. Things you can try: ·          If the application supports it, disable client impersonation. ·          If you are certain that it is OK to ignore this error, it can be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false. ·         

Setting property 'keystoreFile' did not find a matching property. No Certificate file specified or invalid file format

I encountered this weird exception on X server even after configuring the Tomcat  configuration file properly same as i did for other server  Y where it is working fine. Solution is mentioned after the exception log: May 24, 2011 5:23:45 PM org.apache.catalina.startup.SetAllPropertiesRule begin WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'keystoreFile' to 'C:\Program Files\Java\jdk1.6.0_25\keystore\.keystore' did not find a matching property. May 24, 2011 5:23:45 PM org.apache.catalina.startup.SetAllPropertiesRule begin WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'keystorePass' to 'changeit' did not find a matching property. May 24, 2011 5:23:45 PM org.apache.catalina.startup.SetAllPropertiesRule begin WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'clientAuth' to 'false' did not find a matching property. May 24, 2011 5:23:46 PM org.apache.coyote.h

Unable to create the Web site 'https://xxxxx/WCFWSHttps/'. The Web server does not appear to have FrontPage Server Extensions installed.

For publishing the WCF based web services on IIS 7.0, you need to have the Frontpage server extensions for IIS7.0. You can download the extension here: http://www.iis.net/community/default.aspx?tabid=34&g=6&i=1630 After the installation, visit the following site to extend the virtual server. http://test01:3610/fpadmdll.dll?page=fpadmin.htm P.S: The hostname and port may change in your case. You can also launch this adminstrator page by Start->All programs -> Administrative Tools -> Microsoft SharePoint Administrator which will open the Server Administration page. Once you are there, you can click "extend" to extend your virtual server. Please ensure that you are opening this internet browser as an Administrator. Otherwise you may receive the following error: Cannot create folder "_vti_pvt". iis7 You can open the IE as an administrator by selecting the option "Run as Administrator" on the context menu.

java.lang.ClassNotFoundException: There's no JAXB 2.2 API in the classpath

I have previously developed several web services in Netbeans 6.9 IDE with much ease and flexibility. But today when i launched Netbeans 6.9 today, it downloaded some updates by itself and all my existing web services were showing build errors. The following are couple of exceptions that i noted down: java.lang.ClassNotFoundException: There's no JAXB 2.2 API in the classpath C:\Projects\proj_name\nbproject\jaxws-build.xml:22: taskdef class com.sun.tools.ws.ant.WsImport cannot be found taskdef A class needed by class com.sun.tools.ws.ant.WsImport cannot be found: org/apache/tools/ant/taskdefs/MatchingTask While i kept on fixing one after another exception, here is the permanent fix that resolved all the issues: I had several Jars inside this directory: C:\Program Files\Java\jdk1.6.0_24\jre\lib\endorsed like webservices-api.jar, jaxb-api.jar, jaxws-api.jar, jaxb-xjc.jar, jaxws-tools-2.0.jar, jaxws-tools-2.1.4.jar. There was an existing issue that was raised here: http://j

Primavera 6.7 API Server ServiceNotBoundException

While calling the Primavera API server from a remote client, i was getting this exception: com.primavera.integration.network.ServiceNotBoundException: rmi/RemoteSession at com.primavera.integration.network.RMIInstanceFactory.getRemoteInstance(RMIInstanceFactory.java:97) The default port 9099 is in listening mode on the API server. The API server is deployed on JBOSS applications server. After a careful study of the configuration and the admin guide, here is how i resolved this issue: 1. Unlike the previous versions, the RMI standard Service Port needs to be set explicitly to a valid port value if the RMI server is going to be access through a firewall. (If the server will be accessed across a firewall, you must set this to a specific port.) 2. This port must be different than RMI Registry port. You will use the Registry port in all your client side method calls. 3. Setup a inbound firewall rule for both these ports RMI Standard service port as well as RMI Registry port. 4.

Adding SSL to Tomcat 6.0 Axis2 web service and client

If you want to add the SSL security to your web service (in Windows), please follow these steps: 1. Create a self-signed certificate on the server side using the "Keytool" utility found in your Java binary distribution. keytool -genkey -alias tomcatWSServer -keyalg RSA This will create a new file .keystore in the user's home directory. You can move it to your desired location. a. Please note that you should not enter your first name/last name, instead please enter the name of the server on which tomcat is running. The clients who will be validating the certificate will match the name of the server and the name on the certificate to verify the authenticity. b. Also they will be ensured that the request is coming from the same server as mentioned in the certificate to avoid phishing and other threats. c. Please use the same password for Certificate and the Keystore both. 2. Enable the HTTPS configuration in the tomcat's server.xml as shown below. Please note

Tomcat 6 error on startup: Commons Daemon procrun stdout initializedError occurred during initialization of VM

I noticed the following exception in Tomcat logs: Commons Daemon procrun stdout initializedError occurred during initialization of VMjava/lang/NoClassDefFoundError: java/lang/Object Resolution: Go to C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin and double click on tomcat6w.exe. This will open the Tomcat 6 properties. Go to Java tab and check the path for jvm.dll under Java Vitual machine textbox. This should be under the same JRE that is used for all other purposes like keystore, JAVA_HOME, etc. This fix should resolve the problem.

Tomcat 6.0 java.net.BindException: Address already in use: JVM_Bind

Tomcat 6.0 was not starting correctly on default port. Tried changing the connector port to 8181 in the server.xml as follows: Connector port="8181" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> Still was receiving the following exception on startup: Mar 18, 2011 2:58:05 PM org.apache.catalina.core.StandardServer await SEVERE: StandardServer.await: create[8005]: java.net.BindException: Address already in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(Unknown Source) at java.net.ServerSocket.bind(Unknown Source) at java.net.ServerSocket. (Unknown Source) at org.apache.catalina.core.StandardServer.await(StandardServer.java:406) at org.apache.catalina.startup.Catalina.await(Catalina.java:676) at org.apache.catalina.startup.Catalina.start(Catalina.java:628) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect