Search This Blog

Thursday, September 25, 2008

.Net Tips

1. C# tatorial - com / managed + unmanaged code , pinvoke
http://msdn2.microsoft.com/en-us/library/aa288436(VS.71).aspx

2. dump all method from dll
comand:
link /dump /exports c:\WINDOWS\system32\kernel32.dll

3. create dll introb for com object
e.g. :
tlbimp c:\windows\system32\quartz.dll /out:QuartzTypeLib.dll

4. Remote debugging setup is greatly simplified in Visual Studio 2005. All remote debugging scenarios except T-SQL debugging use the Remote Debugging Monitor (msvsmon.exe). The Machine Debug Manager (mdm.exe), previously required for some debugging scenarios, has been eliminated. In addition, msvsmon.exe now has a graphical user interface in place of the previous command-line interface
How to: Set Up Remote Debugging

Friday, September 19, 2008

Configure Network Tracing - in .NET

There is a very easy way to trace network traffic via .net framework.
you can follow this guide How to: Configure Network Tracing.

Wednesday, September 17, 2008

java to c++ bridge

Lately I looked for some information about mixing java && c++ , and I found some interesting information.
1. NoodleGlue an Open source solution - you can read about it here -> Bridging C/C++ and Java.you can download it from here JavaOSG Bindings.

2. Jace is a set of C++ and Java libraries and programs based on JNI that make it incredibly easy to write C++ code that integrates with the Java Virtual Machine (JVM). Jace is like Alphawork's easyJNI, but easier to use, with more features, and more power .

3. There are many solutions for bridging C++ classes in Java, you can read and compare the suggested solution here Urakawa Project f2f Report: Java - C++ Bridge .

Yaniv

Wednesday, September 10, 2008

WebSphere filter in version 6.1.0.0 Vs 6.1.0.17

The problem :
In Version 6.1.0.0 (before I set the path 17) , my web xml contains the next filter declaration
<filter>
<filter-name>WSConfigFilter</filter-name>
<filter-class>com.fis.infra.presentation.web.services.weblogic.filter.WSConfigFilter</filter-class>
<init-param>
<param-name>LoginWebService</param-name>
<param-value>GUIWebServices/services/LoginFacade?WSDL</param-value>
</init-param>
<init-param>
<param-name>PresentationWebService</param-name>
<param-value>GUIWebServices/services/PresentationFacade?WSDL</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>WSConfigFilter</filter-name>
<url-pattern>/Infrastructure/RTInfra/WS_Client/WSConfig.xml</url-pattern>
</filter-mapping>
We access to this file WSConfig.xml in the login ( maybe the first page/data from server) ,I would like to generate this file in the server.
On version 6.1.0.0 this filter get invoked as you ask this file , after I installed the patch (6.1.0.17) this filter is not invoked only after he found this page ( I create it manually ).

The Solution:
After digging in the web i came up with this problem from IBM PK33090; 6.1: A filter that serves a file does not popup an alert message
So you can follow the instruction how to add Webcontainer custom property , and add the relvant property to solved this issue:

1. In the administrative console, click "Servers" and under Servers click "Application Servers"
2. Click on the server to which the custom property is to be applied
3. Under "Configuration" and "Container settings" click "Web Container Settings" and under Web Container Settings click "Web Container"
4. Under "Configuration" and "Additional Properties" click "Custom Properties"
5. In the Custom Properties page, click "New"
6. “Name" = com.ibm.ws.webcontainer.invokefilterscompatibility “Value”= true .
7. Click "Apply" or "OK"
8. Click "Save" in the "Messages" box which appears
9. Restart the server for the custom property to take effect

and than i saw my filter get invoked as usual.

WebSphere tips

1. make sure you are using the latest java ibm version in your websphere application , its affect your application performance, you can find your ibm java version like this [websphereroot]/java/jre/java -fullversion

2. If you go to Application servers > server1 > Process Definition > Java Virtual Machine and checked the "Verbose garbage collection " check box , after restarting the server you can see all GC activities in server log directory under file native_stderr.log , to analyse this file you can download an IBM tool from here ->IBM Pattern Modeling and Analysis Tool for Java Garbage Collector

3. In the post i wrote before this one i mention how to get a full trace from your web sphere application , to analyse this trace you can use the next tool from IBM ->IBM Trace and Request Analyzer for WebSphere Application Server

4. To debug your deployed application on websphere follow the next steps:
in the admin console - Application servers > server1 > Process Definition > Java Virtual Machine checked the "Debug Mode " , by doing so the parameters that in the "Debug arguments" text box will be added to the server when restarting , usually the parameters looks like this "-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket, server=y,suspend=n,address=7777" , so after restarting your server open your Eclipse (in this case) and you just need to attach to a "remote java application" and put in the server name (where the websphere server is running ) and the port number you set/have from the address (i.e. 7777), and pray :)


5. very good article about java performance on AIX you can find here Maximizing Java performance on AIX

6. here are some WebSphere Tuning links
WebSphere Tuning Tips

WebSphere tuning for the impatient: How to get 80% of the performance improvement with 20% of the effort

Tuning performance

Java virtual machine settings

DB2 tuning parameters

Solving memory problems in WebSphere applications

Monday, September 8, 2008

Trace configuration for Web Sphere

Here are some instruction i get from IBM , to make a full trace to my application .
1) Trace the application flow from application server startup (for this you will require to setup the application and also WebSphere to use datasources).

Please use the following trace String:
*=info:com.ibm.ws.webservices.*=all:WAS.j2c=all:RRA=all:WAS.database=all:Messaging=all:JMSApi=all:Transaction=all

See instructions below for tracing setup:
1. In the Application Server Administrative Console, expand Troubleshooting and select Logs and Trace.

2. In the Logging and Tracing page, select your server and then Diagnostic Trace.

3. Ensure that Enable Log is selected.

4. Under Trace Output, select File, and accept the defaults.

5. Click OK and save your configuration.

6. Again, expand Troubleshooting and select Logs and Trace.

7. In the Logging and Tracing page, select your server and then Change Log Detail Levels.

8. Enter the following trace string:
*=info:com.ibm.ws.webservices.*=all:WAS.j2c=all:RRA=all:WAS.database=all:Messaging=all:JMSApi=all:Transaction=all

NOTE: Please ensure you have setup at least 10 historical files of at least 50 MB each to ensure the whole test is captured from startup.
..
you can see the trace.log file under your your log directory .

Wednesday, September 3, 2008

DB2 JDBC Driver Secrets

i found a very nice blog that describe some JDBC tips for db2 .
http://www.db2ude.com/?q=node/75

and some more tips with Query optimization in DB2 using REOPT
http://www.db2ude.com/?q=node/73

enjoy

Tuesday, September 2, 2008

WebSphere usefull links for tips

Some useful links to a very common questions , while starting with IBM WebSphere Application server , that i get from IBM stuff

1. Web Sphere profiles / Servers
a. What is a profile , how to manage/create/control servers

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tpro_profiles.html

b. Control servers via Command line

You can explor the commands
under \installDir\Profiles\myProfileName\bin


For example, to start server1
through the command line I'm running the startserver server1 from the next
directory

C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\bin


c. Servers logs
\installDir\Profiles\myProfileName\logs\AppServerName

For example, the full path for
the log files under my profile is

C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\server1


d. Administration console.
To access the admin console:
Start->Programs->IBM WebSphere->Application
Server V6.1->profiles->profileName->Administrative Console


http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/welcadminconsole.html

e. Is there a node manager.

The WebSphere ND (Network Deployment)
product enables you to manage nodes

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tagt_svr_conf_nodes.html

f. 1-N servers
in one profile and how to control each one .

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tpro_profiles.html

2. WEB Sphere File
architecture, main configuration file names.

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tcfg_data.html

3. Control the start-up
parameters (-DXXXX=YYYY ) , adding custom parameters.

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_app_startup.html

4. Adding application
specific parameter (environment variable )

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tcws_variable.html

5. Supported JVM version – how to change the JVM version if needed.

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/urun_rconfproc_jvm.html

6. Eclipse and Web
sphere - how to debug deployed application


http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/ttrb_debugwsa.html

7. Create Data source name (connection pooling)

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tdat_tccrtprovds.html

8. Performance tips and tricks

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/welc6toptuning.html

9. Deployment issues,
export web services via Web sphere .


10. Deploy software on
web sphere

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_appl.html

11. Apache web With Web sphere integration.
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/twsv_plugin.html

I hope I wrote all the necessary things .