Monday, 24 June 2013

How to run Procedure in SQL Developer?

  • Use following script

          DECLARE
              x CLOB;
         BEGIN
             appps.GOODS_PKG.get_goods (704381009698,x);
            dbms_output.put_line(x);
         END;



  • In DBMS OUTPUT tab (present in tab panel where other results are shown), first press gTalk looking button on left which is enabling DBMS output.

  • After enabling Simple run above script and you will get output in DBMS OUTPUT TAB and also get successful running of procedure in RESULS tab.


Friday, 21 June 2013

java.io.IOException: An existing connection was forcibly closed by the remote host - Web Services

Client Side
  • Called a web service operation
  • Waiting for response
  • In between felt bored and cancelled it
  • I got no exception as client
  • I Sleep
Server Side
  • Got request
  • Called my methods to give output to client
  • Got result from methods and just was sending to client
WTF!!!!!
  • Client is unavailable so:
WARNING: StandardWrapperValve[EC3Monitoring]: PWC1406: Servlet.service() for servlet EC3Monitoring threw exception
java.io.IOException: An existing connection was forcibly closed by the remote host
    at sun.nio.ch.SocketDispatcher.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:33)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
    at sun.nio.ch.IOUtil.write(IOUtil.java:75)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
    at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:108)
    at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)
    at com.sun.grizzly.http.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:426)
    at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:498)
    at com.sun.grizzly.http.SocketChannelOutputBuffer.flush(SocketChannelOutputBuffer.java:476)
    at com.sun.grizzly.http.ProcessorTask.action(ProcessorTask.java:1287)
    at com.sun.grizzly.tcp.Response.action(Response.java:268)
    at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:380)
    at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:353)
    at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:175)
    at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:103)
    at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)
    at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:261)
    at com.sun.xml.ws.util.xml.XMLStreamWriterFilter.flush(XMLStreamWriterFilter.java:71)
    at com.sun.xml.ws.streaming.XMLStreamWriterUtil.getOutputStream(XMLStreamWriterUtil.java:103)
    at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:382)
    at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:149)
    at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:127)
    at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:285)
    at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:421)
    at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:99)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:650)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
    at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:619)

Thursday, 20 June 2013

Add Socks Proxy Settings in SQL Developer

Sometime while connecting we get following exception:
        Software caused connection abort: recv failed 

Following is way to resolve this
  • Go to Following Path: 
Installation directory\sqldeveloper\ide\bin

  • Open ide.conf 

  • Add following
          AddVMOption -DsocksProxyHost=localhost 
          AddVMOption -DsocksProxyPort=12345

  • Start SQL Developer

Tuesday, 19 March 2013

serialVersionUID What is that?

The serialVersionUID is used as a version control in a Serializable class. If you do not explicitly declare a serialVersionUID, JVM will do it for you automatically, based on various aspects of your Serializable class, Nice article regarding this http://www.mkyong.com/java-best-practices/understand-the-serialversionuid/

Wednesday, 13 February 2013

JMS Terminology - Back Out Queue

The backout queue is when MQ was not able to process the message for some reason, it can back it out for later processing (back to it's original queue). If it's backed out too many times, the threshold can be configured), it gets moved to the backout queue. From paxdiablo@Stackoverflow

JMS Terminology - Dead Letter Queue

Dead-letter queues are system-generated queues used for storing messages that could not be delivered For example in Websphere MQ, It stores messages that arrived at the queue manager but the queue didn't exist goes to Dead Letter Queue

SUN MQ Terminology - Broker

message validation, message transformation and message routing Route messages to one or more of many destinations Transform messages to an alternative representation

JCAPS Terminology - Deployment Profile

A Deployment Profile contains information about how Project components are mapped and deployed within an Environment.

JCaps Terminology - OTD

OTD is Object type definition contains the structure and rules that define an object. Like type and structure of XML input coming into system is defined in DTD then it is OTD for input object

JCAPS Terminology - Projects

Projects solves business problems contains 1) Collection of logical objects, 2) Configurations, and 3) eWays (Connectors)

JCAPS Terminology - LogicalHost

Logical Host acts as a directory for the domains i.e actual runtime components. A domain is an instance of a Logical Host

JCAPS Terminology - Environment

Environment is where resources are deployed i.e collection of physical resources and configurations used to host project components/objects

It includes information about external system that interact with JCaps and Logical Hosts too
Environment have Integration Server like glassfish in which EAR's are deployed which basically contains business logic to run java collaborations and eWays(JCA-Connecters)

JCAPS Terminology - Java Collaboration?

Collaboration Definitions define how data should be processed
and routed between Project components,
how databases should be queried in response to requests,
and how APIs to one or more applications should be invoked.

JCAPS Terminology - Connectivity Map

Connectivity Map:
Contains Data Transmission mechanism having Code and Routing Information.

We add different objects to connectivity map like Topic, Queue, Service, Web Service, External Application etc.

All objects/components are linked using eWays which brings data from somewhere(Inbound) and sends data to somewhere(Outbound)





 




 


Monday, 28 January 2013

Alerter Interface and it's implementation in JCaps

Jar Name: com.stc.codegen.alerterapi
Interface Name: Alerter
Contents:
  public abstract void fatal(String paramString1, String paramString2) throws Exception;  
  public abstract void critical(String paramString);
  public abstract void major(String paramString);
  public abstract void minor(String paramString);
  public abstract void warning(String paramString);
  public abstract void info(String paramString);
  public abstract void custom(String paramString1, String paramString2, String paramString3); 

Jar Name: com.stc.codegen.alerterimpl
Class Name: AlerterImpl

Default Severity Level:
public void fatal(String msg, String componentName throws Exception
{
    sendAlert(msg, 0, componentName);

}
public void critical(String msg){
    sendAlert(msg, 1);

}
public void major(String msg){
    sendAlert(msg, 2);

}
public void minor(String msg){
    sendAlert(msg, 3);

}
public void warning(String msg){
    sendAlert(msg, 4);

}
public void info(String msg){
    sendAlert(msg, 5);

}
and also there is user defined custom severity 
javax.management.MBeanServer is invoked to run alerter

TypeConverter Interface and it's implementation in JCaps

Present in JAR: com.stc.codegen.utilapi
Interface Name: TypeConverter
Methoda Available:
 public abstract String shortToString(short paramShort, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String intToString(int paramInt, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String longToString(long paramLong, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String floatToString(float paramFloat, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String doubleToString(double paramDouble, String paramString1, boolean paramBoolean, String paramString2);
  public abstract short stringToShort(String paramString1, String paramString2, boolean paramBoolean, int paramInt);
  public abstract int stringToInt(String paramString1, String paramString2, boolean paramBoolean, int paramInt);
  public abstract long stringToLong(String paramString1, String paramString2, boolean paramBoolean, long paramLong);
  public abstract float stringToFloat(String paramString1, String paramString2, boolean paramBoolean, double paramDouble);
  public abstract double stringToDouble(String paramString1, String paramString2, boolean paramBoolean, double paramDouble);
  public abstract java.util.Date stringToDate(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract java.sql.Date stringToSQLDate(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract com.stc.otd.xsd.datatype.DateTime stringToDateTime(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract Date2001 stringToDate2001(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract Timestamp stringToTimestamp(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract String dateToString(java.util.Date paramDate, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String dateToString(com.stc.runtime.dt.DateTime paramDateTime, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String dateToString(com.stc.runtime.dt.Date paramDate, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String byteArrayToString(byte[] paramArrayOfByte, String paramString1, boolean paramBoolean, String paramString2);
  public abstract byte[] stringToByteArray(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract String bigDecimalToString(BigDecimal paramBigDecimal, String paramString1, boolean paramBoolean, String paramString2);
  public abstract String bigIntegerToString(BigInteger paramBigInteger, String paramString1, boolean paramBoolean, String paramString2);
  public abstract BigDecimal stringToBigDecimal(String paramString1, String paramString2, boolean paramBoolean, String paramString3);
  public abstract BigInteger stringToBigInteger(String paramString1, String paramString2, boolean paramBoolean, String paramString3);


Date2001 is XSD datatype available in com.stc.otd.xsd.datatype.Date2001

Present in JAR: com.stc.codegen.utilimpl
Class Name: TypeConverterImpl

CollaborationContext Interface and its implementation in JCAPS

Interface available in Jar Name: com.stc.codegen.utilapi.JAR
Interface name:  CollaborationContext


Brings the information of  JCaps project

Have four methods

  public String getCollaborationName();

  public String getDeploymentProfileName();

  public String getProjectPath();

  public String getConnectivityMapName();



Implementation Class avilable in Jar Name: com.stc.codegen.utilimpl.JAR
Class Name: CollaborationContextImpl
Brings data from InitialContext:
this.projectPath = ((String)context.lookup("java:comp/env/stc/context/ProjectPath"));
this.collabrationName = ((String)context.lookup("java:comp/env/stc/context/CollabrationName"));
this.deployName = ((String)context.lookup("java:comp/env/stc/context/DeploymentName"));
this.cmName = ((String)context.lookup("java:comp/env/stc/context/CMapName"));

Sunday, 27 January 2013

Change the JDK Path in Netbeans Startup

1) Open path \netbeans\etc
2) open file netbeans.conf
3)  Find netbeans_jdkhome folder:
#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"
netbeans_default_userdir=D:/caps/myproject/.netbeans/caps
netbeans_jdkhome=C:\Program Files\Java\jdk1.6.0_19
4) Just change it X-(