JamVM

2,532 views
Skip to first unread message

Andrew Peebles

unread,
Apr 21, 2011, 7:05:54 PM4/21/11
to openhab
Trying to run openhab on an arm-based embedded system. I am using
jamvm for a jvm; version 1.5.3, and gnu classpath 0.98. The good news
is that the runtime does (appear) to come up, and I get the osgi>
console prompt. The bad news is that I cannot get the web app to do
something reasonable. Some times the browser will spin forever,
sometimes I get:

HTTP ERROR: 404

Problem accessing /openhab.app. Reason:

ProxyServlet: /openhab.app

Turning on DEBUG for jetty logging and comparing the output with a
fully functional instance running on my native machine under java, the
jamvm output stops here:

(...)
15:41:40.072 DEBUG org.eclipse.jetty.util.log[:70] - Holding class
org.eclipse.jetty.osgi.httpservice.HttpServiceServletX
15:41:40.077 DEBUG org.eclipse.jetty.util.log[:70] - STARTED
org.eclipse.jetty.osgi.httpservice.HttpServiceServletX-369134045
15:41:40.077 DEBUG org.eclipse.jetty.util.log[:70] - STARTED
ServletContextHandler@52cd19d@52cd19d/,null
15:41:40.077 DEBUG org.eclipse.jetty.util.log[:70] - Executing Node:
Node[started]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

But the fully functional instance (web works, running java) goes
beyond that:

(...)
15:41:40.072 DEBUG org.eclipse.jetty.util.log[:70] - Holding class
org.eclipse.jetty.osgi.httpservice.HttpServiceServletX
15:41:40.077 DEBUG org.eclipse.jetty.util.log[:70] - STARTED
org.eclipse.jetty.osgi.httpservice.HttpServiceServletX-369134045
15:41:40.077 DEBUG org.eclipse.jetty.util.log[:70] - STARTED
ServletContextHandler@52cd19d@52cd19d/,null
15:41:40.077 DEBUG org.eclipse.jetty.util.log[:70] - Executing Node:
Node[started]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15:41:40.079 INFO o.o.c.core.ConfigDispatcher[:104] - Process openHAB
default configuration file '/work/bahamut/peebles/g2-36-x86/
openwrt-2.4.2011-trunk/build_dir/target-i386_uClibc-0.9.30.1/openhab-
runtime-0.6.0/configurations/openhab_default.cfg'.
15:41:40.088 INFO o.o.c.core.ConfigDispatcher[:115] - Process openHAB
main configuration file '/work/bahamut/peebles/g2-36-x86/
openwrt-2.4.2011-trunk/build_dir/target-i386_uClibc-0.9.30.1/openhab-
runtime-0.6.0/configurations/openhab.cfg'.
15:41:40.089 WARN o.o.c.core.ConfigDispatcher[:118] - Main openHAB
configuration file 'configurations/openhab.cfg' does not exist.
15:41:40.090 INFO o.o.c.internal.CoreActivator[:47] - openHAB Runtime
Core has been started.
(null: 34, 187): cvc-elt.1: Cannot find the declaration of element
'change-set'.
(null: 34, 187): cvc-elt.1: Cannot find the declaration of element
'change-set'.
15:41:41.823 INFO o.o.m.i.i.ItemModelActivator[:46] - Registered
'item' configuration parser
15:41:41.909 INFO o.o.m.s.i.SitemapModelActivator[:45] - Registered
'sitemap' configuration parser
15:41:42.217 INFO o.o.m.c.i.f.FolderObserver[:161] - Loaded file
'demo.items'

I tried another experiment installing jamvm and classpath on my native
ubuntu machine; it behaves identical to the embedded machine. So I am
concluding that this is a jamvm/classpath -related issue.

So, I am wondering if someone else has openhab running under jamvm,
and if so, was there some kind of "magic" involved in doing so.

This project looks pretty cool, and dovetails nicely with other things
I am doing on this embedded platform. If I can get the web demo
working, I'll feel pretty good about the future.

If I can't get a nice silver bullet here, then my next step will be to
build openhab from source and start debugging where it tries to open
the .cfg files. That seems to be the place that fails.

Kai Kreuzer

unread,
Apr 22, 2011, 5:27:53 AM4/22/11
to ope...@googlegroups.com
Hi Andrew,

I have not tried openHAB myself on JamVM, but I would be interested in seeing you getting it working :-)

From what I see in your log, it all looks ok to me. The warning in the ConfigDispatcher is normal as long as you do not create a personalized openhab.cfg file (which is not necessary for the demo mode, but should be created if you want to change anything in the configuration).

What is missing in your log before you can access the UI is a line like

23:34:48.166 [FolderObserver] INFO o.o.m.c.i.folder.FolderObserver - Loaded file 'demo.sitemap'

as the sitemap file defines what is to be displayed in the UI. This loading usually happens quite late in the startup process - so could you check if this turns up a bit later in your log?

The debug logging of Jetty usually does not help much; what might be more interesting is to activate debug logging for the org.openhab classes. You should then also see log entries like

23:34:30.211 [Component Resolve Thread (Bundle 43)] DEBUG o.o.u.w.i.servlet.WebAppServlet - Starting up WebApp servlet at /openhab.app
23:34:47.816 [FolderObserver] DEBUG o.o.m.c.i.folder.FolderObserver - Refreshing folder 'sitemaps'

Hope this helps for your further analysis!

Regards,
Kai

> --
> You received this message because you are subscribed to the Google Groups "openhab" group.
> To post to this group, send email to ope...@googlegroups.com.
> To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
>

Andrew Peebles

unread,
Apr 22, 2011, 12:08:48 PM4/22/11
to ope...@googlegroups.com
On 4/22/11 2:27 AM, Kai Kreuzer wrote:
> Hi Andrew,
>
> I have not tried openHAB myself on JamVM, but I would be interested in seeing you getting it working :-)
>
> From what I see in your log, it all looks ok to me. The warning in the ConfigDispatcher is normal as long as you do not create a personalized openhab.cfg file (which is not necessary for the demo mode, but should be created if you want to change anything in the configuration).
>
> What is missing in your log before you can access the UI is a line like
>
> 23:34:48.166 [FolderObserver] INFO o.o.m.c.i.folder.FolderObserver - Loaded file 'demo.sitemap'
>
> as the sitemap file defines what is to be displayed in the UI. This loading usually happens quite late in the startup process - so could you check if this turns up a bit later in your log?
>
> The debug logging of Jetty usually does not help much; what might be more interesting is to activate debug logging for the org.openhab classes. You should then also see log entries like
Can you tell me how to do this?

Kai Kreuzer

unread,
Apr 22, 2011, 1:58:38 PM4/22/11
to ope...@googlegroups.com

> Can you tell me how to do this?

Sorry, I thought you did this for the jetty logging already - just edit logs/logback.xml and set the root logging to debug:

<root>
<level value="DEBUG" />

Regards,
Kai

Andrew Peebles

unread,
Apr 22, 2011, 2:27:26 PM4/22/11
to ope...@googlegroups.com
On 4/22/11 2:27 AM, Kai Kreuzer wrote:
> Hi Andrew,
>
> I have not tried openHAB myself on JamVM, but I would be interested in seeing you getting it working :-)
>
> From what I see in your log, it all looks ok to me. The warning in the ConfigDispatcher is normal as long as you do not create a personalized openhab.cfg file (which is not necessary for the demo mode, but should be created if you want to change anything in the configuration).
>
> What is missing in your log before you can access the UI is a line like
>
> 23:34:48.166 [FolderObserver] INFO o.o.m.c.i.folder.FolderObserver - Loaded file 'demo.sitemap'
>
> as the sitemap file defines what is to be displayed in the UI. This loading usually happens quite late in the startup process - so could you check if this turns up a bit later in your log?
>
> The debug logging of Jetty usually does not help much; what might be more interesting is to activate debug logging for the org.openhab classes. You should then also see log entries like
>
> 23:34:30.211 [Component Resolve Thread (Bundle 43)] DEBUG o.o.u.w.i.servlet.WebAppServlet - Starting up WebApp servlet at /openhab.app
> 23:34:47.816 [FolderObserver] DEBUG o.o.m.c.i.folder.FolderObserver - Refreshing folder 'sitemaps'
>
> Hope this helps for your further analysis!
>
> Regards,
> Kai
>
Interesting. I am not getting anything *but* jetty messages in the log,
even when I change logs/logback.xml to:

(...)


<root>
<level value="DEBUG" />

<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>

<logger name="org.eclipse.jetty">
<level value="DEBUG" />
</logger>

<logger name="org.drools.SystemEventListener">
<level value="WARN" />
</logger>

</configuration>

Adding -verbose to the java command line just spews lots of
loading/linking messages. Seemingly, none of the configuration file
reading is happening, and openhab.app is not being loaded, at least
given the lack of debug messages that I should be seeing ... ???

a

Kai Kreuzer

unread,
Apr 22, 2011, 4:57:20 PM4/22/11
to ope...@googlegroups.com
> Interesting. I am not getting anything *but* jetty messages in the log, even when I change logs/logback.xml to:

I should have read your initial mail more carefully; I didn't notice that the second log excerpt was from a "normal" JVM startup.

So if you have nothing but Jetty messages, I wonder if the OSGi framework starts up at all. Do you have the OSGi console available after startup?
Can you do a "ss" to see the state of all bundles and maybe start them manually with "start <bundle no>" if necessary?

Regards,
Kai

Andrew Peebles

unread,
Apr 22, 2011, 5:14:58 PM4/22/11
to ope...@googlegroups.com
On 4/22/11 1:57 PM, Kai Kreuzer wrote:
>> Interesting. I am not getting anything *but* jetty messages in the log, even when I change logs/logback.xml to:
> I should have read your initial mail more carefully; I didn't notice that the second log excerpt was from a "normal" JVM startup.
>
> So if you have nothing but Jetty messages, I wonder if the OSGi framework starts up at all. Do you have the OSGi console available after startup?
Yes I do.

> Can you do a "ss" to see the state of all bundles and maybe start them manually with "start<bundle no>" if necessary?
>

You mean "ls"? ss shows a bunch of RESOLVED/ACTIVE/LAZY/INSTALLED
lines. "ls" shows:

osgi> ls
All Components:
ID State Component Name Located
in bundle
1 Active org.eclipse.equinox.event
org.eclipse.equinox.event(bid=68)
2 Registered
org.eclipse.equinox.frameworkadmin.equinox
org.eclipse.equinox.frameworkadmin.equinox(bid=70)
3 Registered
org.eclipse.equinox.p2.artifact.repository
org.eclipse.equinox.p2.artifact.repository(bid=75)
4 Registered
org.eclipse.equinox.p2.core.eventbus
org.eclipse.equinox.p2.core(bid=77)
5 Registered
org.eclipse.equinox.p2.di.agentProvider
org.eclipse.equinox.p2.core(bid=77)
6 Registered
org.eclipse.equinox.p2.director
org.eclipse.equinox.p2.director(bid=78)
7 Registered
org.eclipse.equinox.p2.planner
org.eclipse.equinox.p2.director(bid=78)
8 Registered
org.eclipse.equinox.p2.engine.registry
org.eclipse.equinox.p2.engine(bid=80)
9 Registered
org.eclipse.equinox.p2.engine
org.eclipse.equinox.p2.engine(bid=80)
10 Registered
org.eclipse.equinox.p2.garbagecollector
org.eclipse.equinox.p2.garbagecollector(bid=82)
11 Registered
org.eclipse.equinox.p2.metadata.repository
org.eclipse.equinox.p2.metadata.repository(bid=85)
12 Registered
org.eclipse.equinox.p2.repository
org.eclipse.equinox.p2.repository(bid=89)
13 Registered
org.eclipse.equinox.simpleconfigurator.manipulator
org.eclipse.equinox.simpleconfigurator.manipulator(bid=95)

osgi> start 2

osgi> start 3

osgi> start 4

osgi> start 5
org.osgi.framework.BundleException: A fragment bundle cannot be started:
ch.qos.logback.slf4j_0.9.19.v20100519-1910 [5]
at
org.eclipse.osgi.framework.internal.core.BundleFragment.startWorker(BundleFragment.java:228)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)
at java.lang.reflect.VMMethod.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:327)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
at java.lang.Thread.run(Thread.java:745)

osgi>

The output I got from starting #5 is interesting. After doing those
starts and another ls, the state is the same. Nothing new went from
registered to active.

a

Kai Kreuzer

unread,
Apr 24, 2011, 6:39:44 AM4/24/11
to ope...@googlegroups.com
> You mean "ls"? ss shows a bunch of RESOLVED/ACTIVE/LAZY/INSTALLED lines. "ls" shows:

No, I meant "ss", which show the bundle status, not the service/component status as "ls".
If you do an "ss org.openhab", almost all listed bundles should be in "ACTIVE" state - if not, try a "start <no>" on them and see the log response.

> The output I got from starting #5 is interesting. After doing those starts and another ls, the state is the same. Nothing new went from registered to active.

> org.osgi.framework.BundleException: A fragment bundle cannot be started: ch.qos.logback.slf4j_0.9.19.v20100519-1910 [5]

That's normal as one cannot start a fragment (only bundles). Try the above and start all bundles not in "ACTIVE" state and let me know what errors you see.

Regards,
Kai

Andrew Peebles

unread,
Apr 24, 2011, 1:26:37 PM4/24/11
to ope...@googlegroups.com
Ah. Well, looks like we found the problem:

osgi> start 159
org.osgi.framework.BundleException: The bundle
"org.openhab.config.core_0.6.0.201102281927 [159]" could not be
resolved. Reason: Missing Constraint:
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)

Andrew Peebles

unread,
Apr 24, 2011, 1:32:44 PM4/24/11
to ope...@googlegroups.com
On 4/24/11 3:39 AM, Kai Kreuzer wrote:
I should have sent more output:

osgi> ss org.openhab

Framework is launched.

id State Bundle
159 INSTALLED org.openhab.config.core_0.6.0.201102281927
160 INSTALLED org.openhab.core_0.6.0.201102281927
161 INSTALLED org.openhab.core.library_0.6.0.201102281927
162 INSTALLED org.openhab.core.rules_0.6.0.201102281927
163 INSTALLED org.openhab.io.console_0.6.0.201102281927
164 INSTALLED org.openhab.io.monitor_0.6.0.201102281927
165 INSTALLED org.openhab.io.multimedia_0.6.0.201102281927
166 INSTALLED org.openhab.io.net_0.6.0.201102281927
167 INSTALLED org.openhab.model.core_0.6.0.201102281927
168 INSTALLED org.openhab.model.item_0.6.0.201102281927
169 INSTALLED org.openhab.model.sitemap_0.6.0.201102281927
170 INSTALLED org.openhab.ui_0.6.0.201102281927
171 INSTALLED org.openhab.ui.webapp_0.6.0.201102281927

osgi> start 159
org.osgi.framework.BundleException: The bundle
"org.openhab.config.core_0.6.0.201102281927 [159]" could not be
resolved. Reason: Missing Constraint:
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)

at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)
at java.lang.reflect.VMMethod.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:327)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
at java.lang.Thread.run(Thread.java:745)

Running start on some of the other #'s doesn't yield java spewage, but
the status of the bundle doesn't change either ... still INSTALLED.


Andrew Peebles

unread,
Apr 24, 2011, 1:37:59 PM4/24/11
to ope...@googlegroups.com
$ jamvm -version
java version "1.5.0"
JamVM version 1.5.3
Copyright (C) 2003-2009 Robert Lougher <r...@lougher.org.uk>

Seems openhab wants to run on 1.6, but jamvm is only up to 1.5. ??


Kai Kreuzer

unread,
Apr 24, 2011, 2:21:56 PM4/24/11
to ope...@googlegroups.com
> Seems openhab wants to run on 1.6, but jamvm is only up to 1.5. ??

Yes, that's the answer to the problem. Actually, openHAB should be fine with 1.5 as well, but indeed the 1.6 is mentioned in some manifests.
May I ask you to enter an issue about this and I will correct the manifests to only require a 1.5 jvm?

Cheers,
Kai

Andrew Peebles

unread,
Apr 24, 2011, 2:23:37 PM4/24/11
to ope...@googlegroups.com
ok. I am trying a build myself now, after changing the manifests to
j2se-1.5. ain't a java guy, but i'm giving it a shot.
a

Andrew Peebles

unread,
Apr 24, 2011, 2:48:35 PM4/24/11
to ope...@googlegroups.com
(...)
Downloaded:
http://repo1.maven.org/maven2/org/sonatype/tycho/tycho-compiler-jdt/0.10.0/tycho-compiler-jdt-0.10.0.jar
(9 KB at 2.2 KB/sec)
[INFO] Using compile source roots from build.properties
[WARNING] Overriding compiler source level 1.6 from POM with source
level 1.5 from MANIFEST.MF
[WARNING] Overriding compiler target level 1.6 from POM with target
level 1.5 from MANIFEST.MF
[INFO] Compiling 33 source files to
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/target/classes
----------
1. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/events/AbstractEventSubscriber.java
(at line 47)
public void handleEvent(Event event) {
^^^^^^^^^^^^^^^^^^^^^^^^
The method handleEvent(Event) of type AbstractEventSubscriber must
override a superclass method
----------
2. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/events/AbstractEventSubscriber.java
(at line 72)
public void receiveCommand(String itemName, Command command) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method receiveCommand(String, Command) of type
AbstractEventSubscriber must override a superclass method
----------
3. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/events/AbstractEventSubscriber.java
(at line 80)
public void receiveUpdate(String itemName, State newState) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method receiveUpdate(String, State) of type AbstractEventSubscriber
must override a superclass method
----------
----------
4. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/items/GenericItem.java
(at line 66)
public State getState() {
^^^^^^^^^^
The method getState() of type GenericItem must override a superclass method
----------
5. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/items/GenericItem.java
(at line 80)
public String getName() {
^^^^^^^^^
The method getName() of type GenericItem must override a superclass method
----------
----------
6. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/binding/AbstractActiveBinding.java
(at line 97)
public void bindingChanged(BindingProvider provider, String
itemName) {

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method bindingChanged(BindingProvider, String) of type
AbstractActiveBinding<P> must override a superclass method
----------
7. ERROR in
/work/bahamut/peebles/g2-36-x86/openhab/openhab/bundles/core/org.openhab.core/src/main/java/org/openhab/core/binding/AbstractActiveBinding.java
(at line 109)
public void allBindingsChanged(BindingProvider provider) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method allBindingsChanged(BindingProvider) of type
AbstractActiveBinding<P> must override a superclass method
----------
7 problems (7 errors)

Kai Kreuzer

unread,
Apr 24, 2011, 2:51:58 PM4/24/11
to ope...@googlegroups.com
For Java 1.5, you have to remove the @Override annotations if a method is part of an interface. This has been changed on Java 1.6 and I have used the 1.6 style for the sources.

Kai

Andrew Peebles

unread,
Apr 24, 2011, 2:55:25 PM4/24/11
to ope...@googlegroups.com
On 4/24/11 11:51 AM, Kai Kreuzer wrote:
> For Java 1.5, you have to remove the @Override annotations if a method is part of an interface. This has been changed on Java 1.6 and I have used the 1.6 style for the sources.
>
> Kai

Grep'ing thru the source, there are 797 instances of '@Override'. Maybe
I ought to wait for you to produce a 1.5 compatible runtime?

a

Eichstädt-Engelen Thomas

unread,
Apr 25, 2011, 4:06:00 PM4/25/11
to ope...@googlegroups.com
Hi Andrew.

thanks for opening issue #29 which is fixed now. Let us know if that brings us further ...

I am very interested in the solution as well since my pogoplug needs to be activated but i didn't find the time right now :-)

Cheers,

Thomas E.-E.

Eichstädt-Engelen Thomas

unread,
Apr 25, 2011, 4:07:11 PM4/25/11
to ope...@googlegroups.com
one more note: you should start the maven build with (at least) 512MB Heapspace ...

On 24.04.2011, at 20:55, Andrew Peebles wrote:

Andrew Peebles

unread,
Apr 25, 2011, 4:11:17 PM4/25/11
to ope...@googlegroups.com
By "fixed" do you mean I should check and and build the latest source?

My testing now is being done on a standard Ubunti 10.04 virtual machine
(VirtualBox), on which I've installed jamvm and gnu classpath using the
Software Center. Once this works, I'll move again to my embedded system.

a

Eichstädt-Engelen Thomas

unread,
Apr 25, 2011, 4:12:58 PM4/25/11
to ope...@googlegroups.com
jep :-)

-- Thomas E.-E.

Andrew Peebles

unread,
Apr 25, 2011, 5:07:59 PM4/25/11
to ope...@googlegroups.com
Not there yet ... I am now seeing:

sdk@sdk-desktop:~/oh-0.7.0$ sh start.sh
Launching the openHAB runtime...

osgi> Configuring the default jetty server with
file:/home/sdk/oh-0.7.0/./etc/jetty.xml
13:58:59.091 WARN org.eclipse.jetty.util.log[:40] - FATAL@null line:80
col:2 : org.xml.sax.SAXParseException: not a name start character: "U+2d"
13:58:59.130 WARN o.e.j.o.b.i.s.ServerInstanceWrapper[:50] - Unable to
configure the jetty/etc file file:/home/sdk/oh-0.7.0/./etc/jetty.xml
org.xml.sax.SAXParseException: not a name start character: "U+2d"
at gnu.xml.stream.SAXParser.parse(SAXParser.java:661)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:273)
at org.eclipse.jetty.xml.XmlParser.parse(XmlParser.java:187)
at
org.eclipse.jetty.xml.XmlConfiguration.<init>(XmlConfiguration.java:154)
at
org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper.configure(ServerInstanceWrapper.java:269)
at
org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper.start(ServerInstanceWrapper.java:157)
at
org.eclipse.jetty.osgi.boot.internal.serverfactory.JettyServerServiceTracker.serviceChanged(JettyServerServiceTracker.java:108)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:104)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:933)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:227)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:149)
Caused by: javax.xml.stream.XMLStreamException: not a name start
character: "U+2d"
at gnu.xml.stream.XMLParser.error(XMLParser.java:4158)
at gnu.xml.stream.XMLParser.readNmtoken(XMLParser.java:3586)
at gnu.xml.stream.XMLParser.readNmtoken(XMLParser.java:3570)
at gnu.xml.stream.XMLParser.readStartElement(XMLParser.java:2665)
at gnu.xml.stream.XMLParser.next(XMLParser.java:1085)
at gnu.xml.stream.SAXParser.parse(SAXParser.java:380)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:273)
at org.eclipse.jetty.xml.XmlParser.parse(XmlParser.java:187)
at
org.eclipse.jetty.xml.XmlConfiguration.<init>(XmlConfiguration.java:154)
at
org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper.configure(ServerInstanceWrapper.java:269)
at
org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper.start(ServerInstanceWrapper.java:157)
org.xml.sax.SAXParseException: not a name start character: "U+2d"
at gnu.xml.stream.SAXParser.parse(SAXParser.java:661)
(..)


And a little later:

(...)
13:58:59.360 WARN o.o.c.core.ConfigDispatcher[:118] - Main openHAB

configuration file 'configurations/openhab.cfg' does not exist.

13:58:59.364 INFO o.o.c.internal.CoreActivator[:47] - openHAB Runtime
Core has been started.
13:59:01.791 DEBUG o.o.m.c.i.f.FolderObserver[:116] - Refreshing folder
'items'
13:59:11.921 DEBUG o.o.m.c.i.f.FolderObserver[:116] - Refreshing folder
'sitemaps'
osgi> ss org.openhab

Framework is launched.

id State Bundle
159 ACTIVE org.openhab.config.core_0.7.0.201104251350
160 ACTIVE org.openhab.core_0.7.0.201104251350
161 ACTIVE org.openhab.core.library_0.7.0.201104251350
162 ACTIVE org.openhab.core.rules_0.7.0.201104251350
163 RESOLVED org.openhab.core.transform_0.7.0.201104251350
164 ACTIVE org.openhab.io.console_0.7.0.201104251350
165 ACTIVE org.openhab.io.monitor_0.7.0.201104251350
166 RESOLVED org.openhab.io.multimedia_0.7.0.201104251350
167 ACTIVE org.openhab.io.net_0.7.0.201104251350
168 ACTIVE org.openhab.model.core_0.7.0.201104251350
169 RESOLVED org.openhab.model.item_0.7.0.201104251350
170 RESOLVED org.openhab.model.sitemap_0.7.0.201104251350
171 ACTIVE org.openhab.ui_0.7.0.201104251350
172 ACTIVE org.openhab.ui.webapp_0.7.0.201104251350

I was able to manually start 163 and 166, but when I tried 169 I get:

osgi> start 169
org.osgi.framework.BundleException: Exception in
org.openhab.model.item.internal.ItemModelActivator.start() of bundle
org.openhab.model.item.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)


at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)
at java.lang.reflect.VMMethod.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:327)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.UnsatisfiedLinkError: getAnnotation
at java.lang.reflect.VMField.getAnnotation(Native Method)
at java.lang.reflect.Field.getAnnotation(Field.java:715)

and 170 is similar:

osgi> start 170
org.osgi.framework.BundleException: Exception in
org.openhab.model.sitemap.internal.SitemapModelActivator.start() of
bundle org.openhab.model.sitemap.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)


at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)
at java.lang.reflect.VMMethod.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:327)
at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)
at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)
at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.UnsatisfiedLinkError: getAnnotation
at java.lang.reflect.VMField.getAnnotation(Native Method)
at java.lang.reflect.Field.getAnnotation(Field.java:715)
at
com.google.inject.spi.InjectionPoint.addInjectorsForMembers(InjectionPoint.java:364)
at
com.google.inject.spi.InjectionPoint.addInjectionPoints(InjectionPoint.java:353)

Andrew Peebles

unread,
Apr 25, 2011, 5:22:45 PM4/25/11
to ope...@googlegroups.com
Please ignore the SAX error ... I made a syntax error in jetty.xml
(commenting out https stuff to avoid another error/warning). The REAL
problem is:

osgi> ss org.openhab

Framework is launched.

id State Bundle
159 ACTIVE org.openhab.config.core_0.7.0.201104251350
160 ACTIVE org.openhab.core_0.7.0.201104251350
161 ACTIVE org.openhab.core.library_0.7.0.201104251350
162 ACTIVE org.openhab.core.rules_0.7.0.201104251350

163 ACTIVE org.openhab.core.transform_0.7.0.201104251350


164 ACTIVE org.openhab.io.console_0.7.0.201104251350
165 ACTIVE org.openhab.io.monitor_0.7.0.201104251350

166 ACTIVE org.openhab.io.multimedia_0.7.0.201104251350


167 ACTIVE org.openhab.io.net_0.7.0.201104251350
168 ACTIVE org.openhab.model.core_0.7.0.201104251350
169 RESOLVED org.openhab.model.item_0.7.0.201104251350
170 RESOLVED org.openhab.model.sitemap_0.7.0.201104251350
171 ACTIVE org.openhab.ui_0.7.0.201104251350
172 ACTIVE org.openhab.ui.webapp_0.7.0.201104251350

And the java.lang.UnsatisfiedLinkError for starting item and sitemap.

a

Kai

unread,
Apr 26, 2011, 6:19:17 AM4/26/11
to openhab
This time it seems to be something that needs to be fixed in the
JamVM:

http://old.nabble.com/does-Jamvm-provide-implementation-of-getAnnotation-API-of-java.lang.reflect.Field-td23863678.html

Regards,
Kai

rlougher

unread,
Apr 26, 2011, 8:29:09 AM4/26/11
to openhab
Yes. That link also shows it's been fixed in the CVS version:

http://cvs.berlios.de/cgi-bin/viewvc.cgi/jamvm/jamvm/lib/java/lang/reflect/VMField.java?r1=1.1&r2=1.2

As it's in a Java file, you should be able to patch your version. If
not, I can send you an updated classes.zip file.

For the record, I've been working for the past year on porting JamVM
to work with OpenJDK (as opposed to GNU Classpath). This is now done,
but I need to do testing before I can do a new GNU Classpath-based
release, to ensure the OpenJDK work hasn't broken anything.

Rob.

On Apr 26, 11:19 am, Kai <ad...@openhab.org> wrote:
> This time it seems to be something that needs to be fixed in theJamVM:
>
> http://old.nabble.com/does-Jamvm-provide-implementation-of-getAnnotat...
>
> Regards,
> Kai
>
> On 22 Apr., 01:05, Andrew Peebles <peeb...@cortina-systems.com> wrote:
>
> > Trying to run openhab on an arm-based embedded system.  I am using
> >jamvmfor a jvm; version 1.5.3, and gnu classpath 0.98.  The good news
> > is that the runtime does (appear) to come up, and I get the osgi>
> > console prompt.  The bad news is that I cannot get the web app to do
> > something reasonable.  Some times the browser will spin forever,
> > sometimes I get:
>
> > HTTP ERROR: 404
>
> > Problem accessing /openhab.app. Reason:
>
> >     ProxyServlet: /openhab.app
>
> > Turning on DEBUG for jetty logging and comparing the output with a
> > fully functional instance running on my native machine under java, the
> >jamvmoutput stops here:
> > I tried another experiment installingjamvmand classpath on my native
> > ubuntu machine; it behaves identical to the embedded machine.  So I am
> > concluding that this is ajamvm/classpath -related issue.

Kai

unread,
Apr 26, 2011, 9:53:29 AM4/26/11
to openhab
Thanks for this hint Rob, I have missed to mention that the fix is
already available in CVS. (Also thanks for the JamVM altogether, it's
a cool piece of software - I really hope we get openHAB running on top
of it!)

@Andrew: Can you patch your JamVM locally to try this out?

Cheers,
Kai

On 26 Apr., 14:29, rlougher <rob.loug...@gmail.com> wrote:
> Yes.  That link also shows it's been fixed in the CVS version:
>
> http://cvs.berlios.de/cgi-bin/viewvc.cgi/jamvm/jamvm/lib/java/lang/re...

Andrew Peebles

unread,
Apr 26, 2011, 2:15:09 PM4/26/11
to ope...@googlegroups.com
On 04/26/2011 06:53 AM, Kai wrote:
> Thanks for this hint Rob, I have missed to mention that the fix is
> already available in CVS. (Also thanks for the JamVM altogether, it's
> a cool piece of software - I really hope we get openHAB running on top
> of it!)
>
> @Andrew: Can you patch your JamVM locally to try this out?
>
> Cheers,
> Kai
>
> On 26 Apr., 14:29, rlougher<rob.loug...@gmail.com> wrote:
>> Yes. That link also shows it's been fixed in the CVS version:
>>
>> http://cvs.berlios.de/cgi-bin/viewvc.cgi/jamvm/jamvm/lib/java/lang/re...
>>
>> As it's in a Java file, you should be able to patch your version. If
>> not, I can send you an updated classes.zip file.
>>
>> For the record, I've been working for the past year on porting JamVM
>> to work with OpenJDK (as opposed to GNU Classpath). This is now done,
>> but I need to do testing before I can do a new GNU Classpath-based
>> release, to ensure the OpenJDK work hasn't broken anything.
>>
>> Rob.
>>
>> On Apr 26, 11:19 am, Kai<ad...@openhab.org> wrote:
>>
>>
>>
>>
>>
>>
>>
>>
I tried patching my source; remember, I am using 1.5.3. This built a
new classes.zip, which I installed on my Ubuntu test machine, and reran
openhab. This lead to a "core dump":

sdk@sdk-desktop:~/oh-0.7.0$ sh start.sh
Launching the openHAB runtime...

osgi> Configuring the default jetty server with
file:/home/sdk/oh-0.7.0/./etc/jetty.xml

Returning defaultJettyServer =
org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper@b04d5dc8
09:35:47.578 INFO o.o.c.core.ConfigDispatcher[:104] - Process openHAB
default configuration file
'/home/sdk/oh-0.7.0/configurations/openhab_default.cfg'.
09:35:47.602 INFO o.o.c.core.ConfigDispatcher[:115] - Process openHAB
main configuration file '/home/sdk/oh-0.7.0/configurations/openhab.cfg'.
09:35:47.602 WARN o.o.c.core.ConfigDispatcher[:118] - Main openHAB

configuration file 'configurations/openhab.cfg' does not exist.

09:35:47.607 INFO o.o.c.internal.CoreActivator[:47] - openHAB Runtime
Core has been started.
09:35:49.482 DEBUG o.o.c.t.i.TransformationActivator[:53] -
Transformation Service has been started.
*** glibc detected *** java: free(): invalid next size (fast):
0x0abe84e0 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x795591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x796de8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x799ecd]
java[0x804b92d]
java[0x805f71a]
java[0x805f7ce]
java[0x805fe29]
java[0x805fe8e]
java[0x805cdcc]
java[0x806e552]
java[0x8055757]
java[0x8055882]
java(threadStart+0x71)[0x80637a1]
/lib/tls/i686/cmov/libpthread.so.0(+0x596e)[0xc5596e]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0x7f7a4e]
======= Memory map: ========
00110000-0011e000 r-xp 00000000 08:01 305509
/usr/lib/classpath/libjavanio.so.0.0.0
0011e000-0011f000 r--p 0000d000 08:01 305509
/usr/lib/classpath/libjavanio.so.0.0.0
(...)

Then I tried to check jamvm out from CVS and build, but the build fails:

9. ERROR in ./java/lang/reflect/Constructor.java (at line 233)
Modifier.toString(getModifiers(), sb).append(' ');
^^^^^^^^
The method toString(int, CPStringBuilder) in the type Modifier is not
applicable for the arguments (int, StringBuffer)
----------
----------
10. ERROR in ./java/lang/reflect/Field.java (at line 206)
Modifier.toString(getModifiers(), sb).append(' ');
^^^^^^^^
The method toString(int, CPStringBuilder) in the type Modifier is not
applicable for the arguments (int, StringBuffer)
----------
----------
11. ERROR in ./java/lang/reflect/Method.java (at line 272)
Modifier.toString(getModifiers(), sb).append(' ');
^^^^^^^^
The method toString(int, CPStringBuilder) in the type Modifier is not
applicable for the arguments (int, StringBuffer)

I am still banging around, but I am open to suggestions ...

a

Kai Kreuzer

unread,
Apr 26, 2011, 3:21:41 PM4/26/11
to ope...@googlegroups.com
> Then I tried to check jamvm out from CVS and build, but the build fails:
>
> I am still banging around, but I am open to suggestions ...
>


Maybe we can come back to your offer for a readily built classes.zip, Rob?

Andrew Peebles

unread,
Apr 26, 2011, 3:32:21 PM4/26/11
to ope...@googlegroups.com
I can certainly try that, but at the end of the day, I need to cross
compile jamvm from the source. I can patch it during the build ...

I am using OpenWRT for my embedded system. OpenWRT already contains
jamvm as a package. I am trying to add OpenWRT support for openhab,
ultimately.

I *should* be able to compile jamvm from the cvs tree, no? The error
seems pretty trivial ... an argument type mismatch. Maybe I am using
the wrong version of classpath 0.98.

1. ERROR in ./java/lang/reflect/Constructor.java (at line 233)

Andrew Peebles

unread,
Apr 26, 2011, 5:30:34 PM4/26/11
to ope...@googlegroups.com
I tried jamvm 1.5.4 built and running under Ubuntu 10.04 on x86. This
version already contains the "patch" for getAnnotation. And this
version dumps core. I was able to use gdb to get a stack trace:

Core was generated by `jamvm -Declipse.ignoreApp=true
-Dosgi.noShutdown=true -D32 -Djetty.home=. -Dlog'.
Program terminated with signal 11, Segmentation fault.
#0 getMethodParameterAnnotations (mb=0x69007400631b1d) at reflect.c:811
811 if(mb->annotations == NULL || mb->annotations->parameters ==
NULL)

Seems like a good hint (mb is f'd). My 1.5.3 version with the patch
doesn't yield a good'ol core dump ... instead I get:

But ... its bombing at what looks like the same spot ... so maybe for
the same reason?

a

rlougher

unread,
Apr 26, 2011, 8:07:47 PM4/26/11
to openhab
Hi Andrew,

On Apr 26, 10:30 pm, Andrew Peebles <peeb...@cortina-systems.com>
wrote:
> I tried jamvm 1.5.4 built and running under Ubuntu 10.04 on x86.  This
> version already contains the "patch" for getAnnotation.  And this
> version dumps core.  I was able to use gdb to get a stack trace:
>
> Core was generated by `jamvm -Declipse.ignoreApp=true
> -Dosgi.noShutdown=true -D32 -Djetty.home=. -Dlog'.
> Program terminated with signal 11, Segmentation fault.
> #0  getMethodParameterAnnotations (mb=0x69007400631b1d) at reflect.c:811
> 811         if(mb->annotations == NULL || mb->annotations->parameters ==
> NULL)
>

Bugger. You're hitting all the annotation bugs I've fixed over the
last 15 months (which is why I really need to do a new GNU Classpath
release).

I believe you're hitting this:

http://cvs.berlios.de/cgi-bin/viewvc.cgi/jamvm/jamvm/src/natives.c?r1=1.47&r2=1.48

This is a one line change.

I see you tried to build the CVS version, but got errors. So I've
tried checking out from CVS and building with ecj and javac, and both
work for me. I guess you've got installed a prebuilt package of GNU
Classpath. This puts glibj.zip in a different place (GNU Classpath by
default has a prefix of /usr/local/classpath, i.e. glibj.zip is /usr/
local/classpath/share/classpath/glibj.zip, but Ubuntu installs in /
usr).

You could configure JamVM with the preinstalled prefix:

./configure --with-classpath-install-dir=/usr

But this isn't going to help you, as CVS requires GNU Classpath 0.98,
and I believe 10.04 only has GNU Classpath 0.97? But you've tried
JamVM 1.5.4, which also requires 0.98... So I'm slightly confused
about which version of GNU Classpath do you have?

BTW, the release versions of JamVM contains a prebuilt classes.zip, to
make building and installation easier, and if it's any consolation,
building JamVM/Classpath is a lot easier than building OpenJDK...

Rob.

P.S. JamVM/OpenJDK will be in the next release of Ubuntu for x86,
x86-64, ARM and MIPS.

rlougher

unread,
Apr 26, 2011, 8:17:48 PM4/26/11
to openhab
On Apr 27, 1:07 am, rlougher <rob.loug...@gmail.com> wrote:
> Hi Andrew,
>
> On Apr 26, 10:30 pm, Andrew Peebles <peeb...@cortina-systems.com>
> wrote:
>
> > I tried jamvm 1.5.4 built and running under Ubuntu 10.04 on x86.  This
> > version already contains the "patch" for getAnnotation.  And this
> > version dumps core.  I was able to use gdb to get a stack trace:
>
> > Core was generated by `jamvm -Declipse.ignoreApp=true
> > -Dosgi.noShutdown=true -D32 -Djetty.home=. -Dlog'.
> > Program terminated with signal 11, Segmentation fault.
> > #0  getMethodParameterAnnotations (mb=0x69007400631b1d) at reflect.c:811
> > 811         if(mb->annotations == NULL || mb->annotations->parameters ==
> > NULL)
>
> Bugger.  You're hitting all the annotation bugs I've fixed over the
> last 15 months (which is why I really need to do a new GNU Classpath
> release).
>
> I believe you're hitting this:
>
> http://cvs.berlios.de/cgi-bin/viewvc.cgi/jamvm/jamvm/src/natives.c?r1...
>
> This is a one line change.
>
> I see you tried to build the CVS version, but got errors.  So I've
> tried checking out from CVS and building with ecj and javac, and both
> work for me.  I guess you've got installed a prebuilt package of GNU
> Classpath.  This puts glibj.zip in a different place (GNU Classpath by
> default has a prefix of /usr/local/classpath, i.e. glibj.zip is /usr/
> local/classpath/share/classpath/glibj.zip, but Ubuntu installs in /
> usr).
>
> You could configure JamVM with the preinstalled prefix:
>
> ./configure --with-classpath-install-dir=/usr
>
> But this isn't going to help you, as CVS requires GNU Classpath 0.98,
> and I believe 10.04 only has GNU Classpath 0.97?  But you've tried
> JamVM 1.5.4, which also requires 0.98...  So I'm slightly confused
> about which version of GNU Classpath do you have?
>

Replying to my own post... Ubuntu 10.04 (lucid lynx) has GNU
Classpath 0.98, so you should be OK.

CVS doesn't contain auto-generated files, so you actually need to run
autogen.sh, and give it the the parameters you would give configure.

Rob.

Andrew Peebles

unread,
Apr 26, 2011, 9:22:11 PM4/26/11
to ope...@googlegroups.com

I am building gnu classpath from source: 0.98. I am pointing to this
install path when building jamvm:

peebles@bahamut[500]> jamvm -version
java version "1.5.0"
JamVM version 1.5.4
Copyright (C) 2003-2010 Robert Lougher <r...@jamvm.org.uk>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2,
or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

Build information:

Execution Engine: switch-based interpreter
Compiled with: gcc 4.4.3

Boot Library Path: /work/bahamut/peebles/native-jamvm/lib/classpath
Boot Class Path:
/work/bahamut/peebles/native-jamvm/share/jamvm/classes.zip:/work/bahamut/peebles/native-jamvm/share/classpath/glibj.zip


> BTW, the release versions of JamVM contains a prebuilt classes.zip, to
> make building and installation easier, and if it's any consolation,
> building JamVM/Classpath is a lot easier than building OpenJDK...

I didn't realize that. I can try re-downloading and using the pre-built
... ok, did that, using 1.5.4:

Core was generated by `jamvm -Declipse.ignoreApp=true
-Dosgi.noShutdown=true -D32 -Djetty.home=. -Dlog'.
Program terminated with signal 11, Segmentation fault.

#0 getMethodParameterAnnotations (mb=0x2ade30c60818) at reflect.c:820
820 READ_U1(no_params, data_ptr, data_len);

Now, I am using classpath 0.98 that I built and jamvm 1.5.4 that I
built, and classes.zip from a clean download of 1.5.4.

I should perhaps re-state ... my ultimate target is to use jamvm 1.5.3.
I've tried 1.5.4 cross compiled for arm (cortex A9), and it bombs
loading class files from zip archives. Our developers say this is a
"known problem" and suggested I use 1.5.3. Also, 1.5.3 is the default
package available in Ubuntu.

I am using 1.5.4 (built by me) only to validate the annotation issue.

a

Andrew Peebles

unread,
Apr 26, 2011, 9:25:00 PM4/26/11
to ope...@googlegroups.com
I did that (autogen). Still:

11. ERROR in ./java/lang/reflect/Method.java (at line 272)
Modifier.toString(getModifiers(), sb).append(' ');
^^^^^^^^
The method toString(int, CPStringBuilder) in the type Modifier is not
applicable for the arguments (int, StringBuffer)

The command that failed was:

ecj -bootclasspath
/work/bahamut/peebles/native-jamvm/share/classpath/glibj.zip -d classes
./jamvm/java/lang/JarLauncher.java ./java/lang/VMRuntime.java
./java/lang/VMClassLoader.java ./java/lang/VMString.java
./java/lang/VMThread.java ./java/lang/VMThrowa le.java
./java/lang/reflect/Constructor.java ./java/lang/reflect/Field.java
./java/lang/reflect/Method.java ./java/security/VMAccessController.java
./gnu/classpath/VMSystemProperties.java ./gnu/classpath/VMStackWalker.java

and

peebles@bahamut[524]> ecj -version
Eclipse Java Compiler 0.972_R35x, 3.5.1 release, Copyright IBM Corp
2000, 2009. All rights reserved.

rlougher

unread,
Apr 27, 2011, 6:06:17 AM4/27/11
to openhab
On Apr 27, 2:25 am, Andrew Peebles <peeb...@cortina-systems.com>
wrote:

> The method toString(int, CPStringBuilder) in the type Modifier is not
> applicable for the arguments (int, StringBuffer)
>
> The command that failed was:
>
> ecj -bootclasspath
> /work/bahamut/peebles/native-jamvm/share/classpath/glibj.zip -d classes
> ./jamvm/java/lang/JarLauncher.java ./java/lang/VMRuntime.java
> ./java/lang/VMClassLoader.java ./java/lang/VMString.java
> ./java/lang/VMThread.java ./java/lang/VMThrowa le.java
> ./java/lang/reflect/Constructor.java ./java/lang/reflect/Field.java
> ./java/lang/reflect/Method.java ./java/security/VMAccessController.java
> ./gnu/classpath/VMSystemProperties.java ./gnu/classpath/VMStackWalker.java
>

Now I really am confused. I didn't notice it yesterday, but you've
got a very odd mismatch. JamVM from CVS should not be building java/
lang/reflect/Constructor, Method or Field. These were replaced with
java/lang/reflect/VMConstructor, VMMethod and VMField (part of the
changes in Classpath 0.98).

Please checkout a clean version of JamVM from CVS and run autogen.sh,
and then make.

Rob.

rlougher

unread,
Apr 27, 2011, 6:11:27 AM4/27/11
to openhab


On Apr 27, 11:06 am, rlougher <rob.loug...@gmail.com> wrote:
> On Apr 27, 2:25 am, Andrew Peebles <peeb...@cortina-systems.com>
> wrote:
>
> > The method toString(int, CPStringBuilder) in the type Modifier is not
> > applicable for the arguments (int, StringBuffer)
>
> > The command that failed was:
>
> > ecj -bootclasspath
> > /work/bahamut/peebles/native-jamvm/share/classpath/glibj.zip -d classes
> > ./jamvm/java/lang/JarLauncher.java ./java/lang/VMRuntime.java
> > ./java/lang/VMClassLoader.java ./java/lang/VMString.java
> > ./java/lang/VMThread.java ./java/lang/VMThrowa le.java
> > ./java/lang/reflect/Constructor.java ./java/lang/reflect/Field.java
> > ./java/lang/reflect/Method.java ./java/security/VMAccessController.java
> > ./gnu/classpath/VMSystemProperties.java ./gnu/classpath/VMStackWalker.java
>

This is the command you should get building from CVS:

ecj -bootclasspath /usr/local/classpath/share/classpath/glibj.zip -d
classes ./jamvm/java/lang/JarLauncher.java ./jamvm/java/lang/
VMClassLoaderData.java ./jamvm/ThreadInfoHelper.java ./java/lang/
VMRuntime.java ./java/lang/VMClass.java ./java/lang/
VMClassLoader.java ./java/lang/VMString.java ./java/lang/
VMThread.java ./java/lang/VMThrowable.java ./java/lang/reflect/
VMConstructor.java ./java/lang/reflect/VMField.java ./java/lang/
reflect/VMMethod.java ./java/security/VMAccessController.java ./gnu/
classpath/VMSystemProperties.java ./sun/reflect/annotation/
AnnotationInvocationHandler.java ./gnu/classpath/VMStackWalker.java

Andrew Peebles

unread,
Apr 27, 2011, 11:20:33 AM4/27/11
to ope...@googlegroups.com
I cut-n-pasted the cvs commands shown on the web at :
http://sourceforge.net/scm/?type=cvs&group_id=75148

cvs -d:pserver:anon...@jamvm.cvs.sourceforge.net:/cvsroot/jamvm login
cvs -z3 -d:pserver:anon...@jamvm.cvs.sourceforge.net:/cvsroot/jamvm co
-P jamvm

peebles@bahamut[84]> ls -l jamvm/lib/java/lang/reflect/
total 68
drwxr-xr-x 2 peebles uucp 4096 Apr 27 08:17 CVS/
-r--r--r-- 1 peebles uucp 10731 Apr 4 2006 Constructor.java
-r--r--r-- 1 peebles uucp 28751 Apr 4 2006 Field.java
-r--r--r-- 1 peebles uucp 103 Sep 4 2005 Makefile.am
-r--r--r-- 1 peebles uucp 12616 Apr 4 2006 Method.java

So ... what's the deal?

a

Andrew Peebles

unread,
Apr 27, 2011, 12:22:21 PM4/27/11
to ope...@googlegroups.com
The only other CVS repo for jamvm I could find on the net was this:
http://developer.berlios.de/cvs/?group_id=6545
I did a checkout from there ... the VM* files are present, so I did a
build and get:

peebles@bahamut[124]> jamvm -version
java version "1.5.0"
JamVM version 1.5.5-devel


Copyright (C) 2003-2010 Robert Lougher <r...@jamvm.org.uk>

Looks good? So I try and get a couple of errors. First, while openhab
is coming up:

peebles@bahamut[123]> sh start.sh
Launching the openHAB runtime...

osgi> Configuring the default jetty server with

file:/work/bahamut/peebles/g2-36-x86/openhab/openhab-runtime/./etc/jetty.xml


osgi> 09:13:49.972 WARN org.eclipse.jetty.util.log[:40] - FAILED
org.eclipse.jetty.server.NCSARequestLog@ea03b978:
java.lang.StackOverflowError
09:13:50.012 WARN org.eclipse.jetty.util.log[:40] - FAILED
RequestLogHandler@ea774d40: java.lang.StackOverflowError
09:13:50.012 WARN org.eclipse.jetty.util.log[:40] - FAILED
HandlerCollection@ea66f940: java.lang.StackOverflowError
09:13:50.034 WARN org.eclipse.jetty.util.log[:50] - Error starting handlers
java.lang.StackOverflowError: null
at
java.lang.AbstractStringBuffer.<init>(AbstractStringBuffer.java:107)
at java.lang.StringBuilder.<init>(StringBuilder.java:119)
at java.util.Calendar.<init>(Calendar.java:533)
at java.util.GregorianCalendar.<init>(GregorianCalendar.java:237)
at java.util.GregorianCalendar.<init>(GregorianCalendar.java:224)
at java.util.GregorianCalendar.<init>(GregorianCalendar.java:212)
at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:455)
at java.text.DateFormat.computeInstance(DateFormat.java:556)
at java.text.DateFormat.getDateTimeInstance(DateFormat.java:711)
at java.text.DateFormat.getDateTimeInstance(DateFormat.java:681)
at
java.util.logging.SimpleFormatter.format(SimpleFormatter.java:106)
Returning defaultJettyServer =
org.eclipse.jetty.osgi.boot.internal.serverfactory.ServerInstanceWrapper@ea9b7ad8
java.io.FileNotFoundException:
/work/bahamut/peebles/g2-36-x86/openhab/openhab-runtime/server/plugins/org.eclipse.jetty.osgi.httpservice_7.1.6.v20100715.jar/contexts/httpservice.xml
at java.io.FileInputStream.<init>(FileInputStream.java:121)
at
org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleDeployerHelper.registerContext(WebBundleDeployerHelper.java:347)
at
org.eclipse.jetty.osgi.boot.internal.webapp.WebBundleDeployerHelper.registerContext(WebBundleDeployerHelper.java:308)
(...)

Than, after that settles down:

osgi> ss org.openhab

Framework is launched.

id State Bundle
159 ACTIVE org.openhab.config.core_0.7.0.201104251350
160 ACTIVE org.openhab.core_0.7.0.201104251350
161 ACTIVE org.openhab.core.library_0.7.0.201104251350
162 ACTIVE org.openhab.core.rules_0.7.0.201104251350
163 ACTIVE org.openhab.core.transform_0.7.0.201104251350
164 ACTIVE org.openhab.io.console_0.7.0.201104251350
165 ACTIVE org.openhab.io.monitor_0.7.0.201104251350
166 ACTIVE org.openhab.io.multimedia_0.7.0.201104251350
167 ACTIVE org.openhab.io.net_0.7.0.201104251350
168 ACTIVE org.openhab.model.core_0.7.0.201104251350
169 RESOLVED org.openhab.model.item_0.7.0.201104251350
170 RESOLVED org.openhab.model.sitemap_0.7.0.201104251350
171 ACTIVE org.openhab.ui_0.7.0.201104251350
172 ACTIVE org.openhab.ui.webapp_0.7.0.201104251350

osgi> start 169

Caused by: com.google.inject.internal.ComputationException:
com.google.inject.internal.ComputationException:
java.lang.IllegalArgumentException: No owner type for enclosed interface
org.eclipse.xtext.util.PolymorphicDispatcher$ErrorHandler
at
com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
at
com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419)
at
com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
at com.google.inject.internal.FailableCache.get(FailableCache.java:46)
at
com.google.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:52)
at
com.google.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:57)
at
com.google.inject.InjectorImpl.initializeBinding(InjectorImpl.java:377)
at
com.google.inject.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:645)
at
com.google.inject.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:581)
at
com.google.inject.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:172)
at
com.google.inject.InjectorImpl.getBindingOrThrow(InjectorImpl.java:132)
at
com.google.inject.InjectorImpl.getInternalFactory(InjectorImpl.java:651)
at com.google.inject.FactoryProxy.notify(FactoryProxy.java:48)
at
com.google.inject.BindingProcessor.runCreationListeners(BindingProcessor.java:230)
at
com.google.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:131)
at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:105)
at com.google.inject.Guice.createInjector(Guice.java:92)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at
org.openhab.model.ItemsStandaloneSetupGenerated.createInjector(ItemsStandaloneSetupGenerated.java:55)
at
org.openhab.model.ItemsStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(ItemsStandaloneSetupGenerated.java:49)
at
org.openhab.model.item.internal.ItemModelActivator.start(ItemModelActivator.java:44)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
at
java.security.AccessController.doPrivileged(AccessController.java:154)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
...12 more
Caused by: com.google.inject.internal.ComputationException:
java.lang.IllegalArgumentException: No owner type for enclosed interface
org.eclipse.xtext.util.PolymorphicDispatcher$ErrorHandler
at
com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553)
(...)

rlougher

unread,
Apr 27, 2011, 4:38:09 PM4/27/11
to openhab
On Apr 27, 4:20 pm, Andrew Peebles <peeb...@cortina-systems.com>
wrote:
>
> I cut-n-pasted the cvs commands shown on the web at :http://sourceforge.net/scm/?type=cvs&group_id=75148
>

Ah yes, sorry. I forgot to mention that you should use the CVS
repository on BerliOS, not Sourceforge. I moved it in 2005 due to
continued outages in sourceforge CVS service. But BerliOS only has
download servers in Berlin, so I've kept sourceforge for releases (and
there's no easy way to remove CVS). Confusing, yes, but blame
sourceforge.

Rob.

> cvs -d:pserver:anonym...@jamvm.cvs.sourceforge.net:/cvsroot/jamvm login
> cvs -z3 -d:pserver:anonym...@jamvm.cvs.sourceforge.net:/cvsroot/jamvm co

Andrew Peebles

unread,
Apr 28, 2011, 11:53:55 AM4/28/11
to ope...@googlegroups.com
So ... we appear to be stuck here. Suggestions?
a

Kai

unread,
Apr 28, 2011, 12:13:19 PM4/28/11
to openhab
>   So ... we appear to be stuck here.  Suggestions?

Looks indeed a bit stuck. I cannot really tell whether this is a
problem in Google Guice, Xtext, JamVM or GNU Classpath... but I am
almost sure it has nothing to do with openHAB.

What I have found on the web is this (though I am not at all sure that
this is related): http://code.google.com/p/google-guice/issues/detail?id=293
It sounds to me as if the Guice guys have adapted Guice to work with
the Sun JDK, in which they have identified a bug. This could mean that
Guice is not compatible with GNU Classpath, which might not have the
same bug as the Sun JDK. Does this make any sense? But even if, I
don't have a clue how to get further here...

Kai

Andrew Peebles

unread,
May 3, 2011, 12:34:36 PM5/3/11
to ope...@googlegroups.com
Ok. I am dropping this pursuit for now. Bummer.
a

Andrew Peebles

unread,
May 11, 2011, 8:34:29 PM5/11/11
to ope...@googlegroups.com
Someone pointed me at Java SE for Embedded, on the Oracle web site:


http://www.oracle.com/technetwork/java/javame/embedded/overview/getstarted/index.html

There are some obvious licensing issues for any kind of deployment, but
its free for development. Looks promising, but ...

The package size for this is about 26Mb. Compare this with
jamvm+gnu-classpath at 8.5Mb. The Oracle thing won't fit on my flash
(the Oracle package I downloaded is for arm, so I can't try it out on
x86 first). I may try to build an external disk rootfs image and boot
off of USB, but that'll take some time.

However, my biggest concern is the size of openhab ... coming in at a
hefty 40Mb. I didn't notice this before, as I was eval'ing on x86, but
I noticed now that I am trying to deploy on flash. That's awfully big
for what it does, no? Its 56 times the size of the next largest package
(samba, binary) on my embedded system.

a

Kai

unread,
May 12, 2011, 3:59:55 PM5/12/11
to openhab
Hi Andrew,

> Someone pointed me at Java SE for Embedded, on the Oracle web site:
> The package size for this is about 26Mb.  Compare this with
> jamvm+gnu-classpath at 8.5Mb.

Yeah, I had seen this as well, but also thought that it is pretty big
in comparison to JamVM.

> However, my biggest concern is the size of openhab ... coming in at a
> hefty 40Mb.

Yes, that's indeed far too big for what it does - the problem are
mainly Xtext and Drools which both draw in quite some dependencies.
The Equinox runtime and the openHAB bundles alone should be much
leaner. Nonetheless, it should be possible to remove a view bundles
without impacting any functionality, see a discussion I had with
Wolfgang here: http://groups.google.com/group/openhab/msg/89a682174a48c956.
But to really have a small runtime (meaning maybe around 10-15 MB), we
would have to strip off Xtext and Drools, meaning that we would need a
replacement for their functionality.

Andrew Peebles

unread,
May 13, 2011, 6:01:24 PM5/13/11
to ope...@googlegroups.com
Ok, Oracle's Java SE for Embedded for arm 6/7 and OpenHAB seem to work
nicely together. All the components seem to be up and running and I can
connect my browser to the openhap.app sitemap=demo. I am using a
PandaBoard, with the TI OMAP4 arm processor and running OpenWRT for
kernel/rootfs.

Now ... can anyone recommend the next step(s) toward live demo? I was
thinking of getting a KNX hub, with ethernet to my system, and then a
couple of devices hanging off the KNX bus ... a switch say, for turning
off/on a light. A nice simple bill of materials, from someone who's
using this sort of thing with OpenHAB. I am not tied to KNX ... any of
the protocols supported would be fine, except I really want to control
the hub through ethernet.

Of course, I can do some research ... I'm looking for the easy way out.

a

Andrew Peebles

unread,
May 13, 2011, 6:08:51 PM5/13/11
to ope...@googlegroups.com
On 05/12/2011 12:59 PM, Kai wrote:
I am not a Java dude ... so I ask, isn't there something capable of
busting up jars, taking a main program and by tracing dependencies,
reconstruct the jars with the minimal set of dependencies? For a stand
alone application, where it is the only Java program running on a
system, such an optimizer would be very handy, esp. for embedded
systems. I cannot be the first person to think of this ...

a

iwow

unread,
May 15, 2011, 3:24:02 PM5/15/11
to openhab
Hi Andrew,

as Kai already mentioned I am working on a openhab version for my
embedded Linux system (Seagate Docstar, 1 GHz ARM CPU, 128 MB RAM). It
is not as easy as you might think. OSGI, Xtext and Drools are integral
part of the openhab core system.

I have already reduced the count of plug-ins from over 100 to 60. I am
now working to replace Xtext with ecore-xmi and use precompiled rules
for drools, but this will take same more time...

Wolfgang

Kai

unread,
May 17, 2011, 4:06:00 PM5/17/11
to openhab
> Ok, Oracle's Java SE for Embedded for arm 6/7 and OpenHAB seem to work
> nicely together.

That's good news!

> Now ... can anyone recommend the next step(s) toward live demo? [...] a switch say, for turning off/on a light.

Hm, that very much depends on what you want to do with the live demo.
Just for playing around, the required KNX hardware will be far too
expensive - that would only make sense if you plan to use more KNX
devices productively later on.

The simplest solution to switch a light is probably an IP-socket like
http://www.computeruniverse.net/products/e90289060/d2/specifications/allnet-all3075-netzwerksteckdose.asp.
You give it an IP address and can then use the HTTP-out binding of
openHAB to do an HTTP request to the device, when you send commands.
To connect a simple button to openHAB, I had used the serial binding
for demos, for which you would only need a USB-RS232-cable for a few
bucks.

Kai

Andrew Peebles

unread,
May 17, 2011, 4:28:05 PM5/17/11
to ope...@googlegroups.com
Thanks for the tips ... I will explore these options.
a

Andrew Peebles

unread,
May 24, 2011, 5:18:00 PM5/24/11
to ope...@googlegroups.com
On 05/17/2011 01:06 PM, Kai wrote:
Ok, I bought a http-controllable power strip. To try to test it with
openhab quickly, I edited demo.items, changing the Gf_Toilet to:

Group GF_Toilet "Toilet" <bath> {
http=">[ON:POST:http://admin:12...@192.168.0.200/outlet?1=ON]
>[OFF:POST:http://admin:12...@192.168.0.200/outlet?1=OFF]" }

But when I launch openhab, I see

22:13:55.755 ERROR o.o.m.i.i.GenericItemProvider[:132] - Binding
information of type 'http' for item ?GF_Toilet? could not be pa.
org.openhab.model.item.binding.BindingConfigParseException: couldn't
create Command from 'ON'
at
org.openhab.binding.http.internal.HttpGenericBindingProvider.createCommandFromString(HttpGenericBindingProvider.java:)
at
org.openhab.binding.http.internal.HttpGenericBindingProvider.parseOutBindingConfig(HttpGenericBindingProvider.java:21)
at
org.openhab.binding.http.internal.HttpGenericBindingProvider.parseBindingConfig(HttpGenericBindingProvider.java:129)
at
org.openhab.binding.http.internal.HttpGenericBindingProvider.processBindingConfiguration(HttpGenericBindingProvider.j)
at
org.openhab.model.item.internal.GenericItemProvider.dispatchBindings(GenericItemProvider.java:130)
at
org.openhab.model.item.internal.GenericItemProvider.getItems(GenericItemProvider.java:108)
at
org.openhab.core.internal.items.ItemRegistryImpl.allItemsChanged(ItemRegistryImpl.java:184)
at
org.openhab.core.internal.items.ItemRegistryImpl.removeItemProvider(ItemRegistryImpl.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

It doesn't seem to like my "ON" command ...

out:http:">[<command>:<httpmethod>:<url>]"

So ... exactly what is a <command>? From the wiki doc, I might have
(and did) assume that ON and OFF meant something, but perhaps they need
to be defined/bound somewhere. Available doc doesn't seem to give a hint.

??
a


Andrew Peebles

unread,
May 24, 2011, 5:58:59 PM5/24/11
to ope...@googlegroups.com
Sorry for the chatter. I realized at least part of my problem. So I've
changed demo.items to

Switch Light_GF_Toilet_Mirror "Mirror" (GF_Toilet,
Lights) { http=">[ON:POST:http://admin:12...@192.168.0.200/outlet?1=ON]

Now, no complaints. Switch shows up correctly in GUI. When I turn it
on and off, nothing happens, but I see in the log:

Jan 7, 2000 11:06:55 PM org.apache.commons.httpclient.HttpMethodBase
getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using
getResponseBodyAsStream instead is recommended.
23:06:55.343 WARN o.a.c.h.HttpMethodBase[:99] - Going to buffer
response body of large or unknown size. Using getResponseBodyAs.
23:06:55.346 INFO o.o.i.m.internal.EventLogger[:43] -
Light_GF_Toilet_Mirror received command ON

The unix command line

curl http://admin:12...@192.168.0.200/outlet?1=ON

works.

Seems like I might be close ...

a

Andrew Peebles

unread,
May 24, 2011, 8:31:51 PM5/24/11
to ope...@googlegroups.com
Using wireshark, then adding

<logger name="org.openhab.binding.http.internal">
<level value="DEBUG" />
</logger>

I find that the credentials are being stripped from the url:

01:26:37.648 DEBUG o.o.b.http.internal.HttpUtil[:92] - About to
execute 'http://192.168.0.200/outlet/?1=ON'

Even though my demo.items contains:

Switch Light_GF_Toilet_Mirror "Mirror" (GF_Toilet,
Lights) { http=">[ON:GET:http://admin:12...@192.168.0.200/outlet/?1=ON]
>[OFF:GET:http://admin:12...@192.168.0.200/outlet/?1=OFF]" }

I can see in wireshark, the request sent from openhab is missing the
credentials, while a request set from curl has them. I am looking at
HttpUtil.java from the source tree, and it looks like it should support
credentials, but .... maybe the binary package from openhab.org does
not? Was this a recent change?

a

Andrew Peebles

unread,
May 25, 2011, 2:03:09 PM5/25/11
to ope...@googlegroups.com
I tried 0.7.0 and get the same behavior ... the credentials are not
being passed. Can anyone confirm that this is a real problem in the
code base?
a

Eichstädt-Engelen Thomas

unread,
May 25, 2011, 3:06:54 PM5/25/11
to ope...@googlegroups.com
Hi Andrew,

On 25.05.2011, at 20:03, Andrew Peebles wrote:

> I tried 0.7.0 and get the same behavior ... the credentials are not being passed. Can anyone confirm that this is a real problem in the code base?

sorry for the late answer and thanks for all your investigations. I am looking deeper into the code right now. Unfortunately i sold my MuiscPal which was configurable via HTTP a few weeks ago so debugging will be difficult. I'll come back to you as soon as possible.

Cheers,

Thomas E.-E.

Eichstädt-Engelen Thomas

unread,
May 25, 2011, 4:09:44 PM5/25/11
to ope...@googlegroups.com
Hi Andrew,

first quick response:


On 25.05.2011, at 20:03, Andrew Peebles wrote:

>> I find that the credentials are being stripped from the url:
>>
>> 01:26:37.648 DEBUG o.o.b.http.internal.HttpUtil[:92] - About to execute 'http://192.168.0.200/outlet/?1=ON'

The given log statement is incomplete. Currently we do log only the URI from the HTTPMethod which has no knowledge about the State of the HTTPClient which carries out the credentials. So there is no code to strip of the credentials.

Looking further to see why the login doesn't work ...

Cheers,

Thomas E.-E.

Andrew Peebles

unread,
May 25, 2011, 4:32:56 PM5/25/11
to ope...@googlegroups.com
I double checked using wireshark. The HTTP requests from OpenHAB are
missing the authentication headers. I compared using wireshark with
"curl" command lines, and then I see the authentication headers.

a

Eichstädt-Engelen Thomas

unread,
May 25, 2011, 4:36:44 PM5/25/11
to ope...@googlegroups.com
ah, ok, thanks for the information (you said that already - missed that)


On 25.05.2011, at 22:32, Andrew Peebles wrote:

> --
> You received this message because you are subscribed to the Google Groups "openhab" group.
> To post to this group, send email to ope...@googlegroups.com.
> To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
>

Andrew Peebles

unread,
May 25, 2011, 5:05:19 PM5/25/11
to ope...@googlegroups.com
On 05/25/2011 01:36 PM, Eichst�dt-Engelen Thomas wrote:
> ah, ok, thanks for the information (you said that already - missed that)
>
>
> On 25.05.2011, at 22:32, Andrew Peebles wrote:
>
>> On 05/25/2011 01:09 PM, Eichst�dt-Engelen Thomas wrote:
>>> Hi Andrew,
>>>
>>> first quick response:
>>>
>>>
>>> On 25.05.2011, at 20:03, Andrew Peebles wrote:
>>>
>>>>> I find that the credentials are being stripped from the url:
>>>>>
>>>>> 01:26:37.648 DEBUG o.o.b.http.internal.HttpUtil[:92] - About to execute 'http://192.168.0.200/outlet/?1=ON'
>>> The given log statement is incomplete. Currently we do log only the URI from the HTTPMethod which has no knowledge about the State of the HTTPClient which carries out the credentials. So there is no code to strip of the credentials.
>>>
>>> Looking further to see why the login doesn't work ...
>>>
>>> Cheers,
>>>
>>> Thomas E.-E.
>>>
>> I double checked using wireshark. The HTTP requests from OpenHAB are missing the authentication headers. I compared using wireshark with "curl" command lines, and then I see the authentication headers.
>>
>> a
>>
>> --
>> You received this message because you are subscribed to the Google Groups "openhab" group.
>> To post to this group, send email to ope...@googlegroups.com.
>> To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/openhab?hl=en.
>>
How come, when I obtain the source and compile it myself using mvn, and
untar the resulting distribution-0.7.0-SNAPSHOT-runtime.zip onto my
target, and try to connect to the demo sitemap (
http://localhost:8080/openhab.app?sitemap=demo ), I get this error:

03:07:19.707 WARN org.eclipse.jetty.util.log[:50] - /openhab.app
org.openhab.ui.webapp.render.RenderException: Sitemap 'demo' could not
be found
at
org.openhab.ui.webapp.internal.servlet.WebAppServlet.service(WebAppServlet.java:165)
at
org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
at
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:423)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:866)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)

This does not happen with the binary distribution ( 0.7.0 )

Things look like they're in the same places ... in particular
configurations/sitemaps/demo.sitemap.

a

Andrew Peebles

unread,
May 25, 2011, 5:08:11 PM5/25/11
to ope...@googlegroups.com
Oh, and BTW, openhab itself *is* finding the sitemap:

03:05:27.423 INFO o.o.m.s.i.SitemapModelActivator[:44] - Registered
'sitemap' configuration parser
2000-01-01 03:05:28.155 Warning: org.osgi.service.cm.ManagedService
already registered for service.pid=org.openhab.folder
03:05:34.457 INFO o.o.m.c.i.f.FolderObserver[:158] - Loaded file
'demo.sitemap'
03:05:34.561 INFO o.o.m.c.i.f.FolderObserver[:158] - Loaded file
'demo.items'

Eichstädt-Engelen Thomas

unread,
May 25, 2011, 5:11:21 PM5/25/11
to ope...@googlegroups.com

could you please apply the following patch to HttpUtil.java

diff -r 32eff306b378 bundles/binding/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/HttpUtil.java
--- a/bundles/binding/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/HttpUtil.java Mon May 23 23:54:53 2011 +0200
+++ b/bundles/binding/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/HttpUtil.java Wed May 25 22:57:19 2011 +0200
@@ -84,6 +84,7 @@

Credentials credentials = extractCredentials(url);
if (credentials != null) {
+ client.getParams().setAuthenticationPreemptive(true);
client.getState().setCredentials(AuthScope.ANY, credentials);
}

this should add the authentication headers to your login-request. Does it?

Cheers,

Thomas E.-E.


Begin forwarded message:

Andrew Peebles

unread,
May 25, 2011, 5:15:07 PM5/25/11
to ope...@googlegroups.com
On 05/25/2011 02:11 PM, Eichst�dt-Engelen Thomas wrote:
> could you please apply the following patch to HttpUtil.java
>
> diff -r 32eff306b378 bundles/binding/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/HttpUtil.java
> --- a/bundles/binding/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/HttpUtil.java Mon May 23 23:54:53 2011 +0200
> +++ b/bundles/binding/org.openhab.binding.http/src/main/java/org/openhab/binding/http/internal/HttpUtil.java Wed May 25 22:57:19 2011 +0200
> @@ -84,6 +84,7 @@
>
> Credentials credentials = extractCredentials(url);
> if (credentials != null) {
> + client.getParams().setAuthenticationPreemptive(true);
> client.getState().setCredentials(AuthScope.ANY, credentials);
> }
>
> this should add the authentication headers to your login-request. Does it?
>
> Cheers,
>
> Thomas E.-E.

I cannot seem to build the the source. See my previous post ...
a


>
> Begin forwarded message:


>
>> From: Eichst�dt-Engelen Thomas<teic...@gmail.com>
>> Date: 25. Mai 2011 22:36:44 MESZ
>> To: ope...@googlegroups.com
>> Subject: Re: [openhab] Re: missing UserCredentials when using HTTP-Out-Binding
>>
>> ah, ok, thanks for the information (you said that already - missed that)
>>
>>
>> On 25.05.2011, at 22:32, Andrew Peebles wrote:
>>

Eichstädt-Engelen Thomas

unread,
May 25, 2011, 5:18:28 PM5/25/11
to ope...@googlegroups.com
please use (for now) the binary dist and do only replace the HTTP-binding-jar with your own one. That should save some time right now ...

Andrew Peebles

unread,
May 25, 2011, 6:21:17 PM5/25/11
to ope...@googlegroups.com

What file is the "HTTP-binding-jar" ?
a

Andrew Peebles

unread,
May 25, 2011, 9:18:57 PM5/25/11
to ope...@googlegroups.com
I cannot for the life of me find the physical .jar file that contains
the changes I made to HttpUtil.java!!!
a

Eichstädt-Engelen Thomas

unread,
May 26, 2011, 5:13:18 AM5/26/11
to ope...@googlegroups.com
Hi,

assuming you are using a Linux based build system and you called

export MAVEN_OPTS=-Xmx512m
<path2maven>/apache-maven-3.0.2/bin/mvn clean install

in the root directory (/openhab)

there should be a directory called "target" at <>/openhab/bundles/binding/org.openhab.bindings.http/. You should find a file called http-0.7.0-SNAPSHOT.jar there.

Cheers,

Thomas E.-E.


On 26.05.2011, at 03:18, Andrew Peebles wrote:

> On 05/25/2011 03:21 PM, Andrew Peebles wrote:

>> On 05/25/2011 02:18 PM, Eichstädt-Engelen Thomas wrote:
>>> please use (for now) the binary dist and do only replace the HTTP-binding-jar with your own one. That should save some time right now ...
>>>
>>>
>>> On 25.05.2011, at 23:15, Andrew Peebles wrote:
>>>
>>>> I cannot seem to build the the source. See my previous post ...
>>
>> What file is the "HTTP-binding-jar" ?
>> a
>>
> I cannot for the life of me find the physical .jar file that contains the changes I made to HttpUtil.java!!!
> a
>

Andrew Peebles

unread,
May 26, 2011, 11:24:37 AM5/26/11
to ope...@googlegroups.com
On 5/26/11 2:13 AM, Eichst�dt-Engelen Thomas wrote:
> Hi,
>
> assuming you are using a Linux based build system and you called
>
> export MAVEN_OPTS=-Xmx512m
> <path2maven>/apache-maven-3.0.2/bin/mvn clean install
>
> in the root directory (/openhab)
>
> there should be a directory called "target" at<>/openhab/bundles/binding/org.openhab.bindings.http/. You should find a file called http-0.7.0-SNAPSHOT.jar there.
>

Yes, I found that. But in the binary distribution which I have installed and am runnig from, there is no bundles dir, nor is there a http-0.7.0-snapshot.jar anywhere. So I don't know where to place the new file in the binary distribution. I am not a java dude... It's not my favorite language to deal with. You're gonna have to hold my hand here .... Tell me exactly what to copy and to where. Yes, I am all Linux.

I very much appreciate all your help. I've been trying to get this thing to work now for weeks. I want it to work, its very cool.

A


> Cheers,
>
> Thomas E.-E.
>
>
> On 26.05.2011, at 03:18, Andrew Peebles wrote:
>
>> On 05/25/2011 03:21 PM, Andrew Peebles wrote:

Thomas Eichstädt-Engelen

unread,
May 26, 2011, 11:36:45 AM5/26/11
to ope...@googlegroups.com
Look into the addons directory ...

- sent from a mobile device -


Am 26.05.2011 um 17:24 schrieb Andrew Peebles <pee...@cortina-systems.com>:

> On 5/26/11 2:13 AM, Eichstädt-Engelen Thomas wrote:
>> Hi,
>>
>> assuming you are using a Linux based build system and you called
>>
>> export MAVEN_OPTS=-Xmx512m
>> <path2maven>/apache-maven-3.0.2/bin/mvn clean install
>>
>> in the root directory (/openhab)
>>
>> there should be a directory called "target" at<>/openhab/bundles/binding/org.openhab.bindings.http/. You should find a file called http-0.7.0-SNAPSHOT.jar there.
>>
>
> Yes, I found that. But in the binary distribution which I have installed and am runnig from, there is no bundles dir, nor is there a http-0.7.0-snapshot.jar anywhere. So I don't know where to place the new file in the binary distribution. I am not a java dude... It's not my favorite language to deal with. You're gonna have to hold my hand here .... Tell me exactly what to copy and to where. Yes, I am all Linux.
>
> I very much appreciate all your help. I've been trying to get this thing to work now for weeks. I want it to work, its very cool.
>
> A
>
>
>
>
>
>
>> Cheers,
>>
>> Thomas E.-E.
>>
>>
>> On 26.05.2011, at 03:18, Andrew Peebles wrote:
>>
>>> On 05/25/2011 03:21 PM, Andrew Peebles wrote:

Andrew Peebles

unread,
May 26, 2011, 11:50:46 AM5/26/11
to ope...@googlegroups.com
On 5/26/11 8:36 AM, Thomas Eichst�dt-Engelen wrote:
> Look into the addons directory ...
>
> - sent from a mobile device -
>
>

Ah yes, good hint. So it would seem that I should copy

<build_dir>/bundles/binding/org.openhab.binding.http/target/http-0.7.0-SNAPSHOT.jar

to

<runtime_dir>/addons/http-binding-0.7.0.jar

I'll try that and get back to you. Thanks.

a

>
> Am 26.05.2011 um 17:24 schrieb Andrew Peebles<pee...@cortina-systems.com>:
>

>> On 5/26/11 2:13 AM, Eichst�dt-Engelen Thomas wrote:
>>> Hi,
>>>
>>> assuming you are using a Linux based build system and you called
>>>
>>> export MAVEN_OPTS=-Xmx512m
>>> <path2maven>/apache-maven-3.0.2/bin/mvn clean install
>>>
>>> in the root directory (/openhab)
>>>
>>> there should be a directory called "target" at<>/openhab/bundles/binding/org.openhab.bindings.http/. You should find a file called http-0.7.0-SNAPSHOT.jar there.
>>>
>> Yes, I found that. But in the binary distribution which I have installed and am runnig from, there is no bundles dir, nor is there a http-0.7.0-snapshot.jar anywhere. So I don't know where to place the new file in the binary distribution. I am not a java dude... It's not my favorite language to deal with. You're gonna have to hold my hand here .... Tell me exactly what to copy and to where. Yes, I am all Linux.
>>
>> I very much appreciate all your help. I've been trying to get this thing to work now for weeks. I want it to work, its very cool.
>>
>> A
>>
>>
>>
>>
>>
>>
>>> Cheers,
>>>
>>> Thomas E.-E.
>>>
>>>
>>> On 26.05.2011, at 03:18, Andrew Peebles wrote:
>>>
>>>> On 05/25/2011 03:21 PM, Andrew Peebles wrote:

Andrew Peebles

unread,
May 26, 2011, 1:52:07 PM5/26/11
to ope...@googlegroups.com
Patch works! Many, many thanks. I'll be *very* interested to know when
a new binary dist. containing this patch is available. In the mean time
I can combine the new jar with the binary package when building my target.

I am very grateful for your help.

a

Thomas Eichstädt-Engelen

unread,
May 26, 2011, 2:05:19 PM5/26/11
to ope...@googlegroups.com
you are welcome! Many thanks for your patience :-)

- sent from a mobile device -


Am 26.05.2011 um 19:52 schrieb Andrew Peebles <pee...@cortina-systems.com>:

> Patch works! Many, many thanks. I'll be *very* interested to know when a new binary dist. containing this patch is available. In the mean time I can combine the new jar with the binary package when building my target.
>
> I am very grateful for your help.
>
> a
>
> On 05/26/2011 08:50 AM, Andrew Peebles wrote:

>> On 5/26/11 8:36 AM, Thomas Eichstädt-Engelen wrote:
>>> Look into the addons directory ...
>>>
>>> - sent from a mobile device -
>>>
>>>
>>
>> Ah yes, good hint. So it would seem that I should copy
>>
>> <build_dir>/bundles/binding/org.openhab.binding.http/target/http-0.7.0-SNAPSHOT.jar
>>
>> to
>>
>> <runtime_dir>/addons/http-binding-0.7.0.jar
>>
>> I'll try that and get back to you. Thanks.
>>
>> a
>>
>>>
>>> Am 26.05.2011 um 17:24 schrieb Andrew Peebles<pee...@cortina-systems.com>:
>>>

>>>> On 5/26/11 2:13 AM, Eichstädt-Engelen Thomas wrote:
>>>>> Hi,
>>>>>
>>>>> assuming you are using a Linux based build system and you called
>>>>>
>>>>> export MAVEN_OPTS=-Xmx512m
>>>>> <path2maven>/apache-maven-3.0.2/bin/mvn clean install
>>>>>
>>>>> in the root directory (/openhab)
>>>>>
>>>>> there should be a directory called "target" at<>/openhab/bundles/binding/org.openhab.bindings.http/. You should find a file called http-0.7.0-SNAPSHOT.jar there.
>>>>>
>>>> Yes, I found that. But in the binary distribution which I have installed and am runnig from, there is no bundles dir, nor is there a http-0.7.0-snapshot.jar anywhere. So I don't know where to place the new file in the binary distribution. I am not a java dude... It's not my favorite language to deal with. You're gonna have to hold my hand here .... Tell me exactly what to copy and to where. Yes, I am all Linux.
>>>>
>>>> I very much appreciate all your help. I've been trying to get this thing to work now for weeks. I want it to work, its very cool.
>>>>
>>>> A
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Cheers,
>>>>>
>>>>> Thomas E.-E.
>>>>>
>>>>>
>>>>> On 26.05.2011, at 03:18, Andrew Peebles wrote:
>>>>>
>>>>>> On 05/25/2011 03:21 PM, Andrew Peebles wrote:

Kai

unread,
May 26, 2011, 2:07:50 PM5/26/11
to openhab
Hi Andrew,

>  I'll be *very* interested to know when a new binary dist. containing this patch is available.

I will probably provide a new binary build that includes this fix some
when next week.

Regards,
Kai

Kai

unread,
Jun 1, 2011, 2:22:02 AM6/1/11
to openhab
The fix is included in the binary distribution 0.7.1 that has been
released yesterday.

Andrew Peebles

unread,
Jun 1, 2011, 5:38:15 PM6/1/11
to ope...@googlegroups.com
On 05/31/2011 11:22 PM, Kai wrote:
> The fix is included in the binary distribution 0.7.1 that has been
> released yesterday.
>
Got it, thanks.
a
Reply all
Reply to author
Forward
0 new messages