GlassFish Training Offer

For a long time I haven’t written a word here… The main reason is I was moved to a new project and am so busy I simply don’t have time to describe solutions to problems I’ve been facing. This project is again not Java based - .Net.

To be honest, I haven’t written anything serious in Java for almost a year! And my last work in Java EE was at the end of university times (even the name was different - it was J2EE then!). Maybe that’s why GlassFish Training Offer by Sun sounded so attractive, even more because there are a few training courses available at that link totally for free!.

Just to refresh my knowledge around Java EE I went through course titled GlassFish Application Server: Introduction (WMT-SAS-1536). It took c.a. an hour to complete it by reading slides and listening to Text-To-Speech lecture. All in all it was quite funny to ‘take part’ in a course at home, in the evening, sitting in the armchair next to my wife watching a movie :)

Course attendee :)

Course attendee :)

Should you have some free time and a little of willingness to learn, I advise going to GlassFish Training Offer by Sun, learning how to register to attend free courses, and doing it yourself!

How to always open a new page in a new window with JavaScript?

In order to always open a new page in a new window you can employ window.open function of JavaScript:

window.open(URL, UNIQUE_TITLE, WINDOW_FEATURES)

Note: If you have a number of links that use this JavaScript snippet and want to open each of them in a separate window remember to set UNIQUE_TITLE to a unique string for each of them. If those strings are the same, the new window will be created only once and it will be reused every time you click such link.

How to configure log4net on SharePoint?

Recently I had to add logging feature to the SharePoint project I’ve been developing. I had to use log4net. I followed my friend’s advice but for some reason it wouldn’t work in my case. I didn’t get any errors or exceptions. Simply nothing was logged to the file, which by the way would not be even created. All in all it looked like a problem with applying the configuration from log4net.config. Indeed, when I looked at the logger object if it’s been configured (log.Logger.Repository.Configured) and it said false.

It turned out the log4net.config was deployed in a wrong location. Apparently, it should be placed there: C:\Inetpub\wwwroot\wss\VirtualDirectories\80.

Reblog this post [with Zemanta]

Exception - ORA-00604: error occurred at recursive SQL level 1 ORA-01003: no statement parsed

In my application data were collected from database (Oracle) using web services that called stored procedures. One of the stored procedure had SELECT defined similar to the one below:

WITH sth1 as
(
	SELECT ...
),
sth2 as
(
	SELECT ...
)
SELECT ...

This construction was the reason why in my application I was getting the following exception while invoking that web service:

Exception - ORA-00604: error occurred at recursive SQL level 1 ORA-01003: no statement parsed

Solution

The simplest solution for that is to create tables representing sth1 and sth2 created with WITH clause. Then instead of using WITH truncate those tables and fill with data. Finally query against them in the main SELECT.

Updated, 2008-10-22
It turns out if you use a regular table, you may have some problems with multiple calls to the stored procedure - the second call could overwrite the first call’s data with a second call to truncate.
Therefore use either:

Reblog this post [with Zemanta]

CV updated

After some time I’ve updated my CV (in English and Polish). In short, this is what has happened in the meantime:

  • I was responsible for implementation of a part of the internal service for a subsidiary of Northern Ireland Electricity (ASPX on SharePoint)
  • I was part of the team who created for an Irish customer a complete online planning solution (MonoRail, JavaScript, C#, Reporting Services, SQL Server 2005, ActiveRecords)
  • I passed Sun Certified Java Programmer (2008), result: 94%
Reblog this post [with Zemanta]

FeedBurner statistics

It was only today (after “a while”) when I realised I don’t trace statistics related with feeds (RSS). I decided to change it. Going forward, I installed FD Feedburner Plugin which redirects my standard link to RSS for posts to the link handled by FeedBurner.

Please help me keep the accurate statistics!

If you subsrcibed for the RSS for this blog some time ago (before today), please unsubscribe and then subscribe again. That will allow me to see how many people read what I’m writing here.

I’d appreciate your committment.
Thank you in advance.

Best regards,
Jaroslaw Dobrzanski

Reblog this post [with Zemanta]

Problems with UpdatePanel on SharePoint

If you want to add some AJAX flavour to your ASPX pages running on SharePoint you need to perform a few actions:

  • install ASP.NET AJAX on servers in your farm
  • extend SharePoint web.config file with Microsoft ASP.NET AJAX
  • add ScriptManager either in the master page you’re using (prefferable) or in all pages that employ AJAX

The above listed steps are well described in the following article: Integrating ASP.NET AJAX with SharePoint.

However, at the end of the day you may (and probably will) end up with some problems during development. In short, not all works as it’s supposed to and how it does in a regular web project. One of the issues I had recently was UpdatePanel which made my page not working after a while.

Basically, I had an ASPX with some controls that had event handlers assosiated with them (e.g. buttons with onclick’s). There too was an UpdatePanel which was triggered by an event, let’s say “Click” perfomed on a button. This event made the UpdatePanel reload, BUT ONLY FOR THE FIRST TIME. Once reloaded, none of the handlers assosiated with any of the controls on the page worked.

I did a lot of googling but finding the answer was not that easy. Finally my friend gave me the link to this article. The solution is described in section “Using UpdatePanels within SharePoint”. The author suggests to add this JavaScript code to the page:

<script type="text/javascript">
    _spOriginalFormAction = document.forms[0].action;
    _spSuppressFormOnSubmitWrapper=true;
</script>

Parser Error Message: This page allows a limit of 200 controls, and that limit has been exceeded.

By default, web.config of SharePoint (should be there: C:\Inetpub\wwwroot\wss\VirtualDirectories\80) defines the maximum number of controls as 200. Should you define more on a page you’ll probably get an error similar to this:

Solution

In order to fix it, edit this web.config. Find configurationSharePoint\SafeMode tag and change the MaxControls attribute to a bigger number. Once you do this, reload the page. It should help.

Sun Certified Java Programmer - finally

Time went fast since my declaration. I didn’t have much time and willigness to study but I gained them recently and finally did it: from today morning I’m a Sun Certified Java Programmer. The score: 94%.

If you’re planning to take it too, I wish you luck.

The feature name XXX already exists in SharePoint. You need to rename the feature before solution deployment can succeed.

From time to time when I try to deploy a SharePoint project from Visual Studio 2005 I’m getting this error:

The feature name XXX* already exists in SharePoint. You need to rename the feature before solution deployment can succeed.

Solution
Whenever I get this (annoying) error I go to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ and remove the directory named XXX*. Sometimes then I need to restart Visual Studio or even log off and on again (on my Windows account).

17/102008
Sometimes restarting Visual Studio does the job.

* is the name of the module that should be deployed

Reblog this post [with Zemanta]