greptilian logo

IRC log for #javaee, 2014-01-31

Please see http://irclog.greptilian.com/javaee for which days have been logged.

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:50 apric joined ##javaee
01:02 sajjadg joined ##javaee
01:55 Taylor_ joined ##javaee
03:48 kotten_ joined ##javaee
04:30 firebird1 joined ##javaee
04:51 firebird1 k lets consider Double value as 23.78
04:51 firebird1 how to know there is a value after decimal
04:52 firebird1 in java
05:05 firebird1 ??????????
05:05 firebird1 no one did this
05:05 firebird1 i dont want to display wen cents are 0
05:30 sguha joined ##javaee
05:37 firebird1 got
06:04 Bombe joined ##javaee
07:17 AlexCzar joined ##javaee
08:15 TxRx127 joined ##javaee
08:22 putneyj|away joined ##javaee
08:27 firebird1 joined ##javaee
08:43 ramsrib joined ##javaee
08:44 fabioportieri joined ##javaee
08:47 Monkey_C joined ##javaee
09:46 firebird1 joined ##javaee
10:42 Monkey_C joined ##javaee
11:13 firebird1 joined ##javaee
11:34 firebird1 where is Quest
11:46 acuzio One of his aliases must be around here firebird1
11:47 firebird1 hmmmm
11:51 acuzio They are all in the same company .,  from Pakistan and ask really intelligent questions
11:54 firebird1 i didnt know Quest was working in a company thougt he was doing freelance
11:56 firebird1 when to use action and actionListener
11:56 firebird1 getting confused
12:02 sajjadg joined ##javaee
12:08 sajjadg joined ##javaee
12:12 firebird1 joined ##javaee
12:12 fabioportieri firebird1: http://stackoverflow.com/questions/3909267/differences-between-action-and-actionlistener
12:12 sajjadg :-)
12:19 firebird1 Invocation order
12:19 firebird1 The actionListeners are always invoked before the action in the same order as they are been declared in the view and attached to the component.
12:20 firebird1 from the link :/
12:25 fabioportieri not only that
12:25 fabioportieri in theory you use action for businesslogic & navigation handling, actionlistener for small stuff
12:26 fabioportieri but if you need ActionEvent that is handy then you'll end up with actionListener
13:04 CJ_ Anyone have any commons fileupload experience?  For some reason it's not saving my files correctly.
13:11 pdurbin CJ_: are you using JSF?
13:11 sajjadg this is so cute: https://www.youtube.com/watch?v=IJNR2EpS0jw
13:14 TxRx127 CJ_ , Not saving or not get your files ?
13:15 CJ_ pdurbin, No, just a jquery post.  Some files it saves to the temp dir, others it doesn't.
13:15 CJ_ Can't figure out why.
13:17 TxRx127 there is a max-POST-size ?
13:17 TxRx127 or max Upload-Size ?
13:17 TxRx127 define anywhere ?
13:18 TxRx127 did you define the type of file upload in your upload for ?
13:18 TxRx127 form*
13:19 CJ_ It's not a file size issue.  The one that doesn't work is a tiny text file.
13:19 CJ_ For some reason it's bombing in the stream copy and creature of the tmp file as far as I can tell.
13:20 TxRx127 may i see your code (server side) ?
13:20 TxRx127 just the part for upload
13:21 CJ_ It's pretty simple.  What's a good paste site?
13:21 TxRx127 Pastebin !
13:22 pdurbin CJ_: http://danceb.in
13:22 pdurbin (no ads)
13:22 TxRx127 not bad !
13:22 pdurbin TxRx127: a friend of mine runs it
13:23 pdurbin and it's open source: https://github.com/throughnothing/Dancebin
13:23 TxRx127 Oh good :) , it's more simply and you can define the expire date,
13:23 TxRx127 nice !
13:24 CJ_ http://pastebin.com/B7Q1w7QQ
13:24 CJ_ When I call parse request on my big zip file, it creates a tmp file.  When I call it with my small txt file, it doesn't.
13:28 TxRx127 hum
13:32 CJ_ I looks like it has issues creating the temp file when it calls getOutputStream.
13:32 CJ_ It's not throwing any exceptions and there doesn't seem to be anything different.
13:33 CJ_ But it never creates the file.
13:34 TxRx127 Try to build your file
13:35 TxRx127 wait i give you an example
13:35 TxRx127 (for test :) )
13:36 CJ_ Ah!  I think I figured it out.
13:37 CJ_ I think the txt file is smaller than the buffer, so it's sitting in the buffer instead of being flushed to the file system.
13:38 tommmied joined ##javaee
13:39 TxRx127 yes ! my code fix that !
13:40 CJ_ Eh?
13:40 TxRx127 I also thought the problem was buffer size
13:41 TxRx127 (sorry for my english, (i'm french))
13:41 TxRx127 so i write something that can resolve that
13:44 CJ_ Well, the stream copy is closing the outputstream, which should flush the buffer.
13:45 CJ_ But I think since it's a deferredoutputstream it has a second buffer.
13:47 CJ_ Yep.  That's the case.  DiskFileItem will not create files unless the file is over a certain size.
13:47 CJ_ So it looks like I need to change the way I handle my processing.
13:48 TxRx127 http://pastebin.com/3Qki6fGH
13:49 TxRx127 :)
13:52 CJ_ Thanks, but I'm going to keep the commons.fileupload setup that I have.
13:52 TxRx127 so
13:53 CJ_ The problem was that I wasn't using DiskFileItem correctly.
13:53 CJ_ Instead of calling the get stream method on it, I was calling get file and then trying to open a stream on that.
13:53 CJ_ Once I change that everything should work.
13:54 TxRx127 Oh d'accord :) great !
13:54 CJ_ d'accord?
13:54 CJ_ Thanks for the suggestion, however. :)
13:54 TxRx127 sorry that mean "ok"
13:57 TxRx127 No problem, What is essential is that your problem was resolved !
13:58 CJ_ Agreed.  Just sometimes feel dumb when I publicly troubleshoot. :)
14:05 TxRx127 Haha this happens to me sometime at work
14:05 TxRx127 i didn't read correctely javadoc when i made some of CTRL + space too quickly
14:06 sajjadg what XML parser do you suggest for parsing an XML book?
14:14 TxRx127 Saxon
14:15 TxRx127 because dom is too heavy for parse big files
14:15 CJ_ Had to change my zip file handling as well.
14:15 CJ_ That was fun.
14:15 TxRx127 (i work with xml based software)
14:17 TxRx127 witch parse files over 250 or 500 mo
14:17 TxRx127 sajjadg
14:19 sajjadg TxRx127: 250MB?
14:19 TxRx127 Yes :)
14:19 sajjadg TxRx127: my xml files are less than 2 or 3 MB
14:19 sajjadg and I want to just read from
14:20 sajjadg I also have the sql dump of the books. and simple txt files
14:20 sajjadg and it's easy to convert them also.
14:20 TxRx127 So use Saxon if you want Speed OR Dom if you want simplicity
14:20 sajjadg I want to just read from them. no write in books! I don't want to change them :P
14:21 TxRx127 Just read ?
14:21 TxRx127 Hum Xsl transformation with Saxon :)
14:21 sajjadg yeah. I don't want to change books. just read from them
14:21 TxRx127 i understand :p
14:21 sajjadg what about JAXB?
14:21 TxRx127 Jaxb
14:21 TxRx127 uses Xsd
14:21 TxRx127 to build objects for
14:22 TxRx127 marshalling or unMarshalling Xml
14:22 TxRx127 Xml = > Object || Object  => Xml
14:23 sajjadg aha. I think the last version also marshals JSON
14:23 TxRx127 Yes i use it :) You can generate and XSD from your XML file and generate class form JAXB with you xsd and use it easly
14:23 sajjadg there's a JAXP also!
14:24 sajjadg I want to use JAX-RS jersey to create a service for the books
14:24 sajjadg I think I should somehow send json or xml to clients.
14:25 sajjadg http://docs.oracle.com/javase/tutorial/jaxp/index.html
14:27 TxRx127 Hum the difference is which role the xsd plays. JAXP is very outdated without awareness of the XML Schema while JAXB handles the schema binding as the very first step. but you can use it, but i advise you to use Jaxb
14:29 TxRx127 see here, it's simple http://www.mkyong.com/java/jaxb-hello-world-example/
14:29 TxRx127 http://www.jmdoudoux.fr/java/dej/chap-jaxb.htm (in french but great tutorial (use trad option :p ))
14:30 TxRx127 in the last tutorial, you will see how you can generate class from XSD
14:31 TxRx127 and in the first, how to use these
14:31 TxRx127 :)
14:40 CJ_ TxRx127, Everything works.  Big, small, text, zip files. :)
14:40 TxRx127 Great !
14:41 TxRx127 :)
14:50 sajjadg TxRx127: thanks. http://www.mkyong.com/tutorials/java-xml-tutorials/
14:52 TxRx127 you're welcome !
14:54 MasterProgram joined ##javaee
14:56 MasterProgram left ##javaee
15:04 MasterProgram joined ##javaee
15:19 sajjadg service vs resource? are they different names for the same concept?
15:19 sajjadg albeit in JAX-RS world
15:21 MasterProgram I'm working on an android application  for a website I have and was wondering if anybody could tell me where I need to place my php api files? More specifically, do I place them in the android project or on the remote server?
15:22 sajjadg MasterProgram: remote server
15:24 TxRx127 Php need an HTTP server to be executed
15:24 TxRx127 like apache httpd
15:24 TxRx127 or localy WAMP
15:25 sajjadg WAMP has a http server inside, so your first sentence was complete :-)
15:25 TxRx127 yes :p but wamp is more userfriendly than httpd on our desktop ahaha :p
15:26 sajjadg MasterProgram: do you want your android app to run offline or online?
15:26 sajjadg TxRx127: I don't use windows :P
15:26 TxRx127 Yes good question !
15:26 sajjadg so there's LAMP ;)
15:26 TxRx127 Xamp ! :) (i'm on ubuntu)
15:26 TxRx127 Lamp  yes
15:27 sajjadg I like to have them separatly not in a GUI based program like xamp or wamp
15:28 sajjadg and I my php stack is Linux, Apache, PostgresSQL, PHP
15:28 sajjadg I kinda hate mysql :P
15:28 sajjadg PG is in any case better than mysql
15:29 TxRx127 In production mode yes, for developpement it's better i think
15:29 sajjadg mysql? is better in dev.?
15:29 TxRx127 Oh Mysql is not bad, i use it everyday and PG, HSQL, Oraclebd too
15:30 TxRx127 i work on multibases software
15:30 sajjadg noooo, that's a bad idea to use different DBs in development and production. always stay with one DB in both phases
15:30 MasterProgram sajjadg, if your asking if I want it to work with or without an internet connection then yes.
15:30 sajjadg MasterProgram: yes what? for having internet yes or for not having it?
15:31 TxRx127 Mysql is fast with Myslm
15:31 TxRx127 sajjadg we cannot choose our customer :p
15:31 sajjadg MasterProgram: if you have internet then you should have all php codes on your server (remote one) and just talk to your server from android app
15:31 MasterProgram sajjadg, I'll start with having an internet connection
15:33 sajjadg MasterProgram: very good choice. stay with internet ;) you may want to learn about REST a little and how to pass JSON objects between andorid app and php server
15:34 sajjadg MasterProgram: you are welcome here but you may get better answers if you use #PHP for your php questions and #android channel for your android Qs. here we don't know much about them ;)
15:34 MasterProgram sajjadg, if my website powered by php, does that mean that I don't have to add any api files?
15:35 sajjadg MasterProgram: I think you are using API wrongly! do you mean android API or PHP API?
15:35 TxRx127 Api files  ?
15:38 MasterProgram sajjadg, sorry I'm new to this kind of programming. My site is coded entirely in php with html embedded in the code. Could use those same files with my android application or do I need to upload different files for this?
15:39 sajjadg MasterProgram: what do you want to do?
15:40 sajjadg if you want to just surf your site in android, you can just make your html responsive.
15:41 sajjadg if you want to create an android app that does something other than what your website does, then you should create an api for that in your server. you should see if there's already an api available on your website.
15:42 MasterProgram sajjadg, I'm wanting to be able to allow people to register for the site, login, post recipes, comment on recipes, eventually take pictures of recipes and upload to the site. As well as view the recipes.
15:44 MasterProgram Currently, users can do all this on the website. Does that mean the api already exists on the site?
15:44 sajjadg you need to work with camera, so you should go with native android app solution
15:45 MasterProgram the camera bit wont come till after I get the application up and running though
15:45 sajjadg MasterProgram: no that does not mean there is an API there
15:46 sajjadg MasterProgram: you should create a native android app with android SDK (or any other SDK that can create a android app for you) and then communicate with your website
15:48 MasterProgram sajjadg, I'm creating it using the eclipse ide and the android sdk.
15:48 sajjadg MasterProgram: I'm not familiar with PHP designs and I don't know what's going on on your site, so I can't tell if you absolutely need to create a new api. but I think you need to create a new one.
15:48 sajjadg MasterProgram: you are in the right path my brother :-) eclipse and android SDK are the right tools for your job
15:49 sajjadg MasterProgram: go on. you understand when you need to modify your server ;)
15:50 MasterProgram sajjadg, Thanks for the information.
15:50 sajjadg MasterProgram: you're welcome :-) are you a php programmer?
15:51 * sajjadg wants to deceive him to use Java :P
15:54 CJ_ Some days I really hate tomcat and java.
15:54 MasterProgram sajjadg, more so I'm just somebody who loves computers and finds programming relaxing, but yes I'm most proficient at php. It was the first language I learned.
15:54 sajjadg CJ_: true. that happens a lot. I hate/love everything I know :P
15:55 TxRx127 xD
15:55 CJ_ I just hate when it caches things and doesn't reflect my changes.
15:55 CJ_ End up taking forever to clear things out and figure out the problem.
15:55 TxRx127 I hate Temp and Work.
15:56 CJ_ Especially when running tomcat in Eclipse.  Often hard to figure out if it's clean or not.
15:56 sajjadg MasterProgram: very good. programming for hobby is awesome. so have fun with it. and if you want to learn Java EE to create a perfect backend for your android app then we are hear to help you :-) currently I'm creating a backend for both website and android app etc.
15:56 TxRx127 Embed tomcat ><
15:57 CJ_ Damn thing can't find jackson even when it's declared in the pom.  And it was working five minutes ago.
15:58 sajjadg CJ_: I don't trust IDEs. and you should not trust them too. I had wasted weeks trying to find out some bugs in eclipse or netbeans...
15:58 sajjadg CJ_: I always triple check everything
15:58 CJ_ Normally I don't have any problems with them.
15:58 sajjadg TxRx127: what? embedding?! I don't get it?
15:59 CJ_ It's just every now and then things get wonky.
15:59 sajjadg CJ_: the base IDE is ok but plugins miswork sometimes
16:00 CJ_ The really annoying part is that I had this happen once before and I can't remember how I fixed it.
16:00 sajjadg CJ_: I move between eclipse and netbeans always :P I get angry with netbeans and go to eclipse and eclipse pisses me off and I come back to netbeans :P
16:00 TxRx127 I use ANT to build my project, put it from eclipse to tomcat, clear my temp and work, clean all or anythings
16:00 sajjadg CJ_: I installed an offline mediawiki to write those tricks down ;)
16:02 sajjadg TxRx127: nah. ant is not cool. maven is very cool. but both of them are really old!!! people going for gradle these days. but I still find maven to be the best ;)
16:02 CJ_ I'm building in maven.  Just running it in the embedded tomcat.
16:02 CJ_ Not sure what is causing the problem atm.
16:03 TxRx127 hum i use ant because, i can control every process in my build, like, alter my properties files, makes some pregreplace, build, compile, use all of linux commands with one "ant build"
16:04 CJ_ Oooh, I think I remember what the previous problem was.
16:04 sajjadg CJ_: don't trust build, clean. because both eclipse and maven have them. try to check them
16:04 CJ_ Some other jar was bundling the jackson classes or something.
16:04 TxRx127 and it's useful when you are more than 80 customer with you app
16:04 sajjadg CJ_: once I had problem when I used eclipse clean then run app on the server, maven didn't compiled the .java files.
16:05 sajjadg Java EE 7 is out right? I see Java EE 6 tutorials and help in oracle websites!!!
16:06 sajjadg and the last Java SE (JDK) is 7 right? 8 will release next month right?
16:06 AlexCzar joined ##javaee
16:09 TxRx127 Jdk 8 is already release in developper version
16:10 sajjadg I'm talking about final release. TxRx127 I've seen those dev releases.
16:12 sajjadg Do you think JavaFx have bright future? people kinda hate plugin required websites. for desktop fx replacing swing is a good idea. swing is not cool
16:15 TxRx127 Java Fx is awsome
16:15 Voyage joined ##javaee
16:15 TxRx127 i use it for my apps
16:16 TxRx127 and an implementation for android an Ios is scheduled
16:16 TxRx127 oups ios is already implemented
16:16 TxRx127 look at the java roadmap
16:16 sajjadg android impl is availabe too
16:17 sajjadg non official
16:17 TxRx127 oh
16:17 TxRx127 Ah !
16:17 TxRx127 ok :)
16:17 TxRx127 can't wait for test !
16:17 sajjadg I wanna wait till JDK9 when it gets integerated to JDK :P
16:18 sajjadg I wonder how google wants to merge android and chromeOS :-)
16:24 sajjadg JAXP 1.5 is new
16:31 TxRx127 left ##javaee
17:25 CJ_ Fixed it!  Had to delete the .settings folder in eclipse.
17:38 sajjadg :-)
17:39 sajjadg if I want to open a file from a apache or glassfigh server what should I place in File("/path") as the path?
17:39 sajjadg /resource/file.xml is not working
17:40 whartung where is the file located?
17:44 sajjadg main/src/resources/
17:44 sess get it via classloader
17:44 sess this.class.getClassLoader.getResourceAsStream
17:44 sess resource will be in /
17:46 sajjadg WARNING:   Context path from ServletContext:  differs from path from bundle: /
17:47 sess wat
17:48 sajjadg this is a warning :P no problem :-)
17:48 whartung or get the Resource URL
18:00 sajjadg when I'm running glassfish locally it gives me this warning! : SEVERE:   SEC5054: Certificate has expired: [
18:02 sajjadg I think something is wrong with java!
18:04 whartung no, it's an expired certificate in the ca store.
18:04 whartung it's exactly what it says it is
18:05 whartung you can use key tool to remove it if you want
18:07 sfisque joined ##javaee
18:11 whartung so curious, I deploy a Stateless Singleton STartup bean but don't see my @PostConstruct method fire.
18:11 whartung first time I tried one of these
18:12 whartung it's deploying the bean, it spits out a log showing the portable jndi names
18:34 Voyage In context to database based applications and those often use hibernate / jpa, when we try to edit an object, do the database stuff/query, is it a good practice to fetch the object data again and show that to the user UI or just say "updated"  . e.g      boolean  editObject(id)         vs      Object editObject(id)
18:35 Voyage one returns the object, then  its shown the to user again.       one is      a boolean. yes/no
18:37 Voyage the later will make an addition SELECT
18:47 sfisque whartung you're bean might be deploying before some of it's injected resources are "ready".  i've seen cases wehre a @startup bean deploys before the entitymanager is ready for injection and thus the bean does not deploy and PostContruct does not fire
18:47 sfisque *** your
18:47 whartung getting this
18:47 whartung SEVERE: The annotation symbol defined in super-class is not compatible with Session ejb ChannelSessionEJB.
18:47 MasterProgram joined ##javaee
18:48 sfisque make the @startup bean monolithic.  don't get fancy and do subclassing in EJBs unless you drastically need it
18:48 sfisque what annotation is the complaint about?
18:49 whartung http://pastie.org/8686283
18:49 whartung dunno yet
18:50 sfisque you can get rid of @Stateless.  it collides with @Singleton.  you can either be SL, SF, or Sing.  they're mututally exclusive
18:51 whartung ic ok
18:51 sfisque if you're stateless there's no advantage to being singleton
18:51 whartung lemme try that
18:51 sfisque singleton assumes "some state" as in you're holding some data that is glacial and you don't want to round trip for it constantly
18:52 sfisque or some method that requires a TX but you dont want a bajillion of them pooled
18:52 whartung yea
18:52 whartung true
18:52 whartung I was treating it as a decorator
18:53 sfisque singletons should be monolithic, and if you "need" them to be @startup, they should be very fault tolerant of injection (aka, dont inject something that you cannot control, like EM, etc.  do JNDI lookup if need be instead at runtime)
18:53 sfisque i know GF has race conditions with EM injection in @Startup beans.
18:54 whartung nice
18:54 sfisque at least 3.1.x did
18:56 whartung I think removing stateless did it
18:56 sfisque aye.  the container wont let you deploy a bean with more than 1 'context' annotated
18:57 sfisque in this context.elementOf( { 'stateful', 'stateless', 'singleton' } );
18:57 whartung +1 for clear error messages....
18:57 sfisque :-D
18:58 sfisque on a good note, i probably landed a new gig.  the sweet aspect is, 100% telecommute (job is in hawaii) with possible "occasional" on site visit.  so i can spend some time with the spawnlings AND do work.  /crosses fingers
18:58 whartung awesome
18:59 whartung that is good news
18:59 whartung how long?
18:59 sfisque 6mo, possible extension with relocation if things work out.  so i might be moving to HI sometime in the summer :P
19:00 whartung cool
19:00 whartung that's good -- and bad...
19:00 whartung I do' know if I'd go bananas in HI or not. I might.
19:02 whartung I get a little claustrophobic on islands...
19:09 sfisque i'm a natural beach bum (which is kind of funny and ironic as i am generally dressed quite gothy for the most part).  but who knows how it will turn out.  but i told them i was at least amenable to the idea of relocating if the contract went long term
19:09 whartung yea
19:09 sfisque we shall see :P
19:29 whartung I guess events are stood up during startup
19:34 whartung this doesn't seem to be working either *sigh*
19:34 whartung @Schedule(minute = "*")
19:45 sess whartung: it works
19:45 sess just perhapos not in the way you expect
19:45 sess it will trigger each minute from 00:00 to 01:00 :)
19:46 whartung ah, really?
19:46 whartung so I need to * all of the fields out I guess (save seconds)
19:47 sess not a
19:47 sess ll
19:47 sess but iirc, default hour is 0
19:47 sess while default day is *
19:47 sess you just need hour="*"
19:47 whartung oic
19:47 sess to get it to trigger every minute
19:47 sess in addition to your minute * of course
19:47 whartung si
19:48 whartung @Schedule(hour = "*", minute = "*", persistent = false)
19:49 whartung \o/
19:49 whartung now how about:     public void handleChannelEvent(@Observes ChannelEvent event) {
19:49 whartung :)
19:50 sfisque @Schedule( minute="0")  // will trigger on the hour
19:50 sfisque minute = "*" means trigger on any minute
19:50 whartung yea
19:51 whartung I guess an empty @Scheudle does once a day at midnight
19:52 sfisque not sure if that is container specific or by spec.  check the spec doc
19:52 whartung no matter
19:53 sfisque i would jsut say, if it's container specific, deliberately set the values to avoid portability issues
19:53 whartung yea
19:54 whartung that annotation IS really nice
19:55 sfisque yah.  timer usage was A N N O Y I N G before they added teh @scheduled functionatliy
19:55 whartung o yea
19:55 whartung have you used the events ?
19:55 sfisque negative
19:58 whartung bahg
19:58 whartung it's not seeing my event handler
19:59 whartung I wonder f it's because it's in the same bean
19:59 whartung http://pastie.org/private/p2sksuuucjlohu2gd1la
19:59 whartung checkForChannelChanges calls a routine the fires the ChannelEvent
20:00 whartung but it;s not dispatching the event (I should say it's not capturing the event, dispatch seems to be happening)
20:00 sfisque you might need to annotate the method?
20:00 whartung that's what he @Observes is for I thought
20:01 sfisque that would link the injection of the parameter, not sure if it triggers registering the method
20:01 whartung I wish the JEE tutorial scene was not half TOC
20:06 sfisque what api is channelevent from?
20:06 whartung it's my own bean
20:09 sfisque does you Event object implement Event<T>?
20:09 whartung @Inject Event<ChannelEvent> events;
20:09 whartung the dispatch fires, i.e. Idon't get an NPE or any other error
20:09 whartung events.fire(ce)
20:10 sfisque do you have multiple subclasses of ChannelEvent?
20:11 whartung no
20:13 sfisque dunno
20:14 sfisque are the select() methods buggy?
20:14 sfisque maybe?
20:14 whartung select methods?
20:14 sfisque interface Event has 4 methods.   fire() and 3x select()
20:15 whartung yea, I have no idea what those do actually
20:15 sfisque looks like they are needed for hierarchical eventing (parent -> child)
20:16 sfisque is your enclosing bean a @Decorator or @inteceptor?
20:16 sfisque from the javadoc: A bean (or extension) may declare multiple observer methods.
20:16 sfisque Observer methods are inherited by bean subclasses.
20:16 sfisque Interceptors and decorators may not declare observer methods.
20:16 whartung no, its just a session bea
20:17 whartung like in the pastie
20:17 sfisque ok
20:18 sfisque oh, i wonder if the fact that it's a singleton causes some issues?  try decoupling it into a session bean, and inject teh session bean into the singleton
20:18 whartung yea
20:18 whartung was wondering that too
20:22 whartung this didn't change anything...
20:22 whartung http://pastie.org/private/vz33xcpsqwecknhroguqog
20:23 sfisque are you in a contained env?
20:23 whartung eh?
20:23 whartung it's just session beans
20:23 whartung and timers
20:23 whartung Timer triggers method, method checks for stuff and fires a change event if it finds anything interesting
20:24 sfisque replace S.O.println() with a logger call.  S.O.println isnt guaranteed in a container.
20:24 sfisque if might be firing but you're not seeing antying
20:24 sfisque **it might
20:24 whartung s.o, always works in GF
20:24 whartung I see other printlns
20:24 sfisque kk
20:27 whartung finny, I see tests in the GF source, but no reference to Observes itself
20:29 whartung they must use weld directly
20:31 whartung org.jboss.weld FINEST -- see what trouble this gets me in to
20:31 whartung nada ...lol
20:31 whartung no logging. great
20:32 sfisque debugger
20:32 whartung that means getting the source code in to my ide...
20:32 sfisque just the parts you need.  don't need the full source
20:33 sfisque set a break point.  look at the classes in the stack, and just cherry pick the packages you need
20:33 whartung lunch bbl
20:42 sfisque whartung is the Event created via new() or is it managed? [i know you're afk, but something that occurred to me]
21:08 sajjadg joined ##javaee
21:09 neuro_sys joined ##javaee
21:36 sajjadg singleton is evil!!!!!
21:37 sajjadg so what should I go if I want a readonly object in my project that has a high initialize time?
21:38 sajjadg I want to read a book that is stored in a file/db. and because the book is only 1M or 2M I think that's not problem to load all of it in memory!!!
21:39 sajjadg is it a pro or con to have your book in the memory!?
21:40 apric joined ##javaee
21:41 apric hey guys, does anyone know how i can change the glassfish3 log output? i tried log4j and logback, output still doesnt change
21:41 apric without manipulating the gf3 installation files
21:42 whartung sfisque: the ChannelEvent is made via New.
21:43 whartung nothing wrong with storing large objects in RAM if you're going to use them alot
21:44 r2d2__ joined ##javaee
22:14 sfisque whartung you might have to have the object instantiated by the container
22:14 sfisque the Event framework is part of CDI
22:15 whartung nah that makes no sense, and it's not how the simple demos do it (you don't think I make this stuff up on my own, do you?)
22:15 sfisque i havent found anything cogently readable
22:15 sfisque online
22:16 whartung http://www.adam-bien.com/roller/abien/entry/java_ee_6_observer_with
22:17 sfisque notice the Event object is injected, not new()'ed. in the bean that fires it.  that's what i'm talking about.  the event is "created by the container" not new()'ed
22:17 whartung I thought you were talking about ChannelEvent
22:18 whartung +1 for high bandwidth communications :)
22:18 sfisque that's what i'm asking.  is your channelevent new'ed or is it created by the container
22:18 whartung Event<ChannelEvent> is injected, my ChannelEvent is new'd
22:20 Voyage joined ##javaee
22:21 whartung I have some of GF3 in my IDE right now, trying to get the weld sources
22:21 sfisque i'm guessing channelEvent has to be managed, either @inject by cdi or @named.
22:21 whartung ideally through maven
22:21 whartung yea, that's not what the examples show tho
22:21 sfisque otherwise, how would cdi know to capture the event?
22:21 sfisque i don't see any "new" anywhere in that example
22:22 whartung events.fire(new HelloEvent("from bean " + System.currentTimeMillis()));
22:22 sfisque oh the first one
22:23 sfisque i wonder… are you firing the event from an EJB or a CDI bean?
22:23 whartung CDI bean
22:23 sfisque in the example, it's being fired from a REST endpoint
22:23 whartung injected into a ejb
22:23 whartung triggered by a timer
22:23 sfisque oh
22:23 sfisque CDI == non-existant in @Asynch methods
22:24 sfisque cdi doesnt inject in asynch methods
22:24 sfisque there's no cdi context
22:24 sfisque i had this issue with an @Scheduled
22:24 sfisque there's no cdi linkage
22:24 whartung then I should be getting an NPE on the Event, yes?
22:24 sfisque why, the method isnt even getting called
22:24 sfisque where would u get an npe?
22:25 whartung the method that fires the event is getting called
22:25 whartung no, it may not be valid...bother
22:25 whartung *now
22:25 whartung boy that would such
22:27 sfisque OH
22:27 whartung you may well be right
22:27 whartung when I create the singleton, it injects an Event. This is done @Startup
22:28 whartung when I then @Schedule, I use the same Event<CE> object, that was injected originally.
22:28 sfisque aye because injection is done when the object is marshalled
22:28 whartung Now,it's a bit rude to give me an Event object that doesn't do anything, if there's no context
22:29 whartung (what's the context @Startup for example)
22:30 sfisque for when you have a bean that has a long load time and you want it bootstrapped before consumers want to start soliciting information
22:30 sfisque i'd say, just make the consumer a SLSB unless you really need to store some state
22:31 whartung my bean is only acted upon in two modes: it's a singleton, so @Startup and @Schedule
22:31 whartung I also have a consume that is an ejb
22:31 whartung but it doesn't fire that one either
22:31 sfisque why is the @Scheduled a singleton?
22:31 whartung I have my ChannelRepository thing, that is a generic pojo
22:31 sfisque or rather, why is it tagged @Startup?
22:32 whartung I wrap it in a Singletone EJB (so I don't have to Write My Own Singleton -- I want the repo to be a singleton)
22:32 sfisque since it's scheduled, arguably, you only need it instantiated when the container is ready to fire the event
22:32 whartung I saw no harm in making the scheduled routine to update the repository in the same singleton wrapper bean
22:33 sfisque on the surface sounds sane, but i'm thinking multi-purposing the beans might be causing some issue
22:33 whartung apparently
22:34 sfisque strip it down to minimums and see if you can get it working, then get fancy :-P
22:34 whartung I didn't consider THIS "fancy"!
22:34 sfisque adding asynch to a bean is fancy.  there be dragons thar...
23:49 Naros joined ##javaee
23:49 Naros left ##javaee
23:50 sajjadg MessageBodyWriter not found for media type=application/json; charset=UTF-8, type=class java.util.ArrayList, genericType=class java.util.ArrayList.
23:51 sajjadg I want to return an arrayList and make JAXB convert it to json array
23:54 sajjadg problem solved by changing return type from Response to String
23:55 whartung well according to this, timers should be able to fire off events
23:55 whartung http://tomee.apache.org/examples-trunk/schedule-events/README.html
23:55 whartung however, the technique is unorthodox
23:56 sfisque my guess is the event cannot be captured because of teh sketchy cdi linkage in asynch methods

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

Please see http://irclog.greptilian.com/javaee for which days have been logged.