Programming

 

XMLbeans scomp fails with “java.io.IOException: CreateProcess error=2, The system cannot find the file specified”

Beans Alubia pinta alavesa. Álava, Spain.
Image via Wikipedia

If you are using xmlbeans on Windows to bind your schema to Java types then you are probably using a tool bundled with the distribution called scomp or Schema Compiler. For schema compiler to work you will need to correctly setup computer environment by installing JDK. You can follow through the following check-list to detect if any additional installation steps are required on your machine setup:

  • Start->Run->type cmd and type java in the command line. If no error then your setup is correct; otherwise setup JAVA_HOME and add %JAVA_HOME%/bin to your Path environment variable and try again.
  • Start->Run->type cmd and type scomp in the command line. If no error then your setup is correct; otherwise setup XMLBEANS_HOME and add %XMLBEANS_HOME%/bin to your Path environment variable and try again.

Then run scomp. Depending on your wishes you will probably wan’t to create a .jar file of the Java types scomp compiles from schema files. I used the following command line:

scomp -d schema -src src -out my_schema_1_0_0.jar ./schema/mySchema.xsd

where mySchema.xsd file was stored in ./schema folder.

If you get my_schema_1_0_0.jar, by some coincidence then kudos to you, but most likely you will end up with something similar to this error:

Time to build schema type system: 1.282 seconds
Time to generate code: 18.687 seconds
java.io.IOException: Cannot run program "C:\your current path\javac": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "C:\your current path\javac": CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessBuilder.start(Unknown Source)
 at java.lang.Runtime.exec(Unknown Source)
 at java.lang.Runtime.exec(Unknown Source)
 ... 6 more
BUILD FAILED

Read on to solve this problem.

READ MORE

 

Workaround – IE6+ local script restrictions

Internet Explorer Mobile
Image via Wikipedia

In the early years of internet growth I had the opportunity to work as a web designer. As web designer I designed a web page. Simple not too complicated. And it rocked. Literally. Admired by many. By today’s standards web page was LAME. Totally. But it used an interesting JavaScript. As now I was using Linux at the time and I replaced the default mouse cursor with cool animated Linux penguin. The penguin was fabulous. The animation was interesting. The script was flawless. It did not bother me that the script was not working in IE because at that time netscape ruled the web and Microsoft did not bother to make it work on Linux1.
READ MORE

  1. strange, that they still live with the same delusion []
 

Sketchy musical factory

The Abstract Factory pattern illustration, UML...
Image via Wikipedia

Today we will take a look at the abstract factory design pattern. This design pattern continues the series of creational patterns.

In previous article we have talked about factory pattern. We have learned that factory pattern deals with creation of other objects. Now we will extend that knowledge with the abstract factory pattern which provides a way to group together or rather encapsulate a group of individual factories that create objects with common theme.

Normally we would code a client software to create a concrete implementation of the abstract factory and then use generic interfaces to create concrete objects that are tuned to specific theme but, the client does not know about which concrete object will it get from each of the internal factories since it uses generic interfaces of the factory product in question. Details of the implementation of concrete objects are hidden by the internal factories.

READ MORE

 

Fungi Factory without abstraction

Next creational pattern that we will have a closer look at – is Factory pattern. There are at least two different Factory patterns, Factory method and Abstract Factory. In this installment we will be looking at the Factory method pattern.

READ MORE

 

Singing a singular design with Singleton

Now from my perspective there are a lot of programmers that finish school, get a degree, get a good job and then are presented with a problem. For example program designers design applications that include one of most simple design patterns.

Now I am not the best programmer in the world and also not the worst. Maybe I was lucky to be born in the era in which pattern design sprouted and started to grow. Also I know that most of you dear readers don’t need to reread this simple stuff, but if you are unsure of something … go ahead and take a peek. We will not tell ;)

This should be a first of design pattern series. So come back and check out the one of which you are unsure of. READ MORE

Support Us