Posted by: peteinman | December 10, 2009

I Wonder

I wonder if anyone uses the RSS feed to this blog?

Posted by: peteinman | December 10, 2009

Essential Development Tools

This is a list of development tools that, personally I think are essential in Java development.

I’m not saying that they’re the only tools around which do the same job, but they’ve certainly made my life easier over the past year.

1) Subversion

Coming from a VSS environment, SVN was heavenly. If you’re still using VSS, dump it and move, it’s superb.

2) JIRA

Fantastic system, and much better than excel for managing faults!

3) Maven

Simplified and standardised our build process from a custom built ant + JBuilder system which has removed the dependency on individuals to support the build process.

4) TeamCity

Brilliant – it really does work in about 20 minutes. There are other build servers, but this was easy to set up. Configure the builds and forget it. Simply brilliant.

5) IntelliJ

Same standard as TeamCity – brilliant. Fast IDE and perfectly suited to Java development. We did use eclipse but found long pauses in the IDE a problem whilst it was doing something and we haven’t had that in IntelliJ. Eclipse could give bad results as we’re running on Vista, which seems to be pretty rubbish anyway.

IntelliJ isn’t free for commercial projects, but it’s not expensive either – and it works.

Posted by: peteinman | December 9, 2009

WebLogic 11g Debug Flags

In WebLogic 8.1, debug flags were available to be set either manually in the config.xml directly, JVM start arguments or via mbean calls using weblogic.Admin.

Some of these debug settings were pretty hard to actually find and pretty cryptic.

I just found out that in 11g, most of the debug options (if not all) have been made available in the WebLogic console.

Simply select Domain|Environment|Servers|ServerName

Then click on the Debug tab

image

Select the flag you want and press the enable/disable button.

You can also do this in WLST, but for a quick setting this is simple.

Brilliant.

Posted by: peteinman | December 8, 2009

WebLogic 8.1 Web Service Migration

Whilst in the process of migrating our application from WebLogic 8.1 to 11g, I hit a problem with web service authentication.

We have two web services running which are generated by using servicegen up against a pojo.

Security for the web service is defined in the web.xml deployment descriptors as follows

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
   <security-constraint>
      <web-resource-collection>
      <web-resource-name>MyWebService</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>         
         <role-name>BasicTestUser</role-name>
      </auth-constraint>
   </security-constraint>
   
   <security-role>
      <description>Test User</description>
      <role-name>BasicTestUser</role-name>
   </security-role>
</web-app>

 

That’s all you need – allegedly for it to work on WLS 8.1, and this works for us quite nicely.

When I migrated this application to WLS 11g, Oracle state that everything should function in 11g as it does in 8.1, but we had a huge problem with authorisation and were getting a 403 – Forbidden error as below.

javax.xml.rpc.JAXRPCException: weblogic.webservice.util.AccessException: The server at http://127.0.0.1:7001/MyWebService/MyWebService returned a 403 error code (Forbidden). Please ensure that your URL is correct and that the correct protocol is in use..

After lots of investigation using security debug flags, removing some of my web service code in case my JMX code was causing it to fail, I found that I needed to add another entry into weblogic.xml as well as web.xml.

Now, this is documented and shouldn’t be a surprise, but as it was working quite happily in WLS 8.1 and have no compatibility errors when deploying on 11g, I didn’t expect it.

I had to make my weblogic.xml like this and map the role into an actual principal.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
    <security-role-assignment>
        <role-name>BasicTestUser</role-name>
        <principal-name>TestUser</principal-name>
    </security-role-assignment>
</weblogic-web-app>

Sorted.

Posted by: peteinman | December 8, 2009

IntelliJ – Debugging with WebLogic 8.1

Here’s how to set up the debugger with IntelliJ so that you can debug applications whilst they are running inside the app server.

In this case, I’m looking at WebLogic 8.1, but WebLogic 11g works in the same way.

1) JVM Debug Port

The first thing you need is a debug port configured no the JVM you’re going to attach a debugger to.

IntelliJ further down will give details of the JVM configuration options you need, but these are also here

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

They should be added to the JVM arguments used when starting the server.

2) Configure IntelliJ

The next thing which needs to be done is to tell IntelliJ what application server you’re using and what port to connect to.

From the IDE, select Run|Edit Configurations

image

Then click the image sign at the top of the screen

image

Select the “Remote” option

image 

In this screen, name the configuration something like WebLogic81 for example

image

and leave everything else as default options. This assumes a debug port of 5005.

3) Debugging

With the project loaded into the IntelliJ IDE, click in the “margin” to add a breakpoint as shown below

image

Now, click on the debug symbol to the right of the run configuration on the toolbar

image

The run dialog should be displayed, click the debug button and then run the application. You should have a window at the bottom of the IDE which shows

image

As soon as your code hits the breakpoint, the debugger will be invoked and you will have access to the normal debugging facilities.

Posted by: peteinman | December 2, 2009

Oracle Service Bus – fn:tokenize

If you have a string, such as a file name which looks like

“FileName.txt”

How do you get the filename without the extension?

Use the following XQuery function

fn:tokenize(‘FileName.txt’, ‘\.’)[1]

That function will get the first element of the tokenized array.

Note that the escaped “.” is important otherwise you won’t get anything returned.

fn:tokenize(‘FileName.txt’, ‘\.’)[last()]

will return the last element, in this case “.txt” and you can also do last()-1 to get the previous element.

Posted by: peteinman | July 21, 2009

TCP TIMED_WAIT

Set this to 30s on the IIS servers and LPD server

http://msdn.microsoft.com/en-us/library/ms819739.aspx

The TcpTimedWaitDelay registry value under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

key can be used to alter the default setting.

Windows Server 2003 TCP/IP allows this value to be set as low as 30 seconds, which should not cause problems in most environments, or as high as 300 seconds.

Posted by: peteinman | June 10, 2009

Fame

I finally become …urrm, sort of famous!

http://www.ca.com/us/success/collateral.aspx?cid=205354

Posted by: peteinman | June 4, 2009

Configuring WebLogic ISAPI Plug-in On IIS 7 (Vista)

I thought this task was going to be harder than it actually was. I always found configuring the plug-in on IIS6 a bit hit and miss so expected more issues with IIS7.

I’ve not done this on any server products yet, so this is just on Windows Vista Business SP2.

Install ISAPI Filters Module on IIS

The first thing you need to do is ensure that you have installed the ISAPI filters module on IIS as per the details here: ISAPI Filters Module Installation 

Just go down to the “How To” section of that page.

IIS Configuration

When you start the IIS configuration manager in Vista, you should end up with a screen which looks something like this, with the two new shortcuts for ISAPI configuration

image

These two!

image

You should have a default website enabled, and I’m going to assume that you want to proxy ALL requests which hit this IIS server through to a WebLogic server.

I’m also going to assume that you have a working IIS proxy configuration on an older version of IIS and are just moving to 7 as I don’t want to get into the nuts and bolts of configuring the IIS proxy!

The first thing I did was to set the home directory for my “Default Web Site” to be a folder where my iisforward.dll, iisproxy.dll & iisproxy.ini files were located. For this article I will assume this folder is c:\domains\iisplugin.

You get to this using the following screens using the right-click.

image

Select the advanced settings option and then set the property “Physical Path” to something like

image

Now, select the default web site and double click on the ISAPI Filters shortcut

image

You’ll be presented with an empty list. From here, if you right click and select Add, you’ll get the following.

image

Enter the following:

Filter Name: wlforward

Executable: c:\domains\iisplugin\iisforward.dll

Once that’s done, go back to the default website home, so you get the following screen

image

Double click, Handler Mappings and you’ll see something like this

image

From this screen, if you right click and select “Add Script Map”

image

you’ll get a screen as shown

image

Enter the following:

Request Path: *.wlforward

Executable: c:\domains\IISPlugin\iisproxy.dll

Name: IIS Proxy

You should then get a dialog box displayed which you should answer YES to.

image

Once you’ve done that, restart IIS and provided that the iisproxy.ini file is configured correctly, you should be able to access your weblogic server application.

That’s it!

Posted by: peteinman | January 30, 2009

Deployment Error NoClassDefFound

I had this today and I’ve had it a few other times when deploying an application on Weblogic 8.1.

java.lang.NoClassDefFoundError: org/apache/oro/text/perl/Perl5Util

A bit of a weird error as the application looked like it deployed, but actually failed.

What this turned out to be was a missing ANT folder.

I’d had a compatibility issue between WebLogic 8.1 and ANT 1.7 which meant I had to rename the ANT directory in the WebLogic distribution.

Anyway, putting “c:\bea\weblogic81\server\lib\ant” directory back solved it.

« Newer Posts - Older Posts »

Categories