greptilian logo

IRC log for #javaee, 2013-10-30

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:00 tjsnell what did you try?
00:02 AlCoF joined ##javaee
00:02 cem_ tjsnell: there are different software for this but none worked for hand written to digital
00:03 tjsnell because that's a very hard issue
00:03 cem_ sfisque: how can i do it ?
00:04 sfisque assuming you have a scanner, write a JNI wrapper around a twain driver (twain is a standard scanner API that most (all?) scanner manufacturers abide by when writing their drivers)
00:04 tjsnell find some software that can handle hand writing
00:05 tjsnell his issue is ocr
00:05 sfisque oh, are you wanting OCR
00:05 sfisque maybe google around and see if someone has open source OCR library (doubtful, but plausible)
00:05 cem_ Yes tjsnell  right on the point
00:05 sfisque if so, if its java, there you go.  if it's c/c++, you can still go the JNI route
00:06 tjsnell especially for hand writing
00:06 tjsnell jni is the path of much woe
00:06 sfisque it's not that bad, but not for the feint of heart
00:06 sfisque thar be dragons there....
00:07 tjsnell oh it's easy at first
00:08 sfisque reminds me of taht scene with jeff goldblum in jurassic park 2.   "oh, you say that now… but later… there's lots of running, and screaming...."
00:09 pdurbin maybe opencv? https://github.com/Itseez/opencv/blob/master/samples/cpp/letter_recog.cpp
00:14 cem_ thanks pdurbin
00:17 cem_ i'll inform you guys if things go fine :)
00:17 cem_ bye
00:22 tjsnell if we don't hear from him I guess it's a fail
00:23 pdurbin it's a very hard issue
00:43 AlCoF joined ##javaee
00:57 sfisque joined ##javaee
00:58 sfisque1 joined ##javaee
00:59 nick___ joined ##javaee
01:01 nick___ hello
01:02 nick___ what are different types of webservice are there ?
01:03 nick___ JAX RPC , JAX WS , SOAR , JMS, Apache AXIS....................... ??
01:06 tjsnell about a bazillian
01:06 sfisque1 JMS is not a web service.   axis is just an impl of SOAP
01:06 tjsnell Apache Axis isn't a webservice
01:06 sfisque1 basically jax-rpc, jax-ws, soap, and rest are your basic choices
01:07 sfisque1 as far as "standards" are concerned
01:07 tjsnell websockets
01:07 sfisque1 after that you have a ton of "proprietary" solutions, hessian, http invocation (spring).
01:07 sfisque1 is websockets really considered web services?
01:07 tjsnell not sure
01:08 sfisque1 javaeebot lucky websockets specification
01:08 sfisque1 oh noze
01:08 sfisque1 javaeebot` lucky websockets specification
01:08 javaeebot` sfisque1: http://tools.ietf.org/html/rfc6455
01:09 sfisque1 what i thought.  it's just two-way comm over http.  transport protocol not a service layer
01:09 sfisque1 quote :    The WebSocket Protocol enables two-way communication between a client
01:09 sfisque1 running untrusted code in a controlled environment to a remote host
01:09 sfisque1 that has opted-in to communications from that code.  The security
01:09 sfisque1 model used for this is the origin-based security model commonly used
01:09 sfisque1 by web browsers.  The protocol consists of an opening handshake
01:09 sfisque1 followed by basic message framing, layered over TCP.  The goal of
01:09 sfisque1 this technology is to provide a mechanism for browser-based
01:09 sfisque1 applications that need two-way communication with servers that does
01:09 sfisque1 not rely on opening multiple HTTP connections (e.g., using
01:09 sfisque1 XMLHttpRequest or <iframe>s and long polling).
01:10 sfisque1 so you "can" do web services over websockets, but it is just a transport mech
01:13 AlCoF___ joined ##javaee
01:22 nick___ amazon ws ?
01:22 nick___ where should i start
01:23 nick___ to learn web service
01:23 pdurbin aws is a thing
01:23 pdurbin nick___: what are your goals?
01:23 nick___ pdurbin: what the heck are you asking ?
01:23 pdurbin nick___: what are you trying to learn?
01:24 nick___ i want know about web service pdurbin
01:28 pdurbin when Twitter was new you could just curl their API. now you have to auth
01:29 pdurbin I guess GitHub still lets you play with parts of their API without a password
01:29 pdurbin nick___: I'd start there
01:33 pdurbin play with the data at a url such as https://api.github.com/users/arun-gupta/repos
01:34 pdurbin docs at http://developer.github.com/v3/repos/#list-user-repositories
01:38 tjsnell heh
01:38 tjsnell I'm writing a camel github example now
01:42 pdurbin tjsnell: how to use camel?
01:43 tjsnell just throwing up short camel examples at code.notsoclever.cc
01:43 sfisque1 what are you automating?  github fetches?  commit reports?
01:43 sfisque1 oh
01:43 tjsnell oh, in this case I'm putting a SOAP front end on github REST
01:43 tjsnell just demoing a bridge of the 2
01:44 tjsnell the github api was just a convenient example to use
01:44 sfisque1 so, you're consuming REST and rebundling it?  or is this a XSLT massage?
01:45 nick___ my team work uses axis so i want to know about webservice
01:45 tjsnell exposing git API as a SOAP interface
01:45 tjsnell currently the payload is still a json string embedded in the xml package :)
01:45 tjsnell that's up next
01:45 sfisque1 ah, so just a wrapper
01:46 tjsnell yeah
01:46 tjsnell currently we have an app internally that only communicates over SOAP
01:46 tjsnell so just showing protocol bridging
01:46 sfisque1 aye
01:49 pdurbin javaeebot: lucky apache axis
01:49 javaeebot pdurbin: http://axis.apache.org/axis/
01:50 sfisque javaeebot lucky apache axis first tutorial tomcat
01:50 javaeebot sfisque: http://axis.apache.org/axis/java/install.html
01:51 nick___ i'm confused i have no clue on web service wsdl,rpc etc i dont get it
01:51 tjsnell pick a tutorial and learn that
01:51 tjsnell then another
01:51 tjsnell REST certainly a bit easier
01:51 tjsnell especially with Jackson
01:51 tjsnell and Jersey
01:52 tjsnell or Play
01:52 tjsnell or Camel
01:52 tjsnell ...
01:52 pdurbin I still say... go play with a REST API like GitHub's... get a feel for it
01:53 pdurbin doesn't java ee let me do a lot of what axis is trying to do? help me build APIs?
01:54 tjsnell axis doesn't do rest does it?
01:54 tjsnell CXF does
01:54 tjsnell which kills axis anywya
01:55 tjsnell Jersey is the jee rest impl
01:55 tjsnell jackson the json impl
01:56 pdurbin yeah, seems like axis does soap
01:57 sfisque i better.  that's what it's for
01:57 sfisque :P
01:57 tjsnell cxf does soap better
01:57 sfisque @WebService.  easy.  done.
01:58 pdurbin sounds like nick___ should learn soap if it's what his team is using
01:59 nick___ pdurbin: they use both each for different project 1 new and other is old
02:01 pdurbin nick___: both? soap and rest?
02:01 nick___ yes
02:02 nick___ 1 started on 2007 they use soap something like that
02:02 tjsnell sfisque:  https://gist.github.com/tjsnell/e885dfac7eab108569b1
02:02 tjsnell from my camel project :)
02:03 pdurbin nick___: ok. makes sense
02:05 sfisque nifty
04:01 nick___ left ##javaee
05:28 bobek joined ##javaee
05:29 jenue joined ##javaee
05:44 dangertools joined ##javaee
05:44 dangertools joined ##javaee
06:42 Quest joined ##javaee
06:46 Quest sess hi
06:47 Quest whartung sfisque   , we agreed yesterday that we cant send / recieved mere byte[]s via http. right? there has to be either string or multipart. and thats it.?
06:54 cheater_3 joined ##javaee
07:04 Quest sess whartung sfisque  line 947 http://pastebin.ca/2472645
07:11 sess Quest:  im not very familiar with http connections from java, so dont think i can help much regardless of the issue
07:11 sess also off to work
07:22 Quest ok. thx
08:27 liuzhoou joined ##javaee
09:00 Radditz joined ##javaee
09:39 Radditz joined ##javaee
10:09 pdurbin Quest: application/octet-stream consists of "mere bytes"
10:09 Quest ya
10:09 Quest a byte [] inside the http.responst.input/outputStream() would be a valid http ?  I was in an image that only text and multipart can be uploaded and the downloads are text/html and image/data with headers
10:15 Radditz joined ##javaee
10:20 Quest Radditz welcome back
10:20 Radditz thank you Quest , my wifi connection drops often
10:20 Quest so does mine
10:24 bobek left ##javaee
10:56 Quest_ joined ##javaee
10:59 Quest joined ##javaee
11:09 MegaMatt joined ##javaee
11:54 kotten joined ##javaee
12:26 hurk joined ##javaee
12:48 tommmied joined ##javaee
13:24 pdurbin whartung: dunno if you're awake yet but when I add your exclusions I get the same error about Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
13:24 pdurbin Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
13:24 zoot oh
13:24 zoot check the systemproperty
13:25 zoot and set it to something else
13:25 zoot or add that jar
13:25 zoot :P
13:26 pdurbin zoot: when I add that jar I get "DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory" as I explained at http://irclog.greptilian.com/javaee/2013-10-29#i_35909
13:26 pdurbin I'm sure people here are sick of hearing about it. :)
13:26 pdurbin but I wanted to let whartung know I tried his thing
13:27 zoot welcome to jarhell
13:27 pdurbin hot enough for you?
13:27 zoot i'm fraid we can't find your class to day
13:35 pdurbin it's like school during a fire drill. no class! -- that kid on Fat Albert
13:35 Naros joined ##javaee
13:40 aldaris joined ##javaee
13:40 aldaris left ##javaee
13:41 balo joined ##javaee
13:41 balo hi
13:41 Naros hello
13:42 tmichel joined ##javaee
13:43 pdurbin balo: sorry about the confusion over #javaee vs. ##javaee: http://irclog.perlgeek.de/openam/2013-10-30#i_7788261
13:43 balo pdurbin: np, thanks for the tip. i didn't know about this channel :)
13:44 pdurbin I need to write a patch for philbot: http://irclog.perlgeek.de/ilbot/2013-10-20#i_7739131
13:45 balo :)
14:10 zoot http://devnull-as-a-service.com/
14:12 balo i saw this on twitter today :D i'll definetly use it... the devnull on my machine isn't scalable :(
14:12 balo i hope they use nodejs
14:17 zoot but you can use a clouddatabase like a filesystem with nodejs!!!1
14:30 AlexCzar joined ##javaee
14:43 polosatinsk joined ##javaee
14:55 kobain joined ##javaee
15:03 kotten joined ##javaee
15:14 AlexCzar joined ##javaee
15:44 jieryn joined ##javaee
15:44 jieryn joined ##javaee
16:27 Naros Anyone here use JPA2.0 criteria?
16:33 sfisque yes
16:33 sfisque we only use it
16:33 sfisque no jpql
16:33 Naros Cool, got a conundrum.
16:33 sfisque kk
16:34 Naros EntityA has an EntityB which has an EntityC
16:34 Naros I am querying EntityA but also need to eagerly get B & C
16:34 Naros I've figured out how to get B, but no idae how to get C
16:35 Naros Join<WorkOrder, Facility> workOrderFacility = workOrderRoot.join(WorkOrder_.plant);
16:35 Naros but i need Site inside Plant too
16:35 Naros er inside Facility
16:35 sess select a from A join fetch a.b b join fetch b.c c
16:35 Naros yah but that's using JPQL
16:35 sess joins does not fetch
16:35 sess fetches fetch
16:35 Naros I'm using the JPA2.0 CriteriaBuilder API
16:36 sess use fetch instead of join
16:36 Naros oh
16:36 Naros i gotcha
16:36 sfisque depends.  do you need to specificy qualifiers on the attributes of B and C.  because you cannot add criteira on the fetches
16:36 sfisque do you need to liimit on B.x or C.y
16:36 sess if you need that, you both join and join fetch
16:36 sess in any case, he needs to fetch
16:36 sfisque aye, but be careful with that, using both in tandem can create "pathalogical" queries
16:37 Naros In this case no, just need to load the entitys for the view is all
16:37 sfisque it IRKS me that fetchs do not have the ability to limit on atrributes
16:37 sfisque ok, then have at it
16:37 sfisque :-)
16:37 sess sfisque: pathalogical?
16:38 sfisque we've had a few queries that jpa constructed double and triple redundant joins which confused oracle's explain planner and basically returned in horrible time
16:38 sfisque we had to rewrite the queries to slice the data differently
16:38 sess it might double join when using both join and join fetch
16:38 sess buuut you wont get away from that i guess
16:39 sfisque aye.  adn depending on how the whole thing is assembled into sql, it can confuse the rdmbs explain planner
16:39 Naros sfisque: do you guys used the type-safe api or just strings?
16:39 sfisque ***rdbms
16:39 sess how would it, joins are simple stuff
16:39 sess its just normal PK-FK joins
16:39 sfisque typesafe metadata
16:39 sess Naros:  i use typesafe
16:39 sess no reason to use criteria api without it
16:39 Naros hm, how would I construct the type-safe fetch statement for C
16:39 sess you add the metamodel generator plugin
16:40 sess Entity_.field
16:40 Naros workOrderRoot.fetch(WorkOrder_facility); works for the child.
16:40 sfisque for C?
16:40 Naros but for site, I dont see anything
16:40 sfisque oh class C
16:40 sess workOrderRoot.fetch(WorkOrder_facility)​.fetch(Facility_.thatOtherCollection);
16:40 Naros k
16:40 sess you can chain them just like regular joins
16:41 sfisque aye
16:41 sess make sure to remember JoinType.Left if needed
16:41 Naros ty, sorry the API is new to me since we haven't used it before and the Hibernate Criteria API is deprecated so making the move to it ourselves.
16:41 sess its quite complicated to learn
16:41 Naros yah im finding out :(
16:41 sess i still have to look up things after several years usage
16:42 sess using group/having/subqueries is witchcraft
16:42 sfisque jpa criteria are "almost" 1-1 with hibernate.  hibernate team contributed heavily to jpa 2.0 jsr
16:42 Naros aye, there is a lot of overlap for sure.
16:42 Naros It's more the syntax
16:42 sfisque yup
16:42 Naros We heavily used Criteria API from Hibernate in the prior release of our app
16:42 sfisque and LCD.  hibernate is denser in features, jpa is more general
16:43 Naros It's pretty powerful but the issue is there were many bugs when it came to things like nationalization :E
16:43 Naros One I found recently where a nationalized column could not be equality checked with using case insensitiity :(
16:45 Naros I don't particularly care for the necessity of adding '%' when I want to do begins with/ends with/contains type operations tho
16:48 Naros Does your metamodel generator create a class for your @EmbeddedId's ?
16:49 Naros e.g. want to query on an entity composite key specific property.
16:50 Naros only way I've found so far is root.get("pk").get("propertyName")
16:51 sess arent embedded ids pretty transparent
16:51 sess i.e would not the fields be included in the parent
16:52 sess or well through pk
16:52 Naros We generally haven't exposed the PK fields on the parent, only through the embedded id class itself
16:52 sfisque the only non-transparency is when you need to limit on specific attributes of the CPK
16:53 Naros right in this case, I want to get all WorkOrder entities where the CPK's workOrder number is like '%23%' for example
16:53 sfisque so if you have PK(x,y,z) and you have a query/subquery where you need to limit on PK(y in (a,b,c)), or similar
16:53 sess never used embeddedId so not sure if any class in generated
16:53 sfisque then you have to explicitly call out the CPK in the query, otherwise, as sess indicates, it's just like any other pk
16:54 Naros the hibernate metamodel generator doesn't give me a WorkOrderId_ class
16:54 sess that was pretty much expected i guess
16:54 sfisque is it annotated properly?
16:54 sess or
16:54 sess in your object using the ID, what type does the generated pk have?
16:54 sess it has to have some type.. so it should be generated i guess
16:54 Naros https://hibernate.atlassian.net/browse/METAGEN-105
16:54 Naros there's the code in question
16:56 Naros hehe, see a typo in my post :/
16:56 sess uh embeddable + mappedsuperclass
16:56 sess you sure have some weird stuff
16:56 Naros Yep
16:57 sess I really think WorkOrderId_ should be generated in this case
16:57 sfisque never used @MappedSuperclass.  what does that do?
16:57 sess cant see any other way to access fields inside it
16:57 sess you can inherit fields from it
16:57 Naros @mappedSuperclass allows me to create another class that basically inherits those fields
16:57 sfisque i'm guessing that confused hibernate
16:57 sess for example, i have @MappedSuperclass AbstractEntity with the field @Id private Long id
16:57 sess that most entities inherit from
16:57 Naros Aye.
16:58 Naros We do similar thngs but usually entitiy-specific
16:58 sess though the metamodel IS generated from mapped superclasses aswell
16:58 sess and i think it should be generated for embeddable objects aswell
16:58 sess are you 100% sure it is not generated?
16:58 Naros Those 2 fields are inherited in the WorkOrderDoodad, WorkOrderComponent, WorkOrderCost, and WorkOrderOperation PKs.
16:58 Naros Yeah it isn't in my metamodel dir :E
16:59 sfisque the other question i have, is the class generated for other examples that use the same construct (aka local failure, or systemic)
16:59 Naros Nope
16:59 Naros I see no Id classes generated anywhere.
16:59 Naros across the entire domain landscape
17:00 sfisque i'm guessing MSC and Embedded do not work together
17:00 sess hmm one thought
17:00 sfisque bug or feature
17:00 sess Naros:  is the embeddable object defined in your persistencexml?
17:00 Naros No, we use the scanning features to locate entities and wire them in
17:00 sfisque shouldnt matter.  our persistence.xml is empty except for the junit version
17:00 sess it could matter if he listed other entities
17:00 sess but alright
17:01 Naros So technically its my understanding I should have gotten a WorkOrderId_
17:01 sess I think so
17:02 sess what happens if you remove @MappedSuperclass and try running the generator?
17:02 Naros let me see.
17:02 sess or create a new simple embeddable and see if it gets generated
17:02 sess im getting off work now, so bbl
17:03 Naros Doesn't make a difference.
17:03 sfisque CPKs get generated in our project fine, but we do not use @MSC
17:04 Naros Aye you're using a different generator tho i suspect.
17:04 sfisque i just double checked for sanity and i see  ***PK_  all over the place
17:04 sfisque eclipselink
17:04 Naros yah, using hibernate's
17:04 sfisque but we also do not use @MappedSC
17:05 sfisque simple embedded PKs
17:05 Naros so then only solution is the non-typesafe string approach for these :E
17:05 Naros Path<String> workOrderPath = workOrderRoot.get("id").get("workOrder");
17:05 Naros predicates.add(criteriaBuilder.equal(​criteriaBuilder.lower(workOrderPath), workOrder.toLowerCase()));
17:05 sfisque i have found trying to be "cute and slick" in entities only makes for headaches.  i tend to let the entities be "VERY POJO"
17:06 sfisque in the short term, you CAN move the strings into the entity as static finals, that way the code "feels" uniform, and then refactor when able
17:06 Naros Aye, but even removing the inheritance stuff with MSC, seems hibernate's jpa metamodel generator isn't working with embeddedids
17:06 sfisque that surprises me.  it must be a regression because i've used hibernate to gen classes that had CPKs
17:06 Naros right just expose the PK values on the entity itself
17:06 sfisque in the past
17:07 sfisque try rev'ing hibernate either up or down
17:07 sfisque and see if it goes away
17:07 Naros the metamodel gen right?
17:07 sfisque yes
17:07 sfisque no
17:08 sfisque nm.  i'm misremembering
17:08 sfisque when i used hibernate, it was just before jpa2 came out
17:08 sfisque so only used it for the model gen, not the metamotel gen
17:08 sfisque ***metamodel
17:08 sfisque don't listen to me, i'm tired and distracted today :P
17:09 sfisque either way, though sounds like you have either a "bug" or a "feature"
17:10 Naros reverted from 1.3.0 all the way back to 1.0.0 and same output
17:10 sfisque looks like hiberante MMgen has a hole
17:10 Naros leave it to me to find it :E
17:10 * sfisque hands Naros a hot cocao
17:11 Naros I guess I can take your advice and expose the fields in the root entity and type-safe query from there.
17:11 Naros and refactor when the MMgen is fixed.
17:11 * sfisque nods
17:12 sfisque if you look in the MM classes, they're just wrappers around lots of static finals string constructs
17:13 sfisque all you'd be doing is relocating the missing reference temporarly until they get their butts in gear :P
17:13 sfisque you "could" always hand craft the MMclass yourself, and tag it @Deprecated so it can get whacked if hibernate eventually produces it
17:13 sfisque they're fairly trivial
17:15 sfisque here's an example of one of ours gen'ed by eclipselink
17:15 sfisque package com.k12.entity.metatypes;
17:15 sfisque import javax.annotation.Generated;
17:15 sfisque import javax.persistence.metamodel.SingularAttribute;
17:15 sfisque import javax.persistence.metamodel.StaticMetamodel;
17:15 sfisque @Generated(value="EclipseL​ink-2.4.2.v20130514-rNA", date="2013-10-29T16:22:59")
17:15 sfisque @StaticMetamodel(StateCodePK.class)
17:15 sfisque public class StateCodePK_ {
17:15 sfisque public static volatile SingularAttribute<StateCodePK, Character> stateCodeCid;
17:15 sfisque public static volatile SingularAttribute<StateCodePK, String> stateMachineCid;
17:15 sfisque }
17:16 sfisque basically just some SA bindings to make type safety happy :-)
17:22 Naros Yep
17:22 Naros That's true
17:23 Naros Except I think the build process whacks the metamodel directory so I'll need to put these extra ones somewhere and copy them post generate sources
17:24 Naros Could always just drop them in the src/main/java tree i suppose
17:25 Naros now I really ponder why have these DAO classes :P
17:26 Naros they pretty much abstracted hibernate-centric stuff
17:30 Naros sfisque: this look right?
17:30 Naros Root<WorkOrderId> workOrderIdRoot = criteriaQuery.from(WorkOrderId.class);
17:30 Naros predicates.add(criteriaBuilder.equa​l(criteriaBuilder.lower(workOrderId​Root.get(WorkOrderId_.workOrder)), workOrder.toLowerCase()));
17:34 Naros answer appears to be no cause got java.lang.IllegalArgumentException: Not an entity: class com.setech.mrovelocityhub.persistence.m​aintenance.model.WorkOrder$WorkOrderId
17:51 Nikitha joined ##javaee
18:03 Nikitha left ##javaee
18:03 Naros sfisque: I'm getting NPE using my manually created metamodel class
18:03 Naros either it is not using it or im doing something wrong :)
18:08 scripty joined ##javaee
18:12 sfisque wierd
18:12 sfisque sorry was afk
18:12 Naros np.  also found the mmgen issue
18:12 sfisque typo in an annotation?
18:12 Naros seems if the class is an inner class, it doesn't generate.
18:12 sfisque OH
18:12 Naros but if i move it outside as it's own class, it does find it
18:12 sfisque for the love of all that is holy and java why would you have an inner class in an entity?
18:13 Naros lol
18:13 * sfisque slaps Naros with a huge noodle
18:13 * Naros grins.
18:13 Naros Looks like I have a bunch of refactoring to do :3
18:13 sfisque ROFL i bet
18:13 Naros cause all my classes embed their PKs
18:14 Naros but that aside, I still can't get my typed-safe query t owork
18:14 sfisque right click, Refactor, move
18:14 sfisque or i think its' Inner -> Outer
18:14 sfisque have to double check.. one sec
18:15 Naros criteriaBuilder.equal(workOrderRoot.get(Wo​rkOrder_.id).get(WorkOrderId_.workOrder), workOrder);
18:15 Naros Why does this give me NPE
18:15 sfisque yah move Inner to Outer level in refactor
18:15 sfisque did you instantiate the CB?
18:15 Naros ofc :P
18:16 Naros seems the first workOrderRoot.get(WorkOrder_.id) is what gives the NPE
18:16 sfisque is the object "new"  (aka no PK value?)
18:16 Naros i dont follow
18:16 sfisque aka x.id == null
18:17 Naros I'm just trying to select work orders where workOrder.id.workOrder = value
18:17 sfisque oh so workOrderRoot is a Root<x>  gotcha
18:17 Naros Yah
18:17 sfisque have you gen'ed the MMs yet?
18:18 Naros yep
18:18 Naros id is being auto-gened now
18:18 sfisque kk.  not sure why you'd get an NPE.  that seems "odd"
18:18 Naros now it works :E
18:19 Naros WTH
18:19 sfisque caching?
18:19 sfisque in the IDE?
18:19 Naros shouldn't had been, i added some debugging changes to make sure it was building hte class and the new debug statements were written so IDK
18:19 sfisque i know netbeans sometimes takea  while to remove the red lines when i'm working with entities and MMs
18:19 * Naros shrugs.
18:19 Naros At least I got it workin
18:20 sfisque gratz :-)
18:20 Naros assumed i might had been doing something wrong
18:20 sfisque yah, it wasnt apparent to me that your PKs were inner classes
18:20 sfisque guess i skim read too fast
18:20 Naros aye, I just had a hunch, let me try this and lo-and-behold.
18:21 * Naros sighs
18:21 sfisque aye.  it's always good to "simplify" the problem.  sometimes "getting cute" gets us into trouble
18:21 Naros But like I like "cute" code :/
18:22 sfisque me too, but frameworks tend to barf on it
18:22 Naros I just didn't care for having all these Pk classes in my model package
18:22 Naros so I embedded them thinking that would be OK since most of the examples I saw long ago about Ids were public static classes in the entity.
18:23 sfisque aye, you "can" do it, but it gives JPA some heartburn
18:23 sfisque as you discovered
18:23 Naros I am curious those if your mmgen creates an id
18:23 Naros *curious tho
18:23 Naros if your id was a pub static class
18:24 Naros if it does, perhaps hibernate will fix it.  if it doesn't, they may not and say that's expected behavior :o
18:24 sfisque probably not.  i think it has to do with the proxy'ing.  i know putting static inner classes on EJBs can cause havoc
18:24 Naros ah
18:25 Naros Well, afternoon is shot to hell - haha
18:25 sfisque i would posit that an inner class on any "managed object" is a poor design.  managed objects are supposed to be anonymous and poolable.
18:25 Naros good point, i just wasn't thinking, as i said mainly because most of the past examples I had encountered when learning ORM stuff had them as inner classes
18:27 sfisque for instance, most people do not realize that "this" for an SLSB points to the pool, and not the instnace under the proxy.  even doing something like   method(){  this.otherMethod(); } doesnt guarantee you internal dispatch.  that call "can" go to another instance of the SLSB in the pool if the container so wants
18:27 sfisque that's why putting instance vars in SLSB that are not injected is a recipe for insanity
18:28 nikita joined ##javaee
18:28 nikita hii
18:28 sfisque now imagine you have an inner class and you dispatch to OuterClass.this.method().  and you get a different reference.  HELLO!   now with static inner's it's different because you don't have that linkage, BUT i'm guessing instrumenting them "difficult" because of how they are bundled
18:29 sfisque greets nikita
18:29 nikita is there any book where i can start multi threading from grass
18:30 sfisque javaeebot lucky doug lea concurrency java
18:30 javaeebot sfisque: http://g.oswego.edu/
18:30 sfisque hrm
18:30 sfisque javaeebot lucky java concurrency doug lea
18:30 javaeebot sfisque: http://g.oswego.edu/
18:30 sfisque bah!
18:31 sfisque sometimes reordering gives different ordering of results
18:34 nikita is this a good start for java 1.7
18:36 Naros sfisque: very true :P
18:36 Naros I guess I will "uncute" my code
18:39 Naros I wonder whether they'll be any issues with public enums in classes
18:39 Naros those shouldn't since they're mainly a type like String
18:55 sfisque u can use enums in entities, we do
18:56 Naros yah hibernate by itself had no issue, lokos like mmgen is ok with them too
18:56 sfisque nikita yes.  the only thing those guides might miss is the new concurrency stuff that has folded in lately.  but its better to learn concurrency at the primitive level before diving in.
18:57 Naros i like the jpa criteria api
18:57 sfisque i do too.  i hate embedding runtime strings in code
18:57 Naros Im having a hard time now not just putting the em in my service classes
18:58 Naros only hibernate specific thing i think i might end up using is unwrapping the typedQuery to a hibernate implementation to get scrollable results.
18:59 sfisque you can't inject the EM?
18:59 sfisque worse case, you "can" look it up via JNDI
18:59 Naros no i mean, rather than injecting it into my DAO, I'm thinking of getting rid of the DAO and just inject right into the service tier.
19:00 sfisque aye.  i dislike dao pattern in an EE product.  why abstract and already abstracted layer?
19:00 sfisque unless you're doing something nutty like coalescing different datasources or such
19:00 Naros aye or using vendor-specific stuff
19:01 Naros which you can easily just use a wrapper
19:01 Naros should you need to change the impl
19:01 sfisque aye
19:01 sfisque going afk.  bbl.  code strong!
19:01 Naros see ya
19:02 Naros curious whether anyone else here sees any point to the DAO tier if using straight jpa
19:02 pdurbin hmm, I can't replicate my "Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found" in a minimal maven app: https://github.com/pdurbin/oiosaml_on_glassfish
19:02 semiosis Naros: no dao here
19:22 pdurbin just posted: JavaOne 2013 Sessions - http://www.oracle.com/javaone/sessions/index.html
19:52 Quest joined ##javaee
19:55 SoniEx2 ok?
19:55 Quest ?
19:55 SoniEx2 I'm not really active here...
19:55 Quest I never require any one to either.
19:56 Quest +v s also a priviledge to talk when channel is moderated
19:57 SoniEx2 true...
19:58 SoniEx2 but still...
19:58 Quest Naros,  I left a message but you were not here this morning. Just thought you would like to be interested in knowing. I did some research and found some code. It is possible to send / receive bare bytes via http (a good choice or bad is another story though. ). You might check logs if you want to.
19:58 Naros k
20:04 Quest Naros,  found the log. line 947 http://pastebin.ca/2472645           application/octet-stream consists of "mere bytes"
20:05 Naros correct, that is precisely what struts2 stream result-type does.
20:05 Naros sets the content-type to that and streams the bytes to the browser.
20:06 Naros But that's purely for the download side, not upload to my understanding.
20:09 Quest that said in context to the server?
20:09 Quest upload / download words i mean?
20:09 Quest upload for the server and download for the server
20:13 Naros I'm saying that makes sense to me downloading FROM the server.
20:14 Naros But uploading, that won't work with form submission
20:14 Naros because your requirement was not only send the file, but other information I thought.
20:14 Naros unless you're planning on handling the upload via multiple requests.
20:15 Quest the byte stream strategy can work for both upload to server and download from server. but in both cases, the client being a browser will make things difficult/impossible
20:15 Quest i.e the client in my case was a mobile cell phone customized app to use http
20:16 Naros Aye, on the browser side, you could set some session values, transmit form data and upload the file and marry them together.
20:16 Naros but it would consist of transmitting the form data + file in multiple submissions
20:16 Quest Naros,  if you observer, its getting the file and ints again and again in the same stream
20:17 Naros It shouldn't if you consider AJAX
20:17 Quest strange. the post is deleted? can you see it
20:17 Naros I didn't see anyhting in your pastebin
20:17 Quest hm
20:18 Naros my point is, if you go into gmail and try to send an email with an attachment, the attachment part is handling in ajax (separate request).
20:18 Naros When you submit the email body, it gets uploaded to gmail and they marry the two together and generate a mim email with the attachment
20:18 Naros essentially, you can do the same with your app
20:18 pdurbin mime*
20:18 Naros yah, typos are my specialty :P
20:19 pdurbin :)
20:20 Quest Naros,  see line 61, 64,  108 http://pastie.org/8442323
20:20 SLovenberg joined ##javaee
20:20 Quest Naros,  yes. many other better options are there too. but was talking in that app scenario, where I was forced to implement the history again
20:22 Naros that makes sense in a non-browser yes
20:23 Naros you're using the HTTP protocol as a wrapper around a proprietary stream of data
20:23 Quest yes
20:23 Quest only because cell networks only allow http.
20:24 Naros But as I indicated before, this is really no different than saying I am gonna run a server listening on port 80 and connect and send binary information
20:24 Quest ya
20:24 Naros Except in that case, I throw out all the HTTP jargon
20:24 Quest ya
20:25 Quest but the moral is , I got my ambiguity cleared and added another concept in my diary
20:25 Naros Congrats.
20:25 Quest that I am happy at. and shared it with others.
20:25 Quest Thats whats makes me live.
20:25 Quest thanks :)
20:26 Naros what may get you tho is if you need to somehow manage stateful information :P
20:26 Naros since HTTP by nature is stateless
20:26 Quest I was really pissed of when I saw and was forced to implement their custome byte stream thing
20:27 Naros HTTP is made stateful by using cookies or a unique session id sent on each request :P
20:27 Quest Naros,  yes. they send the params (sequenctional ints ) again and again
20:27 Naros Yep
20:28 Quest Naros,  what i didnt got is how they jump to the next comming int by just doing utils.readInt(in);    as in line 61, 64  and so on.
20:28 Naros If you're sending lots of information in quick succession, HTTP is a poor choice imo.
20:28 Quest http://pastie.org/8442323
20:28 Naros because open a socket connection is considered an expensive operation if the same endpoint is always used.
20:29 Quest is it like that the pointer in the "in" stream goes one step ahead auto when  utils.readInt(in);  is called
20:29 Naros yeah probably just maintained a position in the stream
20:29 Naros and reads from the past point of read
20:30 Quest line 1299 defines it. but i ddidnt got it though
20:30 Naros if you look at InputStream, you'll notice it ahs a mark(int readlimit) method
20:30 Naros http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#mark(int)
20:31 Naros scratch that, I misunderstood that api
20:32 Quest you mean i should ignore the 3 lines above you stated?
20:32 Naros yep
20:32 Quest k
20:32 Naros they have a variable called pos that maintains the read size
20:32 Naros look in readFully() at 1342
20:33 Quest hm
20:33 semiosis websockets
20:33 Quest semiosis,  not stable
20:34 semiosis imho nothing web related is stable (except http)
20:35 SLovenberg joined ##javaee
20:36 Quest hm
20:37 Quest Naros,  quite low level customized protocol they made
20:37 Naros its a typical byte stream, nothing more.
20:37 Naros ones i've made in the past generally have some header that contains an identifier and size and variable payload.
20:38 Naros read header, determine operation & payload size, read payload, perform operation.
20:42 pdurbin crap. my xerces/glassfish/maven problem is back again. everything was working fine for about an hour
20:42 Naros that usually happens right after a clean & rebuild :/
20:44 SLovenberg joined ##javaee
20:44 pdurbin Naros: yeah. exactly
20:45 pdurbin well, at least I got a whole hour of coding in today :/
20:46 Quest Naros,  last question before i wave.      string 'a' can be converted to an int.      now     lets say 'a' = 58      b 59  c 60 .         Now in a stream, when it reads ints, how does it knows that its a,b,c  like ,58,59,60   and not 585,960 ?
20:47 Naros lol i've been rewriting my util helpers to JPA criteria, you can do that fo rme :P
20:47 Naros because both are basically 8 bytes :P
20:48 Quest 8 or 4 ?
20:48 Naros oops, 8 bits
20:48 Naros a char and int are generally interchangable.
20:48 Quest a char is 8bytes
20:49 Quest the line 1300 stats  byte[] intBytes = new byte[4];  though
20:49 Naros sorry, getting confused with C++
20:49 Naros sizeof(char) = 1 in C++ :P
20:50 Naros Anyway, 'A' is 65
20:50 Naros it's the ascii character code, integer representation.
20:51 Naros if you write Characer.toChars(65); it would print out an 'A'
20:51 Quest ya but why  http://pastie.org/8442323#1300       a char is 8bytes. why the line 1300 stats  byte[] intBytes = new byte[4];  though
20:52 Quest 'A' is actually an 8byte char
20:52 Quest why the [] isnt  new byte[8]
20:54 Naros the protocol transmits integers using 4 bytes.  it then uses bit arithmetic to create the int inside byteArrayToInt()
20:54 Naros none of this has anything to do with char :P
20:55 Naros look at like 1441
20:55 Quest "the protocol transmits integers using 4 bytes"  ..
20:55 Naros Do you see line 1444 where they compute the shift value using * 8 :P
20:56 Naros Programming languages often represent a value using X bytes but when they get sent over a protocol, they're often packed into a smaller value to avoid bloating the protocol and sending lots of unnecessary bytes.
20:57 Quest 1441 yes
20:57 Quest 1444 yes yes
20:57 Naros So for example, lets say I wanted to represent in my code an int, but when I send it, I send it as 1 byte because I know it will never exceed 255.
20:57 Naros this way I minimize bandwidth
20:58 Naros This type of stuff is fairly common in custom protocols.
20:58 Quest hm
20:58 Quest I would have to read details to get that. where can i read?
20:59 semiosis can't you just gzip it? ;)
20:59 Quest semiosis,  we already do that
20:59 semiosis heh ok
20:59 Naros It's just something I learned from my last job Quest.
21:00 semiosis also curious whats the benefit of maintaining a custom protocol when there's things like protobuf, thrift, msgpack, 0mq, ..... the list goes on
21:00 Quest you learned via practical experience? but there must be some textual readings too.
21:00 Naros We needed to send as small of packets as possible between the game server & game clients, so we often did a computation to pack data on server side and unpacked it on the client end so that for lower-end internet connections, the game was still fairly playable.
21:00 Quest Naros,  semiosis  I wish there would be webpage gzip too. so we load the pages and surf faster
21:01 semiosis Quest: ???
21:01 Quest semiosis,  using gzip for browsing
21:01 semiosis lots of web servers can and do send gzipped data
21:01 Naros Yep
21:01 Quest but browsers only load html/text
21:01 Naros primarily for the same reason as I started just above, for those low-end bandwidth connections and to also minimize overall bandwidth usage.
21:01 Quest hm
21:01 semiosis the browser & server negotiate (using the Accept header) and can agree to gzip the http payload
21:02 Naros if the server never sees the browser supports gzip, it just sends it plain text/html
21:02 semiosis Accept-Encoding specifically
21:02 Quest semiosis,  hm. so we CAN load an html page via gzip sent from server?
21:02 Naros if your client supports decoding the gzip stream, sure.
21:02 Naros and if the server supports sending gzip :P
21:03 Quest Naros,  firefox, chrome, IE , opera, Konqueror does i gues?
21:03 semiosis most likely
21:03 Naros Most do, but having a fallback to non-gzip is always good practice.
21:03 Quest Naros,  iam pretty hoping and near sure that tomcat and apache httpd does too
21:04 Quest Naros,  semiosis  then i guess its a good practice and should be adopted?
21:04 Quest always adopted?
21:04 Naros Quest: Apache does if you enable mod_deflate iirc.
21:04 Quest hm
21:04 Naros Whether that mod is enabled by default, I'd have to check
21:05 Quest Naros,  so I would just configure the mod and no need to recode the app
21:05 Quest ?
21:05 Naros http://httpd.apache.org/docs/2.2/mod/mod_deflate.html
21:05 Naros "The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network."
21:05 Quest if yes, greate
21:05 Naros Yes, it should
21:06 Naros For tomcat, I suspect you might need to apply in your web.xml some filter to do this
21:06 Quest it will make a lot of CPU usage of server and somewhat of client too but would benifit in consuming less bandwidth . for both client and server
21:07 Naros cpu usage will be overall negligable.
21:07 Quest negligable? well its a full compression of everything.
21:07 Quest extra cpu usage will/ should occur
21:08 Naros naturally, but until you profile it - consider  it negligable :P
21:08 Quest :) ya
21:08 Naros *negligible
21:08 Quest thanks .. pleaseure talking
21:09 Quest you guys are opposite of #java
21:11 Quest left ##javaee
21:15 SLovenberg joined ##javaee
21:53 sess gzipping responses probably only takes a millisecond
21:53 sfisque so, design question regarding nosql db's (hadoop, mongodb, etc.).  if these db's are name/value pools, is there a way to represent hierarchical data without having to "fake it" by hiding FK's (name keys) in the value payload?
21:54 sess the whole point of nosql databases is being able to store lists in single "columns"
21:54 sess i.e perfect for hierarcihical data
21:55 sfisque that does not explain the mechanic though.  how do you represent hierarchy in a flat address space?
21:55 sess flat?
21:56 sfisque name, value pairs are a 2d vector space.   flat
21:56 sess but what if value can be a complex object?
21:56 sfisque that's what i figured, you have to cook the data model
21:56 sfisque you dont get hierarchy for free, you have to bake it into the values
21:57 sess what do you mean "bake"
21:57 sfisque i was wondering if there was some "other" mechanic that these repo's used to handle that
21:58 sfisque bake - as in it's not native.  i can build a hierarchical model in an RDBMS without putting any data into it.  in order for a flat data space to have hierarchy, you have to either bake the data (encode the structure into the data itself) or the product has to provide some "mechanic" to enforce it
21:59 sess as i understand, nosql is schemaless
22:00 sfisque aye.  i was just curious if there was a "typical" feature of the popular repos to "handle hierarchy", or if it's implementor driven
22:00 sfisque your feedback would lead me to believe it is the latter
22:01 sfisque i'm thinking of looking into nosql, but having to bake the data makes it unusable for anything i'm working on.  i don't have that kind of driver in my current data.
22:01 sess ive never used any nosql db, but it's supposed to be much better for hierarchicál structures than normal rdbms
22:02 sess im not quite sure what you mean
22:02 sess you dont have to do anything special with your data
22:03 sess sfisque:  think of it like being able to store a complex json object
22:04 sess with a single command
22:04 sess document.put('somekey', complexobject)
22:04 sfisque denormalized data means every query is a full crawl, no optimizations, no clear way to slice/dice unless i "roll my own" which i have better things to do than reinvent the wheel.  i dont have any data that is purely consumptive
22:04 sfisque sess i understand name, value
22:05 sfisque the issue is, i dont have "Resource" type data.  it's all very crud centric and structured, thus sql is the proper solution.
22:06 sfisque i was thinking if there were "sql-esque" solutions that can be leveraged on nosql, i'd take the dive
22:06 sess perhaps, i never tried nosql so im not suire where it's appropriate
22:06 sfisque if for no better reason, than to try out the tech
22:06 sfisque aye, same, i'm basically "looking for an excuse" but i dont want to end up with a mess :P
22:07 sess it's probably good enough for most if not any normal usages
22:07 sess if the application doesnt have special demands
22:07 sfisque and requires heavy relational querying
22:07 sfisque ***doesnt
22:07 sess it's supposed to be really fast
22:08 sfisque well yah.  as long as it has a good hashing algorithm, it should be
22:08 sfisque a linear sweep is hella potentially faster than building explain plans on the fly, if you have optimized hashing algorithms
22:10 sfisque but i'd also assume doing somethign like get( "%some_substring%" ), whould be attrocious unless you have a custom optimizer to build indexes that you can then fetch and iterate though
22:11 sess frankly i have no idea how conditional querying is done
22:11 sess cant imagine
22:11 sfisque basically have scheduled agents sweep and build indexes and store them at predefined keys
22:11 sfisque that's the only way i can see it having any performance
22:11 sfisque or it might not be a real concept.  what i'm envisioning might be considered an example of "why would you even do that"
22:12 sfisque /shrug
22:12 sfisque i'll have to read up some more then
22:14 sess i dislike the idea of lacking ACID
22:14 sess and going without schema
22:14 sess maybe its just something for really big data
22:21 sfisque yeah..  i found a page discusses the question of "why".  interesting .  it proves useful i'll link it
22:21 sfisque ** if it proves...
22:21 zoot rdf/sparql has ACID
22:22 zoot and also a usecase ;)
22:22 sfisque aye.  the real driver for me is "what aspect of data would promote nosql over sql"  that's what i'm trying to discover
22:23 sfisque i can see the value if you're just storing for direct retrieval, but what about culling and querying
22:23 zoot most other variants of nosql is just another filesystem..
22:30 sfisque so what i'm reading nosql is not a replacement per se of an RDBMS, but allows offloading some aspects that don't quite fit well for an application.  so you would still use a traditional rdbms for data that is highly relational, and use nosql for stuff that is more "amorphous" or has a slimmer data model and requires fast "flat" retrieival
22:31 sfisque so it would become part of a heterogenous data model where you use it for "certain types" of data, but not all of your data needs.
22:31 sfisque that makes sense to me
22:31 sfisque http://highscalability.com/blog/2010/12/6/what-the-heck-are-you-actually-using-nosql-for.html
22:32 pdurbin sfisque: maybe your facebook killer could be built on nosql
22:32 pdurbin built on neo4j
22:33 sfisque i'm thinking nosql would definitely be part of the mix.  basically have "profile info" in sql, and "content" in nosql
22:33 Naros joined ##javaee
22:34 sess sounds reasonable sfisque
22:34 sfisque because being able to "cull" based on profile (who's in my list of "friends" or "subscribers" is relational.  but the list of "feed status bits" would be purely name value paired
22:34 sess kind of like using lucene
22:34 sfisque aye
22:34 sess which is a bitch at points
22:35 sfisque that link was pretty good.  at the end it even lists a bunch of "bad uses for nosql"
22:35 sfisque which helps me understand better
22:36 sfisque a neat concept would be offloading "blobs".  have a table that has "meta data" and then a "key" into nosql for some arbitrary content like "description" or "pdf version" that could badly bloat a schema
22:37 sfisque so the relational parts are in sql, and then the "byte stream stuffs" would be key/value referenced
22:38 sfisque the referrence could even be a rest endpoint because we don't care about joining against it, just retrieval or update
22:38 sfisque it's starting to make sense now
23:27 whartung joined ##javaee
23:32 pdurbin sfisque: you might be interested in this: Using MongoDB in a Java Enterprise Application [BOF7857] https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=7857
23:33 pdurbin given my people in my department, in the office two doors down
23:33 sfisque cool
23:34 acuzio I am still making sense of the difference between K/V stores and nosql
23:38 semiosis javaeebot: lucky spring data mongodb
23:38 javaeebot semiosis: http://projects.spring.io/spring-data-mongodb/
23:40 tjsnell acuzio:  give up, it's above your pay grade
23:42 whartung nosql covers a larger swath of database tech, including K/V stores
23:43 acuzio tjsnell: i agree - i think i need more words added to it like Cloud, Virtual, Horizontal computing
23:43 tjsnell yep
23:44 tjsnell and webscale
23:44 tjsnell but that's a given
23:44 acuzio whartung: K/V stores with a way to access it via JSON, XML, ProtoBuffers, RPC-API's ; what else is it ? Many of them scale across and replicate but so what
23:44 whartung not at NoSQL dbs are KV stores.
23:44 whartung *all
23:47 acuzio yeah some of them are "document" stores
23:48 whartung si
23:48 whartung Couch is more a document store than a K/V store, for example
23:48 acuzio si
23:48 acuzio It used to be called Blobs
23:49 whartung I find couch fascinating, shame its so slow
23:49 whartung there's also the columnar databases
23:52 pdurbin and graph databases (neo4j)
23:53 acuzio graph databases are interesting -
23:53 pdurbin wicket efficient for certain use cases
23:53 pdurbin wicked*
23:54 acuzio but hey in my day - when you wanted to store unorganized stuff in a DB - we used XML or blob
23:56 pdurbin sfisque: heh, you and I were chatting during my note taking for that mongo talk: http://irclog.greptilian.com/javaee/2013-09-24#i_24881
23:56 pdurbin cheeser also gave a mongo talk at java one. I heard it was good. he works for the makers of mongo
23:56 acuzio in tjsnell;s day  - they didnt have DB's
23:56 acuzio yeah
23:57 tjsnell Sybase
23:57 tjsnell it should be on the web as of today
23:57 tjsnell J1 talks went up
23:57 acuzio sybase was big in the finance sector around 2003/2005 - it was speedier than orcl
23:58 acuzio its becoming the cool thing to be at J1 again  pity i was just beginning to sound like an old pro
23:59 sfisque really?  from what i've seen, sybase started to slide in popularity around 2000

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