Posts

Showing posts from 2013

Excluding javascript files from validation

Image
Go to  Project Properties > JavaScript > Include Path > Source , there is " Excluded " to highlight and press "Edit" button, here you are able to add what you want to exclude (file, folder, pattern).

Linux File system

Directory Content /bin Common programs, shared by the system, the system administrator and the users. /boot The startup files and the kernel,  vmlinuz . In some recent distributions also  grub  data. Grub is the  GRand Unified Boot  loader and is an attempt to get rid of the many different boot-loaders we know today. /dev Contains references to all the CPU peripheral hardware, which are represented as files with special properties. /etc Most important system configuration files are in  /etc , this directory contains data similar to those in the Control Panel in Windows /home Home directories of the common users. /initrd (on some distributions) Information for booting. Do not remove! /lib Library files, includes files for all kinds of programs needed by the system and the users. /lost+found Every partition has a  lost+found  in its upper directory. Files that were saved during failures are here. /misc For miscellaneous purposes. /mnt S...

Maven Local Repository update on distribution management change

Whenever there is a change in the Distribution Management for the Maven. Ensure to go into the Settings.xml and modify the new URL . the settings.xml can be found under the .m2 local folder or in the Maven install folder under the conf folder.

How to import .cer file in to .truststore file?

# Copy the certificate into the directory Java_home\Jre\Lib\Security # Change your directory to Java_home\Jre\Lib\Security> # Import the certificate to a trust store. keytool -import -alias ca -file somecert.cer -keystore cacerts –storepass changeit [Return] Trust this certificate: [Yes]

Basic Authentication in IBM App scan Generic Service Client

Image
To enter the authentication in the GSC tool, you need to select the "Operation Name" and then go to: "Edit Data -> Transport -> Change... -> Open Protocol Configuration Editor". All Images are obtained from IBM Site. Reference: IBM.

Reading Files From JAR - Maven Project

ClassLoader loader = getClass().getClassLoader(); in = loader.getResourceAsStream("templates/"+templateType.getValue()+".xml"); where the template is stored in a maven project as in Src--> main--> resources-->templates-->template.xml

Unsupported major.minor version For Jar

This is Usually caused by the Build version Conflicts. Check if the jar build and consumed JDK are same.

programmatically check thread lock in Multi Threaded Environment.

This Code below can check for thread locks in a concurrent environment. this code needs to be executed by a Deamon or Timer task.                 ThreadMXBean tmx = ManagementFactory.getThreadMXBean(); long[] ids = tmx.findDeadlockedThreads(); if (ids != null)                  { ThreadInfo[] infos = tmx.getThreadInfo(ids, true, true); LOG.fatal("********************************************The following threads                          are deadlocked:**************************************"); for (ThreadInfo ti : infos)                         { LOG.fatal(ti); } LOG.fatal("************************************************************                        ********************************...

Jaxb not adding the @XMLRoot element.

There are those cases where you are trying to build an object Model from XSD and sees that there is no @XMLRootElement tag added to the root element in the stub and your unmarshelling starts failing. The    basic idea is that if we can statistically guarantee that a complex type won't be used by multiple different tag names, XJC put @XmlRootElement.  Try for the basic schema  http://www.w3schools.com/schema/  here. You see the root element gets generated. The issue happens when you have something like this <schema>   <element name = "Employee" type = "inc:CTEmployee" />   <complexType name = "CTEmployee" /> </schema>   You see the Employee element is not tagged with the @XMlRootElement in the stub. The Assumption that XJC does is  that  "your schema might be used by other schema's that XJC isn't compiling right now" . So basic fix is avoid doing the Complex type defined ou...

IE6 and IE7 Specific CSS

#element { color : #999 ; /* shows in all browsers */ * color : #999 ; /* notice the * before the property - shows in IE7 and below */ _ color : #999 ; /* notice the _ before the property - shows in IE6 and below */ }

JSF Composite Component

"cc" is a predefined variable and stands for Composite Component.It Reffers to the Top Level Component in component file UINaming Container. Main Property is " attrs " contains a Map of all the properties.Some of the other attributes parents children clientId  Use the “type” attribute of composite:attribute to hook the element(s) to bean properties       <composite:attribute name="value" required="true" type="coreservlets.Nameable"/> To Create the Backing Bean for the Custom Component Following Steps are important 1. Define the @FacesComponent("full class name") - This Defines the component which is newly created. 2. If Input Component UIInput must be extended and "NamingContainer" should be implemented. 3. Override getFamilyMethod as                            public String getFamily()                         ...

XML Schema Demistyfied

DTD's have limited namespace support so they are not used for webservice schema. Xml Schema is used to implement webservices. The Elements of XML Schema --------------------------- <xs:schema> the schema element is the root element.It can contain more attributes. Eg:  <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com" elementFormDefault="qualified"> ... ... </xs:schema> xmlns:xs="http://www.w3.org/2001/XMLSchema" this specifies that the elements and datatypes are coming from "http://www.w3.org/2001/XMLSchema"name space and also these elements and datatypes must have a prefix xs. This need not be xmlns:xs alone it can be xmlns:xsd or any name. targetNamespace="http://www.w3schools.com" indicates that the elements defined by this schema comes from the namesp...

Adding Archetype to STS Over Proxy

If you are behind the firewall or Proxy then you need to configure the proxy settings for maven to update its catalogs. STS Maven  Update might not take the General - > Preference -- >Network  proxy settings. In Either cases it is always helpful to configure the Maven Settings file located under       window -> Preferences - >Maven Settings.  The file might not exist for first time so have to create a file and add it to the location the general file format is < settings xmlns = "http://maven.apache.org/SETTINGS/1.0.0" xmlns : xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation = " http : //maven.apache.org/SETTINGS/1.0.0 http : //maven.apache.org/xsd/settings-1.0.0.xsd"> < localRepository /> < interactiveMode /> < usePluginRegistry /> < offline /> < pluginGroups /> < servers /> < mirrors /> < proxies > ...

DocType Syntax Error

This usually happens because loading an HTML document as a script. This is often caused by <script src=""></script> (i.e. a relative URI pointing at the current, HTML, document)) or one of the scripts pointing to a 404 error.

Illegal character in path at index 18 - faces-config

Ever Wondered why your Application wont start because of this error. The Reason is Simple The Deployment path of the Faces-Config contains space mostly or some illegal character. Eg : Say your workspace is ina path like below file:/C:/Documents and Settings/  The error gonna be like this java.net.URISyntaxException: Illegal character in path at index 18: file:/C:/Documents and Settings/ Move it to a location without space in the URI Path.