Friday, October 31, 2014

URI has an authority component - Error

I get the "URI has an authority component" error
The stack trace is ...
Caused by: java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(File.java:368)

In the properties file, I found
fileService.fileStoreLocation=file://Users/me/rest_of_path

I changed the above setting to (i.e., removed the extra slash):
fileService.fileStoreLocation=file:/Users/me/rest_of_path

This change fixed the error.

Saturday, February 16, 2013

Classloader Classpath problems in WebSphere 7.0

Whenever I tried to experiment with classpaths in WebSphere 7.0 for example, change the classloader policy to "parent last" or set isolated classloader for a shared library to true, I ran into issues. More specifically, the Admin Console which is a system application that runs under the moniker of "isclite" web application would not run. The WAS server raised the following
exceptions:

E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet
/error.jsp in application isclite.
Exception created : com.ibm.websphere.servlet.error.ServletErrorReport: javax.servlet.jsp.JspException:
Cannot find message resources under key org.apache.struts.action.MESSAGE
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:695)
at _ibmjsp._error._jspService(_error.java:243)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)


Caused by: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
at org.apache.struts.util.RequestUtils.retrieveMessageResources(Unknown Source)
at org.apache.struts.util.RequestUtils.message(Unknown Source)
at org.apache.struts.taglib.bean.MessageTag.doStartTag(Unknown Source)
at _ibmjsp._error._jspx_meth_bean_message_0(_error.java:315)
javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at org.apache.struts.action.WebXMLServletMappingParser.getParser(Unknown Source)
at org.apache.struts.action.WebXMLServletMappingParser.getXMLReader(Unknown Source)
at org.apache.struts.action.WebXMLServletMappingParser.parse(Unknown Source)
at org.apache.struts.action.ActionServlet.initServlet(Unknown Source)
at org.apache.struts.action.ActionServlet.init(Unknown Source)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)

A work around to correct a classpath issue is to stop the server, directly access the classpath setting at the following location (libraries.xml) and restart the server.

C:\WAS70\profiles\AppSrv01\config\cells\US-L3L5666-LNode05Cell\nodes\US-L3L5666-LNode05\servers\server1

setAsText: Cannot find FacesContext warning / error

I was recently converting a project from Faces (JSF) to NonFaces using JSTL, JSP, AJAX and jQuery.

I was making changes to a JSP page.  All of a sudden, the page which was working before stopped working.  The console logged the warning:setAsText: Cannot find FacesContext
Also, the error " com.ibm.ws.jsp.JspCoreException: com.ibm.ws.jsp.JspCoreException: javax.faces.Face
sException: Cannot find FacesContext."

I started to panic - do I still need the JSF config?

The cause of the issue happens to be
< jsp:setProperty name="tsdec" property="entryDate" value="${pped1}"  / >

Whenever JSTL needs to convert "string" value to a complex data type for example java.util.Date and it does not find a custom tag for its conversion,  it applies setAsText() method.  If it does not find the JSF implementation files, it throws the above error.   I find it odd that this method is bundled into JSF implementation.

In the above case, I added the fmt tag to parse the date:

< fmt:parseDate var="pped1" value="${s_pped}" type="date" pattern="MM/dd/yyyy" scope="request"  / >


That resolved the issue.

Wednesday, November 14, 2012

Examine contents of a JavaScript Object

Here is a bit of a code to peek into the contents of a JavaScript object:

1:  for( key in inst ) {  
2:        console.log( "key is " , [ key ] , ", value is " , inst[ key ] );  
3:        if ((key == "input")||(key == "dpDiv")||(key =="settings")||(key == "trigger" )){  
4:             var subObj = inst[key];  
5:             for (key1 in subObj) {  
6:                  console.log( "key1 is ", [ key1 ] , ", value is " , subObj[ key1 ] );  
7:             }  
8:        }  
9:  }  
The above writes out the object state to the browser's console. Note the comma separation in the log() call.

Thursday, October 25, 2012

WAS 7.0 app will not start inside RAD 7.5

PROBLEM:

The following error message appears when a J2EE app is attempted for deployment-
A composition unit with name  already exists. Select a different application name.

RESOLUTION:

Delete the /blas and /cus directories for the bad application from the configuration.
The resources will be located in the config directory of the profile.:

/config/cells/qcell/blas
/config/cells/qcell/cus 

See the following URL for more details:

Once the above directories are deleted, add projects to WAS Server inside RAD and then publish the application.

Thursday, April 28, 2011

SMTP RCPT TO Invalid address

PROBLEM:
Recently when my web application was sending out SMTP emails out to end users, I noticed the following error-
javax.mail.SendFailedException: Invalid Addresses;
com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)

CAUSE:
The end user's email address was not correct i.e., instead of being in the format of "user@domain.com", it was formatted as "user" i.e., missing domain information.

Monday, January 24, 2011

IBM WAS Changing Class Loader Policy on the Fly

I was recently working with an application and I needed to change the Class Loader policy for the WAS 7.0 server. It was set to "SINGLE". There was an issue with Integrated Service Console (ISC) application which also happens to be the Admin Console for the local installation. I could not bring up the Admin Console.

I discovered that I could change the classloader policy at the Server level from "SINGLE" to "MULTIPLE" by (a) opening this file using a text editor -C:\WAS70\profiles\AppSrv01\config\cells\US-L3L5666-LNode02Cell\nodes\US-L3L5666-LNode02\servers\server1\server.xml
(b) replace "SINGLE" with "MULTIPLE"