Beefing up my Tomcat like a Muscle Car

Here is my ultimate VM Options list for any Tomcat server I utilize.

-XX:MaxPermSize=512m -Xms512m -Xmx512m -Xss256k -XX:ReservedCodeCacheSize=512m

Pop this in before start up and one is virtually ensured not to experience any out of memory or perm gen space issues.

“Code on, and code strong”

Advertisements
Posted in Apache, Tomcat | Tagged , , | Leave a comment

Working from home today, my train didn’t make it into the office

Turns out it was a paint truck that we hit, but it sure did look like egg salad when we were plowing through it.

13-TruckAfterTrainCrash 12-CrossingAfterTrainCrash 11-LastCarOfTrain 10-TruckAfterTrainCrash 09-TruckAfterTrainCrash 04-FirstCarOfTrain 05-TruckAfterTrainCrash 06-TracksAfterTrainCrash 07-TracksAfterTrainCrash 08-TracksAfterTrainCrash 03-FirstCarOfTrain 02-FirstCarOfTrain

Image | Posted on by | Leave a comment

Version Source Control – Poll

Posted in Uncategorized | Leave a comment

Source Control in its lowest form

visual-sourcesafe

vss_doodoo

What kind of Source Control is this community using? I’ll create a poll soon to see what us modern day developers are using. Stay tuned and stay checked in.

Posted in Uncategorized | Leave a comment

Calling a .NET C# Web Service with a Java/JSP Client

Netbeans and Apache Tomcat are used in this example to make a JSP client with the help of Apache SOAP toolkit (http://axis.apache.org/axis/). Assumption here is that you are bit familiar with JSP and NetBeans. Also, Apache Xerces (http://xerces.apache.org/) is used by the Java Client. The following jars are needed to run the Java Client successfully.

a)    activation.jar
b)    mailapi.jar (version 1.3 or later)
c)    soap.jar (version 2.1 or later)
d)    xercesImpl.jar (version 2.1.1 or later)
e)    xml-apis.jar (should come bundled with the Apache Xerces download)

  1. Click on File–>New Project –>Choose “Java Web” –>Web Application07-CreateNewNetBeansWebApp
  2. Provide a Project Name and Location08-NameNetBeansJavaWebApp
  3. Set up Server Settings and then click on “Next”09-PickJavaWebAppServer
  4. Disregard a Web App Framework for this tutorial and click on “Finish”10-DeclineFrameworkSelectionAndFinish
  5. Right click “Source Packages” and select “New”  Java Package11-newjavaPackage
  6. Name the package and click on “Finish”12-NameNewJavaPackage
  7. Reviewing our Java Client Web Application, the directory structure should look similar to this:13-JavaClientProjectStructure
  8. Right click the Java Web App project and select “Properties” from the menu14-JavaProjectProperties
  9. In the Project Properties window select “Libraries”. Click on “Add JAR/Folder” button15-Properties-Libraries
  10. Add activation.jar, mailapi.jar, soap.jar, xercesImpl.jar, and xml-apis Libraries to the Project16-AddTheWebServiceClientJarFiles
  11. Right click the JavaClient Project and select “New” –> Web Service Client…17-CreateNewWebServiceClient
  12. Configure the Web Service Client by Adding a WSDL URL (From .Net Web Service Step #7, paste the copied URL into the “New Web Service Client” WSDL URL field. Also, specify the package we created earlier to contain the generated java artifacts that will be created.18-ConfigureWebServiceClient
  13. After clicking on “Finish”, NetBeans will output information regarding the generated java artifacts. Aim for a “BUILD SUCCESSFUL” message19-NewWebServiceClientOutput
  14. Now that our Web Service Client has been created, go to the default NetBeans Java Client Web Application start page (index.jsp in this example) and right click within thetag. Select “Web Service Client Resources” –> Call Web Service Operation…20-CreateCallWebServiceOperation
  15. Select the appropriate Web Service. Here we will go with “WebService” –> WebServiceSoap –> HelloWorld21-SelectWebServiceOperationMethod
  16. After clicking “OK”, NetBeans will auto-generate a snippet of code and inject that code within the jsp file.22-WebServiceOperationCodeInjection
  17. Running the Java Client will result in a successful call to the ASP .NET C# Web Service that we constructed earlier. One can see that the Result string matches the return value of the HelloWorld() method of the ASP .NET Web Service23-RunNetBeansJavaClient
  18. The DotNetWebService.HelloWorld() Web Method returns the string value that the Java Client Web App did. Great work!24-MatchingDotNetAspWebServiceCode

This concludes the 2012 ASP .NET C# Web Service to Java Client consumption tutorial. May your Objects, Access, and Protocols be Simple and may your Web Services be RESTful for the next episode.

Posted in Java, Tomcat, Web Services | Tagged , , , , , | 3 Comments

Creating an ASP .NET C# Web Service

In this edition, we shall experiment with some cross platform dynamics. The goal of this 2 part series is for Java to talk to other platform web services. Sometimes as a java coder, you run into some web services that are done in WCF/SOAP. Rather than throw in the towel and quit, let’s figure out a way for them to communicate with each other.

First let’s venture over to the dark side and create a .NET C# Web Service.

Visual Studio automatically creates the necessary files and includes the needed references to support an XML Web service, to create a web services in C# in Visual Studio.NET.

  1. On the File menu. File->New->Project. 00-VisualStudioFileNewProject
  2. In the New Project dialog box, select the visual C# Projects folder. Select the ASP.NET Web Application icon. 01-NewVisualStudioWebApp
  3. Enter the Name of the Web Application and click OK to create the project. The New project will appear in the Solution Explorer. 02-DotNetWebServiceSolutionTree
  4. Right click the project name in the Solution Explorer, click “Add”, and then click “New Item” 03-SolutionAddNewItem
  5. Within the “Add New Item” screen, select “Web”, and then scroll down to select the “Web Service” item. Give the Web Service a meaningful name and then click “Add” to continue. 04-AddWebService
  6. Specify the properties to WebService attribute. The namespace property you specify is used within the WSDL document of the Web service to uniquely identify the callable entry points of the service. Name is service name to display in help page. Description property of this attribute is included in the Service help page to describe the services usage. As shown in example here:Comment out or replace the default
    [WebService] entry: [WebService(Namespace = "http://tempuri.org/")]With our new entry

    [WebService(Namespace = "http://WebService", Name = "WebService", Description = "Test WebService by Johnny Coder")]

    Also, one may edit the HelloWorld() return string to anything unique for this POC test. 05-EditWebServiceFile

  7. Run/Debug the Visual Studio Solution Project (F5) and the functional WebService default page should show up. Clicking on the “Service Description” link will send us to the URL which will be used later in the NetBeans Java Client portion of this tutorial. 06-RunWebServiceSolution
  8. The Service Description URL should be copied and pasted for later.06a-ServiceDescriptionURL
  9. Now our web service is complete and ready to serve clients. We can consume the service from Java – stay tuned for the next episode in this series regarding cross platform Web Services and consuming clients -May your Objects, Access, and Protocols be Simple and may your Web Services be RESTful for the next episode.
Posted in .NET, Microsoft, Web Services | 2 Comments

NO Coding, Hoboken Flooded

WelcomeToHoboken

hoboken-ferry-terminal lackawannaRR-121029-hurricane-sandy-07_grid-8x2 lackawannaRR-andStatue villagePourhousefirstStreet-Hoboken

Image | Posted on by | Leave a comment