welcome to my blog !

My name is Aleksey Maksimov. I am Software Architect with many years of IT experience and architecture experience. I work for a global IT consulting company and live in the United Kingdom. This is my software rants blog. I also have blog about my life happenings, in Russian. I also registered in almost all social networks, usually as ctpeko3a, sometimes as lechat and rarely as drunkenfly. Here is my FriendFeed and View my profile on LinkedIn.

May 08 2009

VMWare DHCP service wont’start – SOLVED

Tagged Under : , , ,

I use VMWare to run a bunch of different Linux VMs on my home PC, which is running Vista SP1. Today I encountered strange thing: Linux VM won’t get an IP address from VMWare DHCP. I’ve opened VMWare Virtual Networks management console (as Administrator, of course, or it won’t let you make and save any changes) just to find out that DHCP service is not started. I tried to start it from there, but it failed to do so.

So I went to Vista Services console and tried to start “VMWare DHCP service from there”. Again, failed to start with no explanation, even cryptic one. So I went to Windows Events viewer and there, under Windows Logs-System, I found a lot of messages from VMNetDHCP:


The description for Event ID 2 from source VMnetDHCP cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Can’t open C:\ProgramData\VMware\vmnetdhcp.conf: Access is denied.

/ The data is invalid

the message resource is present but the message is not found in the string/message table

Though the message says that the message is not found, it has enough information to fix the problem.

So, I’ve taken a look at the security properties for C:\ProgramData\VMWare folder and found that SYSTEM account somehow is not in a list of permitted users. The only account, who was permitted to access that folder, was my Windows user account. So I added SYSTEM account with all permissions to this folder, waited when Windows propagated my change to all files and tried to start VMWare DHCP service again. It worked!

Then I simply restarted network within Linux VM (sudo /etc/init.d/networking restart) and got back to work.

May 07 2009

JBOSS Seam 2.1.1GA on JBOSS AS 5.0.1GA: Table is not mapped

Tagged Under : , , , , , ,

I created sample JBOSS Seam project in Eclipse and decided to generate entity code from  existing database. It worked fine, but when I try to run it, it shows me that Hibernade is not able to map entity beans to the corresponding tables. The error message is like this:

org.hibernate.hql.ast.QuerySyntaxException: <your table> is not mapped

I spent around three hours trying to read all available information on it, but most of it just useless – it looks like people don’t know whats happening, so they recommend bizarre tricks. Like, for example, having empry seam.settings file in each folder, meh.

Finally, I found the solution in Seam Jira: https://jira.jboss.org/jira/browse/JBSEAM-3821

They rocemmend to to force Hibernate to use Seam’s EntityManager by changing two files:

1. components.xml

    <persistence:entity-manager-factory name="bookingDatabase" installed="false"/>
    <!– If Seam loads the persistence unit (JBoss 4.x), the EntityManagerFactory will be resolved from #{bookingDatabase}.
         On JBoss AS 5, the EntityManagerFactory is retrieved from JNDI (the binding occurs during application deployment). –>
    <persistence:managed-persistence-context name="em" auto-create="true"
       entity-manager-factory="#{bookingDatabase}" persistence-unit-jndi-name="java:/bookingEntityManagerFactory"/>

2. persistence.xml

<!– Binds the EntityManagerFactory to JNDI where Seam can look it up.
              This is only relevant when the container automatically loads the persistence unit, as is the case in JBoss AS 5. –>
         <property name="jboss.entity.manager.factory.jndi.name" value="java:/bookingEntityManagerFactory"/>

Hope that Google will find that page and the proper solution would be much more easily found!

October 28 2008

Trying Team Concert build system

After yesterday’s success in installation of Team Concert, I went through the “Do and Learn” tutorial. The amount of new information and, especially, new views in IDE, is overwhelming! Though the tutorial tries its best to guide through sample project, it would take my time to digest the information. So far, I managed to get through it, but have been stuck on building my HelloWorld application.

The problem is that freshly created build engine, named “HelloWorldEngine”, telling me that Jazz Build Engine is not yet connected to repository. But in another window jbe.exe process is connected and waiting for builds.

I restarted jbe with –verbose parameter to see what it does, but this resulted in only one additional line to be displayed: “2008-10-28 12:16:42 [Jazz build engine] Not using a proxy to reach https://localhost:9443/jazz/” I would expect it to be more verbose that that. Perhaps it needs to tell me something more about which build engine id it tries to use…

And build engine id is exactly my problem here. By default jbe is going to use “default” build engine, not my “HelloWorldEngine”. There is parameter, which is not mentioned in tutorial, but mentioned if you try to run jbe.exe:

-engineId <engine id>   (engine id of a build engine defined in the Jazz repository, default is "default")

Once I started jbe with proper parameter – my build was fired off.

And first one was a failure:

com.ibm.team.build.internal.engine.InvalidPropertyValueException: CRRTC3512E: The location "C:\java\jazz\buildsystem\buildengine\eclipse\fetched\ScrumProject\build.xml" referenced by property "com.ibm.team.build.ant.buildFile" does not exist.

This is because I named Team Concert project “ScrumProject”, but in Java perspective I followed HelloWorld cue card and named my Java project “HelloWorld”. The build system was puzzled to find it. Team Concert Tutorial says this:

13. In the Build file field, type the following path: fetched/projectname/build.xml, where projectname is the name of your Jazz project.

This is not exactly the truth. This should have the name of my Java project.

So I went and fixed the project name in Ant tab. Requested the build and, voila, it builds!

Now its time to create new project, which will do something bigger, than printing “Hello, World!”

October 27 2008

Trying Rational Team Concert

Image representing IBM as depicted in CrunchBase

Image via CrunchBase

After rave reviews from my coworkers, who seen the IBM presentation, I decided to give it a try on my local machine. As it usually happens with IBM beta software, the expectancy of it working is close to zero. Let’s give it a try this time, could it be better?

First, I headed to http://jazz.net/ to download software. The server, obviously, managed by IBM marketing department, requires to register. Usual IBM ID is not supported, so I had to give IBM my email once again.

Since I only need a software for basic trial, I decided not to download version, which supports DB2 and Oracle databases. There is no support for MySQL either, but at least they promise to include Derby in setup package. So I pointed that I want Windows installation and found that download size is about 400Mb, and there is no IBM Download Manager (which I hate) to be seen.

So I downloaded and unpacked everything to my hard drive. I am on Windows and Windows users are used to find setup.exe, which does installation of the software for you. There is no such thing here: only install_express_c.html file, which describes step by step installation procedure for both Windows and Linux. Why Linux if I specifically stated that I want Windows installation?

First step says that I have to navigate to Tomcat’s folder and then run server.startup.bat file. There is no such file! The actual file named startup.bat. So I executed it, new command line window popped out and it is full of exceptions. Something about IbmX509 KeyStoreManager is nowhere to be found. Of course it can not be found because I am not running IBM JVM! What kind of assumption is to expect that everybody in the world are on IBM JVM, huh? I had to dig into Tomcat’s server.xml to set it to use Sun’s X509 keymanager (simply open tomcat/conf/server.xml, find IbmX509 and replace it with SunX509).

After quick restart Tomcat is happy and I can open, according to instructions, Jazz setup screen, which is a web application running within Tomcat. The setup has two options: “Fast Path” and “Custom setup”. I’ve chosen Fast Path because I am happy with the defaults, whatever they are. Click on “Fast Path” gets me to “Setup User Registry” screen, which has “A problem occurred while loading User Registry settings.” error message displayed. Hmm… Let’s head back to installation guide:

The default user name and password are case-sensitive:

  • The user name is ADMIN.
  • The password is ADMIN.

If you configured the LDAP directory Web container, log in with a JazzAdmin user that is defined in your LDAP directory.

What? I have to configure LDAP directory Web container first? This is first time it mentioned in this “guide”! How do I do that? There is no answer.

Ok, Fast Path is broken, so let’s try Custom setup. Click. “Loading Database Connection settings…” No progress here as well. Nothing about such problems in tomcat logs, nothing in server troubleshooting section of installation guide.

So there is no Rational Team Concert for me for now. Would I recommend it for use on my next project? 

Update: Decided to dig around filesystem, looking for something useful like logs and other batch files. Found some logs in Tomcat cache folders (tomcat/work/Catalina/localhost) with the ClassNotFound messages. Found jars, containing missing class and added it to CLASSPATH. No help.

Then found mentioned above server.startup.bat and tried to run it. Now it complained about SunX509 KeyManager, so I returned the IbmX509 KeyManager back. Still no help progressing with Jazz Setup…

And then I decided to run repotools.bat – just in case the repository got corrupted or something. Execited it with parameter –createTables, it done something with something.

Tried Jass Setup page again and now it worked! Whoa!

October 03 2007

How to get rid of .svn folders

Use Ant!


<delete includeemptydirs="true" >
<fileset dir="${checkout.dir}" defaultexcludes="false" >
<include name="**/.svn/" />
</fileset>
</delete>

March 09 2007

Faces component: Table with subtotals

I tried to search all over the web for a Java Faces component, which will do a simple thing: totals and subtotals. And I failed. It seems that whole web is about how much more AJAX you could put everywhere, not how more useful your product could be for average user.

It could be done through a facet tag, which is obvious.

I think about that as competitive advantage for myself. If nobody done it – I should do it and be recognised for it!

September 26 2006

Axis 1.x or Axis2?

This blog post answers the questions about which version of Axis framework developers should use and also gives a short story about Axis development history. Short and must read.

July 26 2006

Security in JSF apps

Java Developer’s Journal published a very good article on security issues in JSF applications. The article consists of three pages. Two first pages provide the neccessary background information with the possible solution. The third page looks like the editors decided not to publish more details and just finish that article as fast as possible. And source code attachment does not work either.

Another link to check is JSF security project on Sourceforge

February 14 2006

Filenet does exception handling – 2

Week ago I wrote about unusual way of handling exceptions in Filenet Workplace.

Today I found another “gem”:

[java]
try
{
invokeNamedEvent(eventName, uiModule, request, new WcmEventResponse(response, this, okToRedirect));

// If a non-null return value was returned from the invoke, check for true/false. If the
// result matches “false”, set the redirect flag to true indicating to cancel processing
// of the page.
Object result = request.getAttribute(INVOKE_RETURN_VALUE);
if ( result != null result.toString().equals(String.valueOf(false)) )
sendRedirectCalled = true;
}
catch (Exception e)
{
throw e;
}
[/java]

Why to catch an exception here? And why string comparison is used when Boolean has a constructor with the String parameter?

It seems that Filenet doesn’t use any of code review procedures internally. Developers just hack the code all day, make no comments and only two of them really understand the whole Filenet Workplace system. Or it was written long time ago by developer, which left the company, and nobody has time and/or will to do a proper system.

Technorati Tags: , ,

February 08 2006

Dozer – object to object mapping tool

Dozer – about

This one looks like very promising solution when I will need to convert normal Java beans to Filenet’s property bags.

Technorati Tags: , , , ,