greptilian logo

IRC log for #javaee, 2013-12-05

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:16 Naros joined ##javaee
01:20 cem__ joined ##javaee
02:53 kobain joined ##javaee
03:03 jenue joined ##javaee
03:38 pdurbin semiosis: so nothing is standard yet, as far as I can tell
03:39 semiosis fwiw the jersey project (reference impl of jax-rs) is using MOXy for json
03:39 pdurbin yep, exactly
03:39 pdurbin a good starting point: The Java EE 7 Tutorial:JSON in Java EE RESTful Web Services | Java EE Documentation - http://docs.oracle.com/javaee/7/tutorial/doc/jsonp005.htm
03:40 semiosis cool
03:40 pdurbin "Jersey, the reference implementation for JAX-RS (JSR-311) included in GlassFish Server, provides support for binding JSON data from RESTful resource methods to Java objects using JAXB, as described in Using JAX-RS With JAXB in Chapter 31, "JAX-RS: Advanced Topics and Example". However, JSON support is not part of JAX-RS (JSR-311) or JAXB (JSR-222), so that procedure may not work for Java EE implementations
03:40 pdurbin other than GlassFish Server.
03:40 pdurbin The Java API for JSON Processing (JSR-353) does not explicitly support JSON binding in Java. A future JSR (JSON Binding) that is similar to JAXB for XML is under consideration for a future release of Java EE.
03:40 pdurbin "
03:40 semiosis oh interesting
03:40 pdurbin which leads one to wonder about that future JSR... for JSON Binding
03:41 pdurbin I'm not sure it exists yet
03:41 pdurbin but here's a great blog post: JSON Binding with JAX-RS - Moxy, JSON-P, Jackson, Jettison (TOTD #214) (Arun Gupta, Miles to go ...) - https://blogs.oracle.com/arungupta/entry/json_binding_with_jax_rs
03:41 pdurbin "MOXy is the default and preferred way of supporting JSON binding in your Jersey applications."
03:42 pdurbin and here's some code: https://github.com/javaee-samples/javaee7-samples/tree/master/jaxrs/moxy
03:42 semiosis pdurbin: you were at java-one right? looks like you missed it - https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=3838
03:42 pdurbin and more on Moxy here: https://jersey.java.net/documentation/latest/media.html
03:43 semiosis the slide deck from that java-one session: https://oracleus.activeevents.com/2013/connect/fileDownload/session/514F9D38E8ACECDE2A284EC311DDDD29/CON3838_Doughan.pdf
03:43 pdurbin semiosis: d'oh! "Introducing the Java API for JSON-Binding (JSON-B) JSR [CON3838]"
03:44 pdurbin "JSON-binding is converting Java objects to/from JSON"
03:44 pdurbin yep. that's what I want. But what's the JSR number?
03:45 pdurbin "JSR proposal is currently being prepared"
03:45 semiosis whats in a number? ;)
03:46 semiosis wow they're really calling it json-p?  dont they know that name is taken?
03:46 semiosis @lucky jsonp
03:46 semiosis eh
03:47 semiosis javaeebot: lucky json-p
03:47 javaeebot semiosis: http://en.wikipedia.org/wiki/JSONP
03:47 semiosis right
03:47 pdurbin yeah, there's already a jsonp
03:47 semiosis two bad naming collisions in here today... json-p & amqp
03:48 semiosis naming things is hard
03:48 pdurbin here's that guy who gave the talk and posted those slides: https://twitter.com/bdoughan
03:49 semiosis neat
03:50 semiosis my advice is to not worry about a jsr.  people got along fine for years & years without a jsr for dependency injection
03:50 semiosis there's several great json binding libraries available today, pick one & dont look back
03:50 pdurbin yeah, I'll probably give moxy a try
03:51 semiosis i've been working with moxy this week and it's pretty nice
03:51 pdurbin cool
03:51 semiosis jackson is nice too
03:52 semiosis havent used any of the others
03:52 semiosis but they're probably also nice lol
03:52 * semiosis wonders why there are so many
03:52 pdurbin heh
03:52 pdurbin this is why they standardize this stuff... eventually
03:53 semiosis there's still three popular implementations of jpa iirc, and idk how many unpopular ones
03:53 semiosis meh
03:54 pdurbin MOXy is the New Default JSON-Binding Provider in GlassFish 4 (The Aquarium) - https://blogs.oracle.com/theaquarium/entry/moxy_is_the_new_default
03:54 semiosis then go with that
03:54 pdurbin "It is in fact correct that Java EE 7 has standardized JSON processing (via JSON-P) but not a JSON binding API yet (although such a standardized API is a very strong consideration for Java EE 8 and would build upon the JSON-P work)."
03:55 pdurbin ah, and code at http://blog.bdoughan.com/2013/06/moxy-is-new-default-json-binding.html
03:58 semiosis http://wiki.eclipse.org/EclipseLink/Examples/MOXy#MOXy.27s_JSON-Binding
03:58 semiosis i found the twitter example there very helpful
04:02 * pdurbin looks at http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JSON_Twitter
06:35 * sfisque is a sad panda
06:36 sfisque GF 3.1.2.x does not support JNDI Events on its Custom Resource directory.  :-(
06:36 sfisque anyone know if this is fixed in the 4.x stream?
06:51 dangertools joined ##javaee
08:07 pleroma joined ##javaee
08:43 weyer joined ##javaee
09:38 AlexCzar joined ##javaee
09:43 pleroma joined ##javaee
10:21 neuro|sys morning
10:37 acuzio morning ladies
10:43 dangertools joined ##javaee
11:26 cem__ joined ##javaee
12:06 tangatools joined ##javaee
12:06 tangatools joined ##javaee
12:27 cem__ why we need to have servletconfig ?
12:50 drspockbr joined ##javaee
12:52 pdurbin javaeebot: lucky servletconfig
12:52 javaeebot pdurbin: http://docs.oracle.com/javaee/5/api/javax/servlet/ServletConfig.html
12:53 pdurbin cem__: here's a deceny example: http://www.mkyong.com/servlet/how-to-pass-parameters-to-a-servlet-servletconfig/
12:54 cem__ but there is no need of servletconfig right
12:54 cem__ we can store in enum
12:55 cem__ constant
12:55 pdurbin javaeebot: lucky servletconfig vs. enum
12:55 javaeebot pdurbin: http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletConfig.html
13:00 pdurbin cem__: keep talking. I don't understand what you mean
13:02 cem__ what do you mean
13:02 cem__ you dont understand
13:02 pdurbin right
13:03 cem__ right ?
13:04 pdurbin cem__: keep talking. I don't understand what you mean
13:05 cem__ neither i dont understand what do you mean
13:05 cem__ do*
13:06 pdurbin I'm not the one with the question :)
13:06 pdurbin (for once) :)
13:06 cem__ you never asked the question
13:11 cem__ left ##javaee
13:17 jieryn joined ##javaee
13:17 jieryn joined ##javaee
14:01 AlexCzar joined ##javaee
14:10 acuzio joined ##javaee
14:10 acuzio joined ##javaee
14:19 sheenobu joined ##javaee
14:29 AlexCzar hillarious conversation…
14:31 pdurbin :)
14:32 Naros joined ##javaee
14:32 sheenobu Sounds like I barely missed something good
14:32 sheenobu joined ##javaee
15:53 helga joined ##javaee
15:58 helga hi guys! could anybody explain, how to work with java Iterable? i need to implement function, that takes Iterable<Integer> as a parameter. i need to  iterate through this sequence and mutate each element of it in a particular way.
16:00 sess ~ Iterable
16:00 sess ~Iterable
16:00 sess bleh
16:00 sess helga: http://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html
16:01 sess It should be fairly obvious from the API
16:02 Fubar^ or use guava's Iterables.transform
16:02 Fubar^ And there is no reason to look at the Iterator javadoc. Since you are doing it wrong if you use it that way
16:03 sess huh?
16:03 Fubar^ You can iterate over an iterable with enhanced-for
16:03 Fubar^ So you don't need to know how an iterator works
16:03 pdurbin helga: here's an example I happen to be staring at: http://wiki.apache.org/solr/Solrj#Highlighting
16:04 pdurbin while (iter.hasNext()) {...
16:04 Fubar^ for (Integer i : theIterable) { ...
16:04 Losowski joined ##javaee
16:04 sess I think "wrong" is a bit harsh, but sure a for loop is probably enough
16:07 helga thank you, this: for (Integer i : theIterable) works!:)
16:16 Losowski left ##javaee
16:28 Losowski joined ##javaee
16:34 pdurbin solr or elasticsearch? any preference?
16:39 semiosis elasticsearch (the company) hired three people i know from the logstash community and one i know from redhat/gluster, so i'd go with them
16:40 pdurbin interesting reason :)
16:42 Losowski left ##javaee
16:44 pdurbin bah! `@EJB MyBean myBean` was working a minute ago but now myBean is null. Why?
16:45 sess is the class managed?
16:47 pdurbin it's @Stateless and @Named
16:47 Naros pdurbin: I use solr combined with Hibernate search
16:47 Naros it works extremely well
16:48 pdurbin Naros: not SolrJ?
16:48 Naros the only caveat I am still dealing with is how to manage rebuilding the index due to non-ORM changes to the datastore.
16:48 Naros I believe HSEARCH uses Lucene/SOLR under the hood
16:49 Naros i could be wrong but i think you can have it use other impl too, not just lucene
16:51 pdurbin we're just using ordinary JPA
16:53 Naros Ah
16:53 pdurbin sess: I restarted glassfish and now @EJB works again. #wtf
16:55 sess classic random error
16:55 sess containers fail everyonce in a while
16:55 sess for whatever reason
16:58 pdurbin stupid container
17:04 pdurbin (glassfish 4)
17:06 pdurbin I know I can put a comment above a <dependency> in maven but is there an element I can use within the <dependency> block? something like <whyImIncludingThisDependency>?
17:07 acuzio sess: Did you get to the bottom of the Transaction stuff ?
17:08 sess acuzio: I removed the exception translator instead, and left transaction settings as they were
17:08 sess haven't got time to dig deep into it and don't want to change any code
17:12 semiosis pdurbin: it's just xml, you can put <!-- --> pretty much anywhere
17:13 semiosis except within another tag.  this is not allowed: <depen<!-- foo -->dency>
17:14 pdurbin semiosis: yeah, just put the comment within, I guess
17:14 pdurbin I just didn't know if there was a standard way to do this
17:14 pdurbin even <description> or something would be fine
17:56 kinabalu joined ##javaee
18:16 sfisque joined ##javaee
18:25 sfisque anyone here ever wired in a custom JNDI Factory into glassfish directly?  it seems Custom Resources do not implement the Event API that jndi supports.
18:56 pdurbin no but this new thread on the glassfish dev list is getting interesting: About adding modules/features for GlassFish dynamiclly (sic) https://java.net/projects/glassfish/lists/dev/archive/2013-12/message/0
19:09 whartung I thought this was already done with all of the OSGi work
19:13 sfisque i'm guessing it involves "non EE" features or features "outside" the osgi spec
19:48 pdurbin not sure
19:56 sheenobu someone mentioned OSGI. yay?
20:00 pdurbin yay
20:01 whartung more like "vey" as in "oi vey"
20:01 sfisque lolz
20:04 sfisque so i realized that i don't need to do dynamic uri's for dispatching data.  i must have been having a brain fart, because it occurred to me that i could just wrap the link around a f:setPropertyActionListener
20:05 sfisque prevents me from supporting deep linking for those linkages, but still doable in the near term for now
20:06 sfisque having the REST->redirect->facelets  would allow me to deep link for data dynamic views in a jsf context
20:49 knoppix joined ##javaee
21:04 sheenobu oh! I forgot to continue that line of thought
21:04 sheenobu I want to like osgi
21:04 sheenobu but I haven't used it enough
21:04 sheenobu and I don't know enough people who use it
21:08 sfisque if you're doing EE, you "use it".  bascially unless you're writing a container level facility, you don't actually write osgi code
21:13 sheenobu right, I understand that.
21:14 sheenobu If I'm going to 'use' osgi, it would be with an osgi container directly, not specifically with an EE container that is osgi-based.
21:14 sfisque OR
21:15 sheenobu not that I prefer one over the other (this /is/ ##javaee) but that i would consider that to be 'using'.
21:15 sfisque you'd write an implementation for a facility that the container exposes regardless of whether it's an EE container or an osgi container
21:15 sheenobu right
21:15 sfisque like publishing a directory server that exposes a JNDI interface, and bootstraps in a way to be osgi compliant so it can plug in or be hot swapped according to the spec
21:16 sheenobu right
21:17 sheenobu project i'm on right now pre-dates spring, modern javaee and has NO modularity. I guess I just want that, regardless of the tech used
21:17 sfisque "modern javaee"… as in pre ejb3?
21:18 sheenobu I assume as much. IIRC spring predates ejb3 by quite a bit
21:18 sfisque only a couple of years actually
21:18 sheenobu i see
21:18 sfisque ejb3 rolled off the assembly line about 5ish years ago
21:19 sfisque and ejb1 spec came out about 14 years ago
21:19 sheenobu woo
21:20 sfisque javaeebot lucky spring framework java timeline
21:20 sheenobu i'm a bit young to remember that >_>
21:20 javaeebot sfisque: http://en.wikipedia.org/wiki/Spring_Framework
21:20 sfisque oh noze… is javaeebot sick?
21:20 sfisque oh there we go
21:20 sfisque spring 1.0 march 2004
21:20 sheenobu i see that
21:21 sfisque so v1.0 predates ejb3 by about 4 years, but what everyone "considers" spring dates back to 2006
21:21 sfisque so about 2 years prior to ejb3
21:21 sheenobu i see
21:26 sfisque i'm starting to look at prettyfaces.  i forget who linked it to the channel, but thank you if you're listening
21:26 weyer joined ##javaee
21:26 sfisque it looks like a perfect solution to what i want
21:26 sheenobu prettyfaces is nice.
21:27 sfisque yeah.  i miss having controller dispatch via url (like struts/tiles) with jsf.  pretty faces looks like it will give that back to me
21:28 sfisque i'm kind of intrigued why jsf punted on controller dispatch via url, given that some of the struts/tiles dudes were on the JSF committee in the early stages
21:29 sfisque you'd think they'd wire in support for it parallel to the component handling that jsf does
21:29 semiosis my guess would be in those days configuration was preferred over convention
21:30 sfisque i guess, but controller dispatch allows you to deep link on dynamic pages, which is a weak spot for jsf
21:31 sfisque maybe jsf-3 will finally give us best of both worlds :-)
21:33 sheenobu we use spring mvc and i don't think we use controller dispatch via URL. not 100% how that happened
21:33 sfisque you have no uri/{some_dynamic_key} url binding?
21:34 sfisque surprising if so, that's one of the few winning aspects of spring IMO
21:36 sheenobu yeah we have a custom handlermapper/controller resolver
21:42 sess sfisque: cool, i should try it out aswell
21:44 pdurbin the spec leads are very happy to receive feedback
21:46 sfisque sheenobu nifty
21:46 sfisque pdurbin spec leads … on JSF?
21:47 pdurbin sfisque: yeah. Ed Burns and company
21:47 * sfisque picks up the phone...
21:47 pdurbin all the Java EE spec leads really
21:48 Losowski joined ##javaee
21:48 pdurbin that's what they said at this talk anyway: Meet the Java EE Specification Leads [BOF2795] https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=2795
21:48 pdurbin :)
21:48 sfisque i definitely have a bone to pick with the GF people who did the JNDI repo.  i was going to wire up our jndi configuration fields with event handlers, and then, got all sorts of ClassCastExceptions because they didnt implement EventContext.   blech
21:49 sfisque i wanted to remove the need for a JMX endpoint for runtime configuration, by having JNDI callbacks when values changed on the fly.  boy was i miffed by that roadblock
21:49 sess I only wish the "official" web framework wasn't such a weird one
21:50 sess as in JSF
21:50 sfisque aye.  at first jsf is very wierd.  it took me sometime to "unlearn" controller dispatch from struts/tiles and embrace component dispatch.  talk about a paradigm shift
21:51 sfisque it finally hit me… had the "oh…. now i get it" moment, and i felt better after that
21:51 semiosis and this is why i put up a rest api barrier between core java & frontend code
21:51 semiosis jax-rs FTW!
21:51 sess sfisque: it works, but it's quirky and lacks many features that feels obvious that they are needed
21:52 sheenobu yeah i hated life in the JSF 1.1 days, afraid to go back
21:52 sfisque what mech do you use to maintain "state/session" with that
21:52 sess such as running some code on load
21:52 sess doing it is possibly, but feels very hacky and unsafe
21:52 sess the JSF templates are pretty good though
21:52 sheenobu our sessions were giant though, I mean like hibernate entities pushed into the session, relationships and all.
21:52 sess wish I could use JSF templates with spring mvc
21:53 sess since JSP is a giant pain in the butt
21:53 sfisque oh my…. [in george takei voice]
21:53 sess sheenobu:  I just abuse viewScope these days
21:53 sess put everything in it
21:53 sfisque why not use struts2/tiles2 then?  if you want good templating with url dispatch?
21:53 sess and work against it with ajax
21:53 sess sfisque: struts2 feels unstandard, and doesnt it use jsp?
21:53 sheenobu imo i don't mind jsp(x), providing we use decent taglibs, dont' embed code, etc
21:54 sfisque struts uses whatever you wire in,  jsp, velocity, tiles, whatever
21:54 sess just the fact that it lacks ui:composition drives me mad
21:54 sfisque and i LOVE tiles… always have going back to 1.2
21:54 sess I hate tiles
21:54 sfisque yes, no decoration/compositing
21:54 sess having to look in a configure file every single time im looking for something simple? No thanks
21:55 sess I guess it could be alright with simple templating, just header/footer/sidebar
21:55 sfisque looser decoupling.  controller doesnt have to know where the file is, just uses some agreed on uri
21:55 Losowski left ##javaee
21:56 sfisque tiles works great for that.  you build a boilerplate layout and then punch in the tiles in the various areas
21:56 sfisque give the layout subclasses meaningful uri's and the controller is then decoupled
21:57 sfisque but yes, tiles does require more xml than i'd like
21:57 sfisque though with v2 it's "better" than v1 was
21:58 sfisque i will admit though i do prefer jsf ajax over S2/T2 ajax
21:58 sess I use struts 1 with tiles in a project, that's very confusing
21:58 sess dont remember if it was tiles 1 or 2
21:58 sfisque probably 1 on both.  i do not know if S1 has a T2 plugin
21:58 sfisque but yeah S1/T1 is "good" but does get heavy handed with the xml configuration
21:58 sess If I have an url, i have to search around for like 1-2 minutes to find the correct JSPs and controllers
21:59 Naros o.O
21:59 sess reused content JSPs combined with controller inheritance
21:59 sess ugh
22:00 sfisque i try to avoid controller inheritence.  i prefer controllers be idempotent pojos, if possible unless it's a gross transgression against DRY
22:00 Naros Yah we have quite a number of controllers that subclass more abstract types but the inheritance tree is generally no more than 3 deep
22:00 sess idempotent?
22:00 sess is that even a word
22:00 sfisque javaeebot definition idempotent dictionary
22:00 javaeebot sfisque: Error: "definition" is not a valid command.
22:00 sfisque javaeebot lucky idempotent dictionary entry
22:01 javaeebot sfisque: http://www.merriam-webster.com/dictionary/idempotent
22:01 sfisque in this context, self contained, no sub/super classes
22:01 sfisque one of them thar mathy words
22:01 sess that word made no sense whatsoever in this context lol
22:01 * sfisque is a mathematician
22:01 sess but sure i get your point
22:02 sess keeping it DRY is very hard without inheritence
22:02 sess especially when fetching data is often only possible from the controller itself
22:02 sess rather than utility classes
22:02 sfisque there are other ways than inheritence.  many dev's under utilize composition over realization
22:03 sfisque fragment the utility and inject/instantiate it
22:03 sfisque like legos
22:03 sess the composed instances are usually less powerful than the controllers though
22:03 sfisque inheritence is powerful but there are mis-uses of it i feel
22:03 sess with DI frameworks
22:04 sess yeah inheritence is very misused, I do it myself :x
22:04 Naros if you're talking struts, you can often avoid inheritance in favor of ModelDriven<>
22:04 sfisque right, but merely inheriting an object just to get a method is not "proper"  in a (self admittedly way) pedantic sense
22:04 whartung I was inherited...
22:04 sfisque lolz
22:04 sess sfisque: exactly
22:05 sess I made some stuff for JSF that im not quite sure im alright with
22:05 sess such as AbstractEntityController<T> that stores an ID and an instance of an entity
22:05 sess for those pages where you edit some object
22:05 sfisque we had someone here previously who ran rampant with inheritence.  lets just say, he managed to reinvent spaghetti code without "goto" which is quite an accomplishment
22:05 sess often it introduces more complexity than help
22:06 whartung yea, to a point
22:06 sfisque oh templated controllers…
22:06 * sfisque runs away screaming
22:06 Naros lol, I believe I has one of those too....  DocumentAttachmentAction<T>
22:07 sfisque we have….
22:07 * sfisque starts counting
22:07 sfisque …. more than this….
22:07 * sfisque holds up both hands and feet
22:07 sfisque …. too many
22:07 Naros haha
22:07 sfisque an easter egg from a previous member of the team
22:07 * sfisque begins to cry
22:08 Naros We have things like WorkOrderAction and then a WorkOrderCreateAction and a WorkOrderSaveAction and a WorkOrderApproveAction, etc.
22:08 Naros where the create, save, and approve subclass the work order action
22:08 sfisque and they are all subclasses of WorkOrderAction<T>?
22:08 sfisque nailed it
22:08 sfisque !!!
22:08 Naros Nah, it isn't templated.
22:09 sfisque may the baby java bless you
22:09 sfisque :-D
22:09 Naros The parent class basically holds all common parameters, methods, and refactored api
22:09 sfisque aye and they are semantically related, which makes sense for inheritence
22:09 * sfisque does a sincere golf clap
22:09 Naros hah
22:09 sfisque :-D
22:10 Naros One could argue tho in struts, just create a single action and leverage different methods mapped to urls, but i dislike that approach.
22:10 sfisque for a small site that would be fine.
22:10 sfisque if you're serving up a simple workflow with a couple renderings, why not
22:10 Naros prefer my action class to be specific to a certain control flow
22:10 sess single action is pretty awrful
22:10 sess awful
22:10 sfisque but not for something enterprise driven
22:11 sess "works for small sites" is just another word for bad
22:11 sess anything works for small sites
22:11 sfisque not really.  if you're just building a toy site for some friends, why over architect
22:11 sess It's not even more work really
22:12 sess I assume you meant using like querystring to point out an action
22:12 sfisque that's one mech that for a small site (like 5 users?) is a good fit, as long as you still sanitize the input
22:13 sfisque security concerns dont go away with scale, once it's public cloud facing
22:13 sess just seperating the actions to different methods would improve design greatly with almost no effort
22:13 sess :d
22:13 sess aaanyways im off to bad :>
22:13 sess bed even*
22:14 Naros lol
22:14 * sfisque waves to sess
22:14 sfisque with modern IDEs sure.
22:14 sfisque right click —> refactor —> move up
22:15 whartung right click -> rewrite -> move out
22:15 sfisque eclipse?
22:15 whartung life
22:16 sfisque oh, lolz
22:23 kobain joined ##javaee
23:20 pdurbin_m joined ##javaee
23:21 pdurbin_m where did sess go? Ed Burns replied right away: http://www.evanchooly.com/logs/%2523%2523jsf/2013-12-05
23:23 sfisque oh my icefaces
23:29 sfisque i see you dropped a hint about using rest to serve up facelets
23:30 sfisque or was that ed burns offering that as a hint?
23:30 sfisque How about if you could use JSF templates with JAX-RS MVC in Jersey?

| 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.