Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Pages

Monday, February 25, 2013

Testing a datasource on JBoss 7.1.1 in domain mode

I'm trying to test a deployed datasource in JBoss 7.1.1 in a domain configuration.

No info found around help in doing this job, also the web console is not working as expected (I also use TEIID 8.2 and probably the new web console mangled up a few things) and surely having a domain installation does not help things up.


All the things found around suggest to use this command

/subsystem=datasources/data-source=reportsDS:test-connection-in-pool


Being in a domain mode I do not have /subsystem so I tryed to get the subsystem from somewhere.

Getting it from profile ...

/profile=ha/subsystem=datasources/data-source=reportsDS:test-connection-in-pool


But the result are below and are not the expected

{
"outcome" => "failed",
"failure-description" => "JBAS010850: No handler for operation test-connection-in-pool at address [
(\"profile\" => \"ha\"),
(\"subsystem\" => \"datasources\"),
(\"data-source\" => \"reportsDS\")
]",
"rolled-back" => true
}


So I tryed with the following (that is logical since the previous was issued on a definition (profile) and not something truly running) against the host/server

/host=master/server=teiid1/subsystem=datasources/data-source=reportsDS:test-connection-in-pool


This time the result is successful

{
"outcome" => "success",
"result" => [true]
}

If needed by anyone.

Saturday, February 09, 2013

Considerations on italian context

I usually write of technical stuff.
I'm a techy and prefer to stay on my ground.
I live in Italy, that I consider a great place, that have given lot to world's culture, art and science.

In Italy we are living one of the lowest moments of our history, without even being aware of it.
Since this is a grave sentence I'll try to motivate it with data.

The first and foremost problem is the incompetence at higher levels of management: the majority of the politician aren't people dedicated to the common good, but people that devote themselves to personal enrichment and gain personal advantages up to the point to promote laws useful to their own economical and personal interests.
This has the consequence that much of the management of companies linked to Public Administration (this means from the little company that want/need to work with a local municipality, and in Italy we have more than 8000 municipalities, to the big enterprises) either submit to compromises with this politicians or are in league with them.
This pairs with a common theory that says that management does not need to understand the inner working of the company business but just need to know how to manage things; this approach could be summed up with the concept that the same manager can today be the CEO of a car industry and tomorrow the general director of a hospital and the day after the president of a farming consortium, because he "knows how to manage".

The consequence?

Companies have a management that usually do not take decisions unless are decisions that politicians push on them and are not able to guide and "manage" the company. Many are just good looking and smooth talkers. Who can blame them? If you do not understand your company business how can you decide the strategy of the company? If a computer or an hamburger are the same to you how can you make decisions?

The consequence?

This management raise, usually, mediocre people, so called "yes man" or friends so that their position is not at risk and they can do what they want without being hampered.


There is another part of the equation.
Italians are mediterranean people and to use a stereotype many of us "work hard when pressed", place attention on the "when pressed" part. Even if in our constitution we wrote at article 4 (so in a pretty important place) "Ogni cittadino ha il dovere di svolgere, secondo le proprie possibilità e la propria scelta, un'attività o una funzione che concorra al progresso materiale o spirituale della società." that can be translated as "each citizen has the due to work according to his possibility and choice to contribute to material or spiritual progress of society", few are educated to a working culture and are looking for a quick way to get money with the smallest effort. This make us creative people, but not always so productive. This is a rich pond where those politicians can go fishing for votes: "vote for me and I'll promise you benefits". To better control people media are constantly lowering the cultural level of the media content and information, with the result that people get distracted towards false problems and low profile (dumb) mindset: "let's give them soccer, girls and some topics to argue upon" (remember we invented "panem et circenses" 2000 years ago with gladiators so we have experience on this).

Think this scenario applied to all productive center of the society, schools, big industries, media, public administration. This has been running for years, so it's quite spread.

The consequences?

Is no wonder that Italy doesn't have big companies. We have lot of small businesses where hard working people strive to live the day in a difficult environment. Few people wants to be "Don Quixote" fighting mills and prefer to bow their head not to run the risk of loosing what they gained with hard work.

This is a simplified summary of the current situation, more a photograph of a state, not an analysis of why we are here. There are exceptions, not all of Italy is like this, but the balance is tilted on the wrong side.

History teaches that in similar situations Italy and Italians managed to raise and conquer freedom.
Let us hope for the best.

Monday, December 10, 2012

ReteLIM project presentation - network problems

Here you can find the link to a presentation of mine of the ReteLIM project.
The main goal of the project is to enable hospitalized children to keep in contact with his classmates and teachers; I explained a bit in a previous post of mine.

The main big problem in Italy is the lack of good network connections in the schools AND in the hospitals.

Unfortunately hospitals are not build with a 2.0 conception. People often risk to spend lot of lifetime in an hospital and there should be the availability of a free guest network connection, isolated from the internal hospital network, so that citizen either sick or relatives can have a view of the world and a means to keep in touch with the outside.
This is place where free internet has an additional meaning.

Unfortunately in Italy we are much in late with the free internet access.

Maybe in the context of the "Agenda Digitale" there could be means to address also this problems:

- Bandwitdh for schools and hospitals
- Public cloud where PA (and schools obviously) can procure computing power for services

These are themes that have to be centrally solved.



Sunday, December 09, 2012

JBoss 7.1.1 + GeoServer 2.2.2

I'm deploying GeoServer 2.2.2 into JBoss 7.1.1 and there are not many hint around on how to solve some issues.

If you download the WAR version of GeoServer and just deploy it into the standalone/deployments folders you get the following errors:



14:47:26,944 ERROR [stderr] (MSC service thread 1-5) java.lang.NoClassDefFoundError: com/sun/imageio/plugins/common/BogusColorSpace

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi.onRegistration(TIFFImageReaderSpi.java:168)

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:698)

14:47:26,944 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:285)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:191)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.(IIORegistry.java:121)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:142)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.geoserver.GeoserverInitStartupListener.contextDestroyed(GeoserverInitStartupListener.java:236)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999)

14:47:26,959 ERROR [stderr] (MSC service thread 1-5)     at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5)     at java.lang.Thread.run(Thread.java:662)

14:47:26,975 ERROR [stderr] (MSC service thread 1-5) Caused by: java.lang.ClassNotFoundException: com.sun.imageio.plugins.common.BogusColorSpace from [Module "deployment.geoserver.war:main" from Service Module Loader]

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

14:47:26,990 ERROR [stderr] (MSC service thread 1-5)     ... 16 more

14:47:27,006 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.deployment.default-host./geoserver: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./geoserver: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_35]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_35]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_35]



To solve the problem you have to  create two files:
jboss-classloading.xml

<classloading xmlns="urn:jboss:classloading:1.0"
name="geoserver.war"
domain="GeoServerDomain"
export-all="NON_EMPTY"
import-all="true">
</classloading>


jboss-deployment-structure.xml

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
    <deployment>
        <dependencies>
            <system>
                <paths>
                    <path name="com/sun/imageio/spi"/>
                    <path name="com/sun/imageio/plugins/common"/>
                </paths>
            </system>
        </dependencies>
    </deployment>
</jboss-deployment-structure>


These files have to be added inside the WAR in the \WEB-INF\

This solves the problem and you get a nice and working GeoServer inside the JBoss application server.

Tuesday, December 04, 2012

WebRTC mozilla implementation

Here is a great demonstration of the next WebRTC implementation that Mozilla is developing for Firefox 18.
This is going to put in the trash all the web conference solutions. or at least rising the minimum feature offering. The power to send the currend browser to the other participant is amazing and powerful.

This could have a big impact on eLearning tools, adding new communication tools directly within the platform (I'm thinking at a Moodle on steroids).
The interesting aspect is the fact that the WebRTC technology enable a new world of integrated applications on the web, just a few click away.

I hope that projects like OpenMeetings will soon be able to leverage on this standard.




Saturday, December 01, 2012

New cloudstack' VMs security and password management

I happen to work with cloud infrastructure and use to create lots of virtual machines to test and develop new puppet modules.

Since the target is to finalize cloud templates and correct installation of the modules often these VMs stay up a few days to allow refining and so on.

I start from a very basic template, and all is installed by puppet, security has to be managed by the cloud and these machines are destined to stay in the internal private network exposing just the services they offer (whether they are a moodle machine or a JBoss server or whatever).

So no particular attention has been made in securing the host, but to be able to work with ease I just opened the 22 port of SSH server to connect and to the configurations.

Unfortunately the password was a simple one and since the work sometimes take more than a couple of days some machine were compromised; brute force attack to SSH server.

This to learn to use a good password: so since using a different password for each VM in the cloud could be difficult to remember (especially if you want to use non simple ones) I decided to use a nice feature of keepass: the ability to execute PUTTY as a URL action; in this way I do not have to bother to remember or type complex passwords anymore.

Here the code to insert in keepass:


cmd://PuTTY.exe -ssh {USERNAME}@{URL:HOST} {URL:PORT} -pw {PASSWORD}

cmd://WinSCP.exe scp://{USERNAME}:{PASSWORD}@{URL}

The first is for opening ssh URL the second to create a "scp" URL.  Mind that there is already an "ssh" URL scheme, but if you have SSH on another port you have to follow the command above to manage to connect.  This command works with the latest keepass 2.x version

To add it go to Tools -> Options...    press "URL Scheme Overrides"
Keepass options dialog

Create a new Scheme pressing "Add..."

URL Override

Adding "ssh" to scheme and the command above in the URL Override.

This way you can start PUTTY from keepass using secure complex passwords with ease.

To solve the problem of unsecure new machines I also added the installation of fail2ban to the puppet node description: no more brute force attack allowed.

Will work on automatically changing the root password and creating a CSV file to send to administrator to add info to central keepass DB.

Friday, November 23, 2012

Puppet, Augeas and sudoers

I'm developing some puppet modules in these days and I'm working on a Moodle module.

The interesting thing is that Moodle has a nice CLI interface that is possible to use to make the installation unattended and not iterative so is possible to create a puppet module that manages the whole installation by itself.
The module is still in the works, but I'm trying to make it as modular as possible since I could need to have the MySQL DB in a different host and so I prefer to set up the module to delegate to MySQL the task of building the DB.
This is something that many modules around to not take into consideration: not all environments have the DB in the same host as the application you are installing.  In my case is particularly true in my case since I work in a cloud environment and I need the machine to be automatically deployed in CloudStack letting the Moodle machine to export the DB need to the MySQL central machine.

To solve this problem I'm using the exported resources and I can say that it works pretty well as I posted some times ago.

With this approach the Moodle module just takes care of the Moodle stuff and demand (issues a export resource and MySQL will catch it and create the DB) to other modules the task of managing their resources.

Thankfully puppetlabs is working hard to provide a set of good basic modules to manage thinks like MySQL (had to use the GIT version since there is a bug that has been fixed there)
One of the thingsI had a really awful time to solve is the use of Augeas in puppet to configure the /etc/sudoers file.
The problem is that Moodle CLI wants to be executed as the Apache user, but the apache user do not have TTY and is not allower to work without a password so googling around (I'm not a sysop, more a jack-of-all-trades and thus have to google a lot in my day :-) ) it turned out I had to have sudo and write /etc/sudoers to enable apache to work.
It seems easy ... (at least if you use visudo), but using puppet ...
Looking around I felt lucky augeas can write on /etc/sudoers ... but how?  No good example around so after many trials and error I decided to make this post to help others not loosing all the time I did:

augeas { "sudoapache":
    context => "/files/etc/sudoers",
    changes => [
      "set spec[user = '$moodle::params::web_user']/user \"$moodle::params::web_user\"",
      "set spec[user = '$moodle::params::web_user']/host_group/host \"ALL\"",
      "set spec[user = '$moodle::params::web_user']/host_group/command \"ALL\"",
      "set spec[user = '$moodle::params::web_user']/host_group/command/runas_user \"ALL\"",
      "set spec[user = '$moodle::params::web_user']/host_group/command/tag \"NOPASSWD\"",
      "set Defaults[type=':$moodle::params::web_user']/type :$moodle::params::web_user",
      "set Defaults[type=':$moodle::params::web_user']/requiretty/negate \"\""],
  }


This will produce the two rows in the file that allowed the CLI to make its own work.

apache ALL = (ALL) NOPASSWD : ALL
Defaults:apache !requiretty


Good puppetizing!

Wednesday, November 07, 2012

VUVOX a timeline storytelling

This is a really powerfull solution for alternative form of presentations.

The timeline approach transmits a narrative flow to the presentation and the power of hyperlinks to show videos, images, audio is a big addition.

This is one complementary alternative to Prezi.

You give the user the power to control the flow and the hyperlink is something tha Prezi lacks. These two tools offer a new way to present content in a rich and engaging style.

I can advise it.