<< 27-August-2008 : bevinbot on #geronimo at freenode [download] [back] >>
 
 
time nick message

00:59

<akarasulu_>

Hi all, I'm trying to get acquainted with XBean so I can setup MINA with an XSD. Don't want to bother y'all too much here but wondering where it's best to look to find my answers. I don't see much documentation on the site so I was wondering if there's something out there that I'm not aware of. Thanks!

01:00

<akarasulu_>

For example one of my questions is:

01:00

<akarasulu_>

If I have an inheritance hierarchy say Foo implementing Bar and Bar interface has a destroy() method. How do I mark up the Javadocs so Foo.destroy() is called as XBean DestroyMethod?

01:03

<kevan>

akarasulu_: afraid that you won't find a lot of xbean doc. may be that dain could help you

01:03

<akarasulu_>

ahh okie thanks kevan

01:03

<dain>

maybe

01:03

<akarasulu_>

:)

01:03

<akarasulu_>

hiya dain

01:03

<dain>

there isn't much doc beyoned what's on the site

01:04

<akarasulu_>

FYI guys what documentation is online seems to be having some issue it seems: "An error occurred: Connection refused. The system administrator has been notified. "

01:04

<dain>

just saw that

01:04

<kevan>

hmm. what link is that?

01:04

<dain>

let me take a look

01:04

<akarasulu_>

http://geronimo.apache.org/xbean/custom-xml.html

01:04

<akarasulu_>

for example

01:04

<kevan>

hmm. i got it just fine

01:05

<akarasulu_>

kevan, if you search for "error occurred" you'll see where there are some examples that should show no longer do.

01:05

<akarasulu_>

they're replaced with that error message above

01:06

<kevan>

ah. i see

01:07

<akarasulu_>

Is XBean development active?

01:07

<akarasulu_>

Wondering if you guys switched to something else.

01:07

<dain>

akarasulu_: it works in cwiki http://cwiki.apache.org/confluence/display/XB/Custom+XML

01:07

<akarasulu_>

ahh okie thanks

01:09

<akarasulu_>

dain: What do you recommend for a new comer trying to learn how to use XBean beyond these simple cases in the doco? Trying to figure out the best way to learn the ins and outs.

01:09

<dain>

kevan: any idea how to properly format a snippit

01:09

<kevan>

heh. i was waiting for you to show me how... ;-)

01:10

<dain>

I suggest the simple examples + hacking a jnuit test case

01:10

<dain>

assuming you know spring the transalation is pretty simple

01:10

<akarasulu_>

seems XBean has many more features than is shown in the simple examples

01:11

<akarasulu_>

Like for example where do I learn about how inheritance is handled?

01:12

<dain>

what do you mean about inheritance?

01:13

<akarasulu_>

If I have some inheritance hierarchy say Foo implementing Bar and Bar interface has a destroy() method. How do I mark up the Javadocs so Foo.destroy() is called as XBean DestroyMethod?

01:13

<akarasulu_>

Err, rather Bar is a class that is extended by Foo and it has the implementation for the destroy() method?

01:14

<akarasulu_>

do I add XBean tags to the javadocs of Bar ?

01:14

<akarasulu_>

and Foo just inherits it ?

01:16

<dain>

I don't know :)

01:16

<dain>

you'll have to try it

01:18

<akarasulu_>

ok will do

01:18

<akarasulu_>

dain, just a couple questions if you have a minute

01:18

<dain>

I do... been trying to fix the site in another window :)

01:18

<akarasulu_>

ahh okie

01:18

<kevan>

dain are you editing custom xml?

01:19

<dain>

kevan: say what?

01:20

<kevan>

are you updating the custom xml page in the wiki

01:20

<kevan>

better? ;-)

01:20

<akarasulu_>

Just curious, how active is the dev community around XBean?

01:21

<dain>

kevan: no... I think it is fine... I'm trying a new export

01:21

<dain>

akarasulu_: we fix bugs as people find them but not to much new has happened lately

01:21

<akarasulu_>

okie

01:22

<dain>

I need to spend some time to update the code to support an annotation processor, but I've been lazy

01:23

<akarasulu_>

Well I'd be glad to help out with writing some additional documentation if someone would help me lessen this learning curve. I'm afraid if I have to just try every combination or open up the source its going to take me a long while to understand things.

01:23

<dain>

kevan: a fresh export cleaned up the xml http://cwiki.apache.org/XB/custom-xml.html

01:24

<dain>

akarasulu_: I'll help

01:24

<akarasulu_>

thanks dain

01:24

<kevan>

it broke the page that i added geronimo/ prefixes onto the url snippets

01:24

<dain>

there aren't that many options possible... it is a pretty simple framework

01:25

<dain>

akarasulu_: checkout the source and load it into your ide

01:25

<kevan>

which i fixed. how did the export "fix the problem"? and how is the base url configured?

01:25

<akarasulu_>

okie doing so now ...

01:25

<dain>

you only need the xbean-spring package

01:25

<dain>

the test directory contains tons of unit tests and examples

01:26

<dain>

kevan: I think the page had been exported with an error and never reexported

01:26

<dain>

the base url is configured in the snippit plugin

01:26

<akarasulu_>

ahh okie I'll start looking there

01:27

<dain>

xbean/ is mapped to http://svn.apache.org/repos/asf/geronimo/xbean/

01:27

<dain>

kevan: do you know how the pages are synced from cwiki to the main site?

01:28

<kevan>

k. when i added geronim/ to the url that fixed the problem on the page i was editing

01:28

<kevan>

i don't really know how that works

01:28

<dain>

that works because geronimo/ is mapped to http://svn.apache.org/repos/asf/geronimo/

01:29

<dain>

if you are a cwiki admin, click administration|plugins|snippit|configure

01:29

<dain>

it will be very obvious at that point

01:30

<kevan>

k

02:20

<akarasulu_>

dain, got a sec for a question?

02:20

<dain>

yep

02:20

<akarasulu_>

I have this signature here: http://mina.apache.org/.../AbstractIoAcceptor.html#setDefaultLocalAddresses(java.util.List)

02:20

<akarasulu_>

trying to figure out what XBean will require in terms of XML for it

02:21

<akarasulu_>

I have a SocketAddress property editor that takes simple strings like :22 or 127.0.0.1:1000 etc

02:21

<akarasulu_>

so I'm good there

02:21

<akarasulu_>

can't seem to figure out what XBean is expecting in the XML

02:22

<dain>

ignoreing the constructor args, because I don't know how they apply to abstract classes :)

02:23

<akarasulu_>

here's what I have been trying ...

02:24

<dain>

<tagName closeOnDeactivation="true" defaultLocalAddress="something"/>

02:24

<akarasulu_>

http://rafb.net/p/ucYBit46.html

02:24

<dain>

um... I don't think that's right

02:24

<dain>

let me look at the examples :)

02:24

<akarasulu_>

getting complaints on socketAddress as you probably expect

02:26

<dain>

man the docs suck

02:26

<akarasulu_>

:)

02:27

<akarasulu_>

I'll try to add some if I can get up to speed - this is good shit it deserves the docs (many people would love to use it)

02:27

<dain>

http://svn.apache.org/viewvc/geronimo/.../RestaurantService.java?view=markup

02:27

<dain>

@org.apache.xbean.Property nestedType="org.apache.xbean.spring.example.PizzaService"

02:28

<akarasulu_>

ahhhh

02:29

<akarasulu_>

in my case the nested type is a SocketAddress

02:29

<akarasulu_>

which is not annotated since it's in the JDK

02:30

<akarasulu_>

I guess this is not an issue

02:30

<akarasulu_>

let me give it a try

02:32

<dain>

IIRC the nestedType is there because the code doesn't understand generics

02:34

<akarasulu_>

seems I'm stuck since SocketAddress is not in the mina.apache.org namespace

02:36

<akarasulu_>

How can I tell XBean to interpret <socketAddress> as the proper Spring presentation?

02:38

<akarasulu_>

brb I'm going to need some beer for this

02:41

<akarasulu_>

back

02:42

<akarasulu_>

Do you think I have to hand create a separate XSD for those objects like SocketAddress that I don't have access to the source?

02:54

<akarasulu_>

dain, if you're busy I can come back later no worries, just let me know

02:55

<dain>

sorry, got distracted

02:55

<dain>

um, I'm not sure

02:55

<akarasulu_>

np seriously

02:55

<akarasulu_>

I can come back later

02:55

<akarasulu_>

This stuff is killing me anyways

02:56

<dain>

I'm not sure that xbean can handle a list of primitives like that

02:56

<akarasulu_>

ahh ok

02:56

<akarasulu_>

:(

02:57

<dain>

I bet you could do defaultLocalAddresses="192.168.0.1:10001 192.168.0.1:10002"

02:57

<akarasulu_>

let me try that

02:58

<akarasulu_>

oh boy, seems like the parser hangs

02:58

<akarasulu_>

<nioDatagramAcceptor id="datagramAcceptor3" defaultLocalAddresses="192.168.0.1:110 192.168.0.2:110" />

02:59

<akarasulu_>

that flips out the parsing of the XML - just hung here

02:59

<dain>

maybe a comma

02:59

<akarasulu_>

tried that

02:59

<akarasulu_>

no go

02:59

<akarasulu_>

:(

03:00

<dain>

I got the code loaded now, so give me a minute

03:00

<akarasulu_>

np

03:01

<dain>

oh intellij decided to GC

03:01

<dain>

going to be a another minute

03:02

<dain>

on ya... xbean-spring doesn't use the super awesome conversion libraries in xbean-reflect

03:02

<dain>

it uses spring's tame conversion libraries

03:02

<akarasulu_>

oh

03:03

<akarasulu_>

you mean the nice set of PropertyEditors y'all have in there?

03:04

<akarasulu_>

yeah this looks nice - I could put these PropertyEditors into my custom registrar to register in place of all the Spring stuff

03:07

<dain>

xbean-reflect has a ton of property editors, but we don't import

03:08

<dain>

don't want to overwrite the spring stuff since people depend on that

03:08

<akarasulu_>

aye

03:12

<dain>

akarasulu_: ask on the xbean list

03:13

<dain>

post the spring you have and the xbean you want it to look like

03:13

<dain>

dan or guillume may have added something for this

03:13

<dain>

otherwise I can most likely hack something for you

03:14

<akarasulu_>

thanks dain will do that

03:14

<akarasulu_>

appreciate your help tonight

03:17

<dain>

akarasulu_: try * @org.apache.xbean.FlatCollection childElement="recipe"

03:17

<dain>

then don't add the wrapper element

03:17

<akarasulu_>

this on which method the setDefaultLocalAddresses() method ?

03:17

<dain>

never mind that isn't going to work

03:17

<akarasulu_>

ah ok

03:18

<dain>

the problem is you have a primitive

03:18

<akarasulu_>

SocketAddress is considered a string I guess ?

03:19

<dain>

ya

03:19

<dain>

is socket address your class?

03:20

<akarasulu_>

nope JDK

03:20

<akarasulu_>

that's half the problem

03:20

<akarasulu_>

I have a PropertyEditor registered for SocketAddress and that works like a charm when the list does not appear

03:21

<dain>

if you use <value>92.168.0.1:110</value><value>92.168.0.1:111</value> it would most likely work

03:21

<akarasulu_>

for example the property defaultLocalAddress is set just fine

03:21

<dain>

but that is lame

03:21

<akarasulu_>

hehe

03:21

<akarasulu_>

let me try that but I guess I have to surround that with <defaultSocketAddresses> right?

03:22

<dain>

yes

03:24

<dain>

how do you feel about adding a SocketAddressFactoryBean

03:24

<akarasulu_>

ok tried that and it just hung

03:24

<akarasulu_>

adding that to what ?

03:25

<dain>

sounds like you don't mind :)

03:25

<dain>

I'll try to hack something

03:26

<akarasulu_>

sure don't mind but I have no idea what yer talkning about at this point :)

03:37

<akarasulu_>

dain I whipped together an email you want me to still send that to the ML ?

03:38

<dain>

sure

03:38

<akarasulu_>

okie sent

04:41

<dain>

akarasulu_: where did you send it

04:41

<akarasulu_>

xbean-user

04:41

<dain>

I don't think there is a user list

04:42

<akarasulu_>

I sub'd no problem

04:42

<akarasulu_>

confirmed too

04:42

<akarasulu_>

http://geronimo.apache.org/xbean/lists.html

04:42

<dain>

humm there wasn't supposed to be a user list

04:42

<kevan>

i received it

04:42

<dain>

I'm not subscribed to it

04:43

<dain>

i guess I am

04:43

<akarasulu_>

:)

04:43

<akarasulu_>

low traffic

04:43

<dain>

my filters are setup wrong

04:45

<dain>

akarasulu_: wrote a working example for you

04:45

<dain>

http://svn.apache.org/viewvc?view=rev&revision=689356

04:45

<dain>

uses a static factory to create the SocketAddress instances

04:45

<akarasulu_>

ohh coolio man thanks

04:45

<dain>

basically puts it in your namespacke

04:45

<akarasulu_>

ahhhh

04:46

<akarasulu_>

looking ...

04:52

<akarasulu_>

Interesting

04:52

<akarasulu_>

So basically this Factory takes the place of a PropertyEditor ?

04:53

<dain>

in this case yes

04:53

<dain>

it should just work, but this is a good hack

04:56

<akarasulu_>

ok thanks a lot

04:56

<akarasulu_>

let me work it

05:04

<dain>

site is working again http://geronimo.apache.org/xbean/custom-xml.html

07:02

<djencks>

akarasulu_: hope you're not still up :-)

07:02

<akarasulu_>

hiya djencks

07:02

<akarasulu_>

yeah unfortunately hehe

07:02

<djencks>

hey... don't you ever sleep :-)

07:02

<akarasulu_>

good to see you

07:03

<akarasulu_>

yeah I try

07:03

<akarasulu_>

:)

07:03

<djencks>

looks like dain had some suggestions.... did you see them?

07:04

<dain>

djencks: hey wanted to ask you a question

07:04

<djencks>

about the destroy method -- I haven't played around to see what happens, but I'd expect that you'd need to "annotate" the method on the concrete class

07:04

<dain>

did you write a distributed TransactionManager implementation

07:04

<akarasulu_>

yeah saw em and was going to use em

07:04

<djencks>

AFAIK you can't annotate interfaces and have that make anything happen

07:04

<akarasulu_>

djencks, oh cool

07:04

<djencks>

hi dain

07:05

<dain>

hi

07:05

<djencks>

dain: long ago for jboss

07:05

<akarasulu_>

djencks, so there is a sort of inheritance going on

07:05

<dain>

but geronimo doesn't

07:05

<djencks>

dain right

07:06

<djencks>

dain I'd need some idea about transport.... after that it is fairly easy

07:06

<dain>

I'm asking because I was updating the wadi

07:06

<djencks>

dain e.g we could do it over the openejb protocol

07:06

<dain>

and it is relocating method calls to the stateful instance

07:06

<dain>

which isn't going to work for anything that relies on thead state

07:06

<djencks>

dain: I saw your email about that.... when can that actually happen?

07:07

<dain>

which part?

07:07

<djencks>

dain tx needs to move

07:07

<djencks>

for the data to be elsewhere.... there was at least one call to it there

07:08

<dain>

yep, and anything else riding on the thread

07:08

<djencks>

lets just talk tx

07:09

<djencks>

how can you get into a situation where a tx has to be moved?

07:09

<dain>

dTX shouldn't be that hard since we already have import working for RAs

07:09

<dain>

I didn't

07:09

<djencks>

akarasulu_: it might not look that way but I'm still listening :-)

07:09

<dain>

was reading wadi stateful container and was suprised to see what they are doing

07:09

<dain>

it isn't going to work without dTX

07:09

<akarasulu_>

djencks, no worries

07:10

<djencks>

dain: (a) hard parts are agreeing on tx transport and writing an XAResource for the dtx client

07:10

<djencks>

(b) I still don't get how its possible to get into the situation.... I'd like a realistic example

07:11

<dain>

ya recovery becomes a problem

07:11

<dain>

you can't with standard openejb

07:12

<dain>

I've been hacking on Terracotta lately, and have been thinking about a distributed TxLog

07:12

<dain>

any node could recover for a failed node

07:14

<dain>

with terracotta you can effectively create single cluster wide tx manager

07:14

<djencks>

dain are you thinking persistence through having the log on a bunch of machines rather than on disk?

07:15

<dain>

you can configer terracotta to be persistent or not

07:15

<dain>

if you have high confidence in your uptime you could run non-persistent

07:16

<dain>

but it is risky

07:18

<djencks>

Not sure exactly how you see this working.... like a normal tx manager but any node can recover for any other,

07:18

<djencks>

so if machine A goes down any work done in un-prepared txs is lost?

07:19

<dain>

absolutely rollback on a dead machine

07:19

<dain>

any un-preprepared work

07:20

<akarasulu_>

djencks, mind if I ping you tomorrow online about a few questions regarding the MINA related XBean stuff that you dealt with before ?

07:20

<dain>

basically, you write a log that keeps everything in menory on a single node, and let terracotta distribute it to all the other nodes in the cache

07:20

<djencks>

akarasulu_: I'll be in and out, but sure

07:20

<akarasulu_>

thanks djencks

07:20

<djencks>

dain: ok, how do you detect that its time to do recovery?

07:21

<djencks>

akarasulu_: np

07:21

<djencks>

akarasulu_: hope I can remember some of it :-)

07:21

<akarasulu_>

:)

07:22

<dain>

there are a few tricks, but the key is when a node crashes, all of the distributed locks of the node are released

07:23

<djencks>

not sure what that means, but it sounds like terracotta will tell you if a node crashes?

07:24

<dain>

in a word, yes :)

07:24

<djencks>

ok

07:24

<djencks>

are you thinking of one log for the cluster or one log for each machine?

07:25

<dain>

not sure... haven't gotten that far

07:25

<djencks>

k

07:26

<dain>

I also don't really understand how recover actually works :)

07:26

<djencks>

but its so simple :-D

07:26

<djencks>

want me to explain it?

07:27

<dain>

yes please

07:27

<djencks>

I assume you mean in geronimo, not xa in general?

07:27

<dain>

in geronimo

07:27

<djencks>

ok

07:27

<djencks>

so we start up after a crash and read in the log

07:28

<djencks>

each tx has a bunch of entries

07:28

<dain>

in the TxLog.recover(XidFactory) method

07:28

<djencks>

one entry is the name of the xaresource and the branchXid sent to the xaresource for this tx

07:29

<djencks>

(I don't remember the method names, but that sounds right)

07:29

<djencks>

this tx was prepared... that's what being in the log means

07:29

<djencks>

so we know we should commit any branch we possibly can

07:30

<djencks>

ok, so we've read all these in and sorted them by XAResource name

07:30

<djencks>

now we start waiting for xaresources to register with the tm

07:30

<dain>

backing up

07:31

<djencks>

as soon as one registers, we use the name to find the branch xids we're supposed to commit

07:31

<dain>

after reading the log we effectively have Map<XaResourceName, Collection<BranchXid>>

07:31

<djencks>

so we ask the XAResource for the list of uncommitted xids

07:31

<djencks>

yes

07:31

<djencks>

anything in that list and in the Collection<BranchXid> we commit and remove from the collection.

07:32

<djencks>

anything in the collection<branchXid> that the xaresource doesn't say is uncommitted must have been committed before the crash.

07:32

<djencks>

So we can now delete the Map.Entry for that XAResource name

07:33

<djencks>

after all the xaresources have re-registered we're done

07:33

<dain>

so if something is in the log it should be committed?

07:33

<djencks>

the reason I did this is so you don't have to get all the resource managers up before you can do recovery

07:33

<djencks>

yes

07:34

<djencks>

as soon as a rm comes up, we can do the part of recovery relevant to that rm

07:35

<dain>

that sounds very simple :)

07:35

<djencks>

in particular if one rm is really broken we can recover everything else, releasing the locks on that rm, and hopefully allowing some new work to proceed

07:35

<djencks>

that's what I thought :-)

07:35

<dain>

sounds good

07:36

<dain>

having a distributed log would be cool as the other nodes can immediately recover without waiting for the system to reboot

07:37

<djencks>

yes

07:37

<djencks>

probably faster too :-)

07:38

<dain>

if the cache is still writing to disk it may not be... howl is pretty fast

07:40

<dain>

also since we have this nice clustering system, we can effectively have one coordinator for the system no matter how many nodes participate in the transaction

07:40

<djencks>

I'd expect you'd use no-disk logs this way

07:41

<djencks>

I think mark little told me that corba transaction service only needed one coordinator, but I didn't understand how it works

07:41

<djencks>

similarly I don't see how it would work here

07:42

<dain>

the coordinator does rpc to the XAResouces on the nodes in the tx

07:42

<djencks>

suppose you have 2 nodes talking to one db... I'm not sure what happens if both nodes try to use the same branchXid

07:43

<dain>

I suspect it depends on the DB

07:43

<djencks>

I suspect most will object

07:44

<dain>

I'd guess you'd need to branches

07:45

<dain>

which means you're likely to step on your own feet

07:45

<dain>

I mean if you have multiple coordinators, you'd be multiple branchXids

07:46

<djencks>

well, that's tightly coupled or loosely coupled.... whether the 2 branches can see each other's changes

07:46

<djencks>

I'm thinking that even with one global coordinator, if you try to access the same db in the same tx from 2 nodes, you may have problems

07:47

<djencks>

unless you have different branch ids for each node

07:47

<dain>

does the branchXid contain the globalXid?

07:47

<djencks>

well, we're talking loosely here

07:47

<djencks>

an Xid has 2 parts

07:47

<djencks>

the global xid is the same for every branch in the tx

07:48

<djencks>

the branch xid is different

07:48

<dain>

so the db can detect that two branches are from the same globalTx

07:48

<djencks>

yes

07:49

<dain>

that's cool

07:49

<dain>

so, I'd say each node has its own branchXid

07:50

<dain>

and you get the isolation the db gives you :)

07:50

<dain>

as usual :)

07:51

<dain>

I gotta go to sleep

07:51

<djencks>

me too :-).... I think what you are talking about is very similar to the corba tx service

07:52

<djencks>

you might want to read up on it.... its a bit different from xa

07:52

<dain>

k

07:54

<djencks>

anyway... good talking with you.... time for some zzz s

09:50

<hsn_>

are there plans to add support for OSGi?

14:49

<jgawor>

djencks: ping

15:31

<djencks>

jgawor: pong

15:31

<djencks>

hsn_: what kind of osgi support are you interested in?

18:39

<hsn_>

djencks: i am interested in running OSGi modules inside Geronimo

19:24

<hsn_>

jdk1.6 is supported by geronimo? WAS CE 2.1 refuses to install on jdk1.6

22:20

<akarasulu_>

djencks, you around bro?

22:20

<djencks>

yes but give me a few minutes.... will ping you

22:21

<akarasulu_>

np thanks d

Drone v1.4 © 2002-2005 Uwyn RIFE powered