Skip to main content

jxme hello world

6 replies [Last post]
henrik_grosen
Offline
Joined: 2007-02-23

I am considering writing my master thesis around jxta / jxme.

I have run through all the tutorial examples for jxta j2se without any problems, but I simply cannot get jxme (proxyless) working, even basically.

The approach that seemed the most straightforward was using netbeans 5.5 with mobility pack 5.5 for CDC, thus what I did :D

Then I created a standard CDC app project on the defaultcolorphone device. Added jxme-cdc.jar and log4j.jar to libraries, so should be good to go.

However when I touch anything in the jxme lib:
either PeerGroupFactory.newNetPeerGroup();
or ConfigurationFactory.setName("myJXME1");

Then i get the following exception:
Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: java.beans.IntrospectionException
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:640)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
at org.apache.log4j.LogManager.(LogManager.java:113)
at java.lang.Class.runStaticInitializers(Class.java:1596)
at org.apache.log4j.Logger.getLogger(Logger.java:85)
at net.jxta.peergroup.PeerGroupFactory.(PeerGroupFactory.java:122)
at java.lang.Class.runStaticInitializers(Class.java:1596)
at jxme1.Peer.startPeer(Peer.java:50)
at jxme1.Main.jButton2ActionPerformed(Main.java:103)
at jxme1.Main.access$100(Main.java:13)
at jxme1.Main$2.actionPerformed(Main.java:53)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1745)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1783)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at com.sun.java.swing.plaf.micro.MicroButtonListener.mouseReleased(MicroButtonListener.java:228)
at java.awt.Component.processMouseEvent(Component.java:3066)
at java.awt.Component.processEvent(Component.java:2895)
at java.awt.Container.processEvent(Container.java:895)
at java.awt.Component.dispatchEventImpl(Component.java:2409)
at java.awt.Component.dispatchEvent(Component.java:2313)
at java.awt.LightweightDispatcher.retargetMouseEvent(LightweightDispatcher.java:237)
at java.awt.LightweightDispatcher.processMouseEvent(LightweightDispatcher.java:113)
at java.awt.LightweightDispatcher.dispatchEvent(LightweightDispatcher.java:50)
at java.awt.Window.dispatchEventImpl(Window.java:233)
at java.awt.Component.dispatchEvent(Component.java:2313)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:295)
at java.awt.EventQueueProxy.dispatchEvent(EventDispatchThread.java:286)
at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:98)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:83)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:74)
at java.lang.Thread.startup(Thread.java:753)

I have tried to locate the error / what im doing wrong, but with no success, any input is highly appreciated!

Another thing... Is there a way to completely remove the log4j dependency? Because the resulting jar for deployment is getting anoyingly large :S

Thnx in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hamada
Offline
Joined: 2003-06-12

I had originally thought some library was conflicted with the log4j included within proxyless JXME, which is not the case. In rereading the exception stack, the issue seems to be caused by a lack of log4j.properties or a misconfiguration within it.

nexus73
Offline
Joined: 2007-07-02

hi,
did you eventually solve the problem?
I am encountering the same on....no way to work it out.

Giuseppe

hamada
Offline
Joined: 2003-06-12

You need to insure the jxme libraries are ahead of the IDE libraries to avoid the log4j conflict.

henrik_grosen
Offline
Joined: 2007-02-23

Not that i doubt your input, but i havent been able to produce a different output by rearranging the order of libs :(

tried:
jxme-cdc.jar -> log4j.jar -> cdc-argui-swing.jar -> Sun java Toolkit 1.0 for Connected Device Configuration

and
log4j.jar -> jxme-cdc.jar -> cdc-argui-swing.jar -> Sun java Toolkit 1.0 for Connected Device Configuration

didnt really do much of a difference :/

Any brilliant suggestions i cant manage to see?

Cant u just remove the log4j dependence completely?

hamada
Offline
Joined: 2003-06-12

try using the project build.xml rather than using netb. it's likely that the netbeans/ide7/ant/lib/ant-apache-log4j.jar is conflicting with JXME's log4j stub.

henrik_grosen
Offline
Joined: 2007-02-23

Thnx for your effort Hamada, it is nice to have a guru care and try to help :D

However, I am not quite sure what u meant...

A few thing does puzzle me further though.
To sum up, when I use the Log4j.jar library I get the following at runtime:
[i]java.lang.NoClassDefFoundError: java.beans.IntrospectionException
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:640)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
......[/i]
What puzzles me here is, that from what i can gather, java.beans.IntrospectionException isnt part of CDC 1.1 (JSR 218), therefore it is kind of strange that it is referenced by log4j.jar which is required.

You refer to "JXME's log4j stub", is that supposed to mean that only the 4kb stub is required for JXME CDC proxyless development? Because only using log4j_stub.jar gives me the following at runtime:
[i]java.lang.NoClassDefFoundError: org.apache.log4j.Priority
at mypackage.MyActiveClass.run(MyActiveClass.java:41)
at java.lang.Thread.run(Thread.java:691)
at java.lang.Thread.startup(Thread.java:753)[/i]

I dont see how ant-apache-log4j.jar can be conflicting with anything in any way, since all it contains is: \org\apache\tools\ant\listener\Log4jListener.class

Im sure its just me who is stupid and cant see the simple/obvious problem. I must admit that log4j isnt the most popular jar on my computer atm :p How i'd love to get rid of that dependency all together!

Any input, whatever it may be is highly appreciated.
Or, even a recipe for a different setup that actually works, something along the lines of an IDE + which tools + config + simple sample app, that actually runs on any emulator.