Thursday, April 18, 2013

What is SAP JCo and where can i get it ?


Setting up a SAP connection

This section describes how to set up a SAP connection, if you plan to develop mobile applications using the SAP framework.
To set up the SAP connection you must:
·  Configure the SAP connection using the SAP Java Connector (SAP JCo). SAP JCo is a toolkit that allows a Java application to communicate with any SAP system. The SAP Java Connector can be downloaded from the SAP Service Marketplace Web site by a registered SAP customer.

Configuring the SAP Java connector
1.     Open a Web browser window and enter the SAP Marketplace URL, which currently is:
2.  https://websmp204.sap-ag.de/swdc or  http://service.sap.com/connectors --> SAP Java Connector
The Client Authentication window displays.
3.     Select the certificate to use when connecting, and click OK. The Enter Network Password window displays.
4.     Enter your registered SAP customer user name and password in the User Name and Password fields, and click OK. The SAP Software Distribution Center window displays.
5.     In the You Are Here navigation bar on the left side of the page, navigate to Download | SAP Connectors | SAP Java Connector | Tools and Services. Click the link for SAP JCo Release 3.0.X to download the SAP Java Connector.
6.     Follow the installation instructions provided by SAP. When prompted, copy the .jar and .dll files to these locations:

Configuring the SAP environment for Eclipse Studio

To configure SAP Environment for IDE   Copy the following files from the SAP installation and place them in <JDK_Installation_Path>/jre/ lib/ext folder:
  1. sapjco3.dll
    sapjco3.jar
    Note: If you have a Windows OS, copy the sapjco3.dll file. If you have a Linux or Unix environment, copy the sapjco3.so file.

  2. Modify the config.ini file and add the following line at the end of the file:
    osgi.parentClassloader=ext
    This file is available at <Eclipse_Installation_Path>/configuration.

      Incase of Mac OS, keep sapjco3.dll and libsapjco3.jnilib files in the java/extensions folder.
  1.     Restart Eclipse. 



Identifying deadlocks in your Eclipse RCP

Add following parameters in eclipse.ini file


-Dcom.sun.management.jmxremote.port=1436 <any free port>
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false


Open  JConsole.exe: which can found in the following directory
C:\Program Files (x86)\Java\jdk1.6.0_31\bin


Enter the remote host and port details:
localhost:1436

We can find the thread details in Thread section.




Tuesday, April 16, 2013

Your eclipse is 32 or 64 bit ??



How can I find out if a specific Eclipse instance on my (Windows 7) PC is the 32-bit or 64-bit version?

Windows Task Manager Dialog:
Hit ctrl-alt-delete, open up task manager - look at the processes tab. 32-bit programs should be marked with a *32

eclipse.ini file:
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222

And also you can find in
Eclipse SDK Installation Details:> Configuration page

Monday, April 15, 2013

Order of Tags in Java comments




Order of Tags
Include tags in the following order:
  • @author (classes and interfaces only, required)
  • @version (classes and interfaces only, required.)
  • @param (methods and constructors only)
  • @return (methods only)
  • @exception (@throws is a synonym added in Javadoc 1.2)
  • @see
  • @since
  • @serial (or @serialField or @serialData)
  • @deprecated 

Tuesday, April 2, 2013

GIT: showing only list of modified files in a commit


git show --pretty="format:" --name-only  6773e94744fd6885f0737655e491f075afb8c80a

Output:

trunk/guieditor/src/com/pat/tool/keditor/editors/SAPServerDetailsDialog.java
trunk/guieditor/src/com/pat/tool/service/model/SAPServer.java
trunk/guieditor/src/com/pat/tool/service/model/SAPServerUtil.java

Tuesday, March 26, 2013

The protocol of IProgressMonitor


Very nice write-up on this:
http://www.eclipse.org/articles/Article-Progress-Monitors/article.html
http://www.eclipse.org/articles/Article-Progress-Monitors/article.html#Ensure_to_always_complete_your_monitor


One contract pattern described above is that if beginTask() is ever called, done() MUST be called. This is achieved by always following this code pattern (all code is simplified):
monitor = … // somehow get a new progress monitor which is in a pristine state
// figure some things out such as number of items to process etc…
try
 {
 monitor.beginTask(…)
 // do stuff and call worked() for each item worked on, and check for cancellation
 }
finally
 {
 monitor.done()
 }

Tuesday, March 19, 2013

Javascript functions and difference



The two ways to declare a java script function:
var functionOne = function() {
    // Some code
};
function functionTwo() {
    // Some code
}


The difference is that functionTwo is defined at parse-time for a script block, whereas functionOneis defined at run-time. For example:
<script>
  // Error
  functionOne();

  var functionOne = function() {
  }
</script>

<script>
  // No error
  functionTwo();

  function functionTwo() {
  }
</script>