Category Archives: java

java

How to write Java lambda Expression ?

Lambda expression is a new and important feature of Java which was included in Java SE 8. It provides a clear and concise way to represent one method interface using an expression. It is very useful in collection library. It … Continue reading

Posted in java, Uncategorized | Tagged , | Leave a comment

oracle.security.jps.service.idstore.IdentityStoreException: JPS-01520: Cannot initialize identity store at starting OBIEE

[bi_server1] [WARNING] [JPS-01520] [oracle.jps.idmgmt] [tid: [ACTIVE].ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] [userId: <WLS Kernel>] [ecid: 0000KdVfAivApIWFLzNM8A1K^prs000002,0] [APP: bicomposer#11.1.1] Cannot initialize identity store, cause: javax.naming.CommunicationException: 2001:0:9d38:90d7:280c:3b5:3f57:ebcd:9704 [Root exception is java.net.ConnectException: connect: Address is invalid on local machine, or port is not … Continue reading

Posted in ADF, OBIEE, Weblogic | Tagged | Leave a comment

run linux command from java and reading result?

import java.*; class Test { public static void main(String[] args) { int ch; try { Process myProcess = Runtime.getRuntime().exec(“ls -al”); InputStreamReader myIStreamReader = new InputStreamReader(myProcess.getInputStream()); while ((ch = myIStreamReader.read()) != -1) { System.out.print((char) ch); } } catch (IOException anIOException) { … Continue reading

Posted in java, mysql

Introduction to Web Services

Web services are distributed application components that are externally available. You can use them to integrate computer applications that are written in different languages and run on different platforms. Web services are language and platform independent because vendors have agreed … Continue reading

Posted in Web Services

String in java

Java Programming String is Special A Brief Summary of String Class A String contains a sequence of Unicode characters. Unlike C/C++, where string is simply an array of char, Java’s String is an object class in the core package java.lang. … Continue reading

Posted in java, Strings | Tagged

How to use ContextLoaderListener,how to make application Listener

publicclass Main extends org.springframework.web.context.ContextLoaderListener {  /** *@param args */ DatabaseListner listener = new DatabaseListner(); publicvoid contextDestroyed(ServletContextEvent event) { super.contextDestroyed(event); listener.end(); listener = null; System.out.println(“web app undeployed”); } publicvoid contextInitialized(ServletContextEvent event) { super.contextInitialized(event); new Thread(){ publicvoid run() { listener.listen(); } }.start(); … Continue reading

Posted in java | Tagged ,

move directory in Java ,convert file to linux,remove CRLF

privatevoid moveFilesFromSourceToDestination(String sourceFolder,String destinationFolder) throws IOException{log.info( “trying move “+sourceFolder+” to “+destinationFolder ); File sFolder = new File(sourceFolder); File dFolder = new File(destinationFolder); for (File file : sFolder.listFiles()){ if (file.isFile()){ File newFile = new File(dFolder.getAbsolutePath() + “/”+file.getName()); moveFile(file,newFile); }elseif (file.isDirectory()){ File … Continue reading

Posted in java | Tagged , ,