greptilian logo

IRC log for #javaee, 2013-10-07

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
01:15 rtdos joined ##javaee
02:16 mikeit joined ##javaee
03:21 jake__ joined ##javaee
04:43 dangertools joined ##javaee
04:43 dangertools joined ##javaee
05:30 Quest joined ##javaee
06:42 grug joined ##javaee
06:43 grug the experts circle!
06:43 Fubar^ joined ##javaee
07:09 Quest struts 2 question-  Iam watching a prebuild struts 2 application. It has someNamedAction.class(s) . when the browser calls site.com/packageName/some-name.action .     the someNamedAction.class code is called. I dont understand which filter / settings makes it do it. heres the configs. http://pastebin.ca/2463436
07:19 Fubar^ BaseFilterDispatcher i guess
07:19 grug left ##javaee
07:19 Quest hm
07:20 Quest why in a class might private static final long serialVersionUID = 8379660468509074284L;   be used?
07:20 Quest does that have to do anything with Serializable interface?
07:21 Fubar^ yes, it says which version of the class it is
07:22 Fubar^ When you deserialize an object it checks that what you are deserializing has the same serialVersionUID as the class you are trying to deserialize it to
07:22 Quest Fubar^ hm. so its a custom baseFilterDispatcher class. and not a default or customizable behaviour of struts2 itself
07:24 Quest Fubar^ so it is compulsory to have long exactly named as serialVersionUID in a class that implements the serializable interface ?
07:27 Fubar^ it's recommended
07:28 Fubar^ But mostly, you can get away with not having it
07:28 Quest what difference would it make if we dont have it?
07:28 Quest or have it.
07:29 Fubar^ As i explained, it's a check that is made for compatibility when you deserialize an object
07:29 Quest hm.
07:30 Fubar^ So you can't deserialze an old version to a new version of the class
07:30 Quest I should google with keywords of  long serialVersionUID and serializable interface if i want to  read more?
07:30 Quest old version? new version? I need to read more i think.
07:30 Fubar^ javaeebot: lucky serialVersionUID
07:30 javaeebot Fubar^: http://stackoverflow.com/questions/285793/what-is-a-serialversionuid-and-why-should-i-use-it
07:31 Quest whos bot is it? :)
07:31 Fubar^ I don't know
07:31 Quest hm. ok
07:33 Quest Fubar^ hm so the long number would be some random number typed by the class creater itself.
07:33 Quest Fubar^ thanks.
07:33 Quest last question. I am watching a premade project. it uses log4j but I cant find any config/xml/properties file for it. where it can be?
07:38 Quest brb
07:57 Fubar^ find -iname "*log4j*"
08:03 Quest on windows with myeclpse
08:17 mikeit joined ##javaee
08:41 Quest joined ##javaee
09:31 mikeit left ##javaee
10:00 grug joined ##javaee
10:12 pdurbin Quest: javaeebot is my bot. as is philbot (the log bot)
10:18 Faux joined ##javaee
10:44 Quest hm
10:44 Quest pdurbin nice
10:44 Quest Faux using ip6?
10:50 Faux Yes, thanks.
11:07 MegaMatt joined ##javaee
13:26 pdurbin whoops, didn't know about this planned outage: http://repository.jboss.org
13:26 * pdurbin picked a fine time to try switching from ant to maven
13:35 acuzio pdurbin: mvn is broken by design - just a little less than Ant - but broken and borked none the less
13:35 Fubar^ pdurbin: You should host your own repository
13:35 pdurbin sounds like it's progress, at least :)
13:36 pdurbin Fubar^: for some jars we are using <url>file://${project.basedir}/local_lib</url> -- https://github.com/IQSS/dvn/blob/maven/DVN-root/pom.xml
13:36 acuzio pdurbin: listen to Fubar^ , host your own repository for Production apps - but that doesnt make anything any bette -  all it does is move the pain point somewhere else .,  i am thinking of moving to Gradle seriously
13:38 Fubar^ pdurbin: using system scope is usually not a good idea for dependencies, they are not transitive
13:39 * pdurbin looks at http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Transitive_Dependencies
13:40 acuzio in a lot of places they actually remove transitive dependencies
13:40 Fubar^ maybe what you where descibing was not system scope but a local url for a repository
13:40 pdurbin Fubar^: I meant we threw all of the jars we couldn't find on maven central here: https://github.com/IQSS/dvn/tree/maven/DVN-root/DVN-web/local_lib
13:41 Fubar^ alright
13:41 Fubar^ use artifactory or nexus instead
13:41 pdurbin I've heard of nexus
13:42 pdurbin javaeebot: lucky artifactory java
13:42 javaeebot pdurbin: http://www.jfrog.com/home/v_artifactory_opensource_overview
13:45 pdurbin Fubar^: you like artifactory better than nexus?
13:45 Naros joined ##javaee
13:50 Fubar^ I have never used it :)
13:51 pdurbin oh. :)
13:51 pdurbin seems like the jboss repo is back up \o/
13:53 * pdurbin saves the "let's host our own repo" email as draft :)
13:55 acuzio pdurbin: on a serious note - at some point you will have to send that over
13:57 pdurbin yeah. probably. at least this thing builds
14:08 Naros left ##javaee
14:20 kobain joined ##javaee
14:27 sfisque acuzio what's broken about ant.  that's like saying make is broken.  ant is just a shell to build projects.
14:27 * sfisque openly admits he prefers ant over maven
14:28 tjsnell yikes
14:28 tjsnell ant sucks for any sufficiently large project
14:28 tjsnell even with ivy added in
14:29 tjsnell without ivy it's nightmare
14:30 sfisque it doesnt suck for large projects (and in fact, i find having that level of subtle control better), BUT i will admit it takes more heavy lifting to get "up and running"
14:30 sess id take maven over ant any day, for any project
14:31 sess ant projects have a tendency to become really nasty since you get so much freedom
14:31 sess ive seen several examples where the whole project is built like 3 times
14:32 sess in the standard build target
14:32 sfisque well, yes.  you need some "discipline" from the staff
14:33 tjsnell haha
14:33 sess only thing i dislike with maven is the effort in adding libraries not available on online repositories
14:33 tjsnell I'll turn down a gig that uses ant
14:33 sfisque the thing i do not like is maven can promote too much "hands off" which can lead to "surprises" in the build (like version rolls in dependencies if you don't lock them down to specific versions, which then begs teh question of why you're using maven in the first place)
14:33 tjsnell oh maven has massive warts but they are much more manageable
14:34 tjsnell gradle tooling is finally getting close to good
14:35 sfisque well, be well, time for me to pack up and mosey into the office.   code strong!
14:35 tjsnell travel safely
14:51 pdurbin shoot, if you compare our maven branch to our develop (ant) branch... the github web interface no longer shows history per file in the maven branch:
14:51 pdurbin https://github.com/IQSS/dvn/commits/develop/src/DVN-web/src/Bundle.properties
14:51 pdurbin https://github.com/IQSS/dvn/commits/maven/DVN-root/DVN-web/src/main/java/Bundle.properties
15:33 Quest joined ##javaee
15:38 sfisque joined ##javaee
15:45 pdurbin other folks seem to have this trouble too: http://stackoverflow.com/questions/19101554/git-renaming-file-history-is-available-on-cmd-line-but-not-in-github-interface
15:58 jieryn joined ##javaee
16:48 acuzio sfisque: managing ant projects is harder than managing mvn projects - both suck but in different ways
16:52 sess maven makes it hard to do stupid stuff
16:52 sfisque i guess it depends on taste there.  i find maven very "unintuitive" for stuff that is exposed in a very obvious way in ant.  but then ant builds tend to be more verbose than maven, but i dislike magic and surprises in my builds.  i like to know what is happening and why at every step.
16:53 sess a bit of weakness, but its in general a big strength
16:53 sfisque imo, builds systems are ALL about predictable results and predictable reproducibility
16:54 sess are you claiming maven is not predictable?
16:54 sfisque see my earlier comment about "hiding"
16:55 sfisque if versions of deps are not "locked" you can get surprises when maven updates to a new version
16:55 sfisque that's not predictable
16:55 sess locked?
16:55 sess why would you not specify a version
16:55 sess maven even warns you if you dont
16:55 sfisque it's not "why", it's "you can"
16:56 sfisque like i said, i dislike magic in my builds
16:56 acuzio sfisque: i am with you on that
16:56 sess skipping configuration isnt magic
16:56 SoniEx2 IMO maven sucks
16:56 sess i bet you can cause mayhem with ant too if you configure it wrong
16:56 acuzio sess: For some values of configuration it is
16:57 SoniEx2 and ant sucks too
16:57 SoniEx2 :P
16:57 acuzio sess: Yes you can - but its obvious ., thats a huge difference
16:57 sess maven warns you at each build
16:57 sess how much more obvious can it get without failing the build completly
16:57 acuzio but the reality is its 2013 and its one of the most used languages in the planet and we have 2 build tools both of which suck
16:58 acuzio sess: 2 words - transitive dependencies
16:58 sess how does maven even pick a version
16:58 sess if its not specified
16:58 sess the latest?
16:58 sfisque three.  you "can" use make (or one of it's incarnations) but it's not as powerful as ant/maven
16:58 sfisque yes sess
16:58 sfisque it' grabs latest
16:59 acuzio anyway - all of this is moot - both suck ,. i am seriously thinking of moving to gradle in my next project
16:59 acuzio and then loathing another build tool
16:59 sfisque rofl
17:00 SoniEx2 hey you noobs
17:00 SoniEx2 use Lua and sockets
17:00 sess bat scripts is the latest
17:00 SoniEx2 well, HTTP and FTP and stuff... but still...
17:00 sfisque you "could" roll your own DSL build lang :P  [warms up the javacc religious presentation]
17:00 acuzio nonsense - ed
17:00 acuzio ed, sed, awk and thats it
17:00 sfisque pheh ed, just use piped echo's run through sed/awk/grep :P
17:01 acuzio in my days we used to enter code in hex starting from the O.S of course
17:01 sfisque call −151
17:28 tommmied joined ##javaee
17:30 Quest but javaee dont use some prebuild framework thingy like real frameworks. right?
17:30 Quest like no dispatching of request or getting params.  that is pretty well done in struts 2 or spring
17:31 Quest and the dependancy inject thing
17:42 whartung Servlets don't provide that, but JAX-RS does, and JSF has it's own thing
17:43 Quest jax rs. the rest thing?
17:43 tjsnell what other jax rs is there?
17:43 whartung yes
17:43 Quest I hate jsf. its component based and fails on heavy load. thats what most says.
17:44 tjsnell most?
17:44 Quest REST i meant
17:44 tjsnell where's that data?
17:44 Quest tjsnell,  blogs, etc
17:44 tjsnell what!? REST fails under heavy load?
17:44 tjsnell someone tell twitter they're fucked
17:44 Quest no
17:44 Quest jsf
17:44 tjsnell jsf is just ugly all around
17:44 Quest jsf fails under heavy load. as its not req/resp based
17:45 Quest tjsnell,  so you do agree
17:45 tjsnell no
17:45 Quest and its not ugly though
17:45 tjsnell I have no opinion on JSFs ability to handle load
17:45 tjsnell mainly because I don't care
17:45 tjsnell I'll never use JSF
17:45 Quest why wont  you
17:46 tjsnell because it's a bloated overly verbose spec and there are much better tools
17:46 Quest overly verbose spec?
17:56 Naros joined ##javaee
18:00 Quest I thnk there was a flag problem.
18:01 Naros no worries.
18:11 * tjsnell flags sfisque
18:16 * sfisque tosses the ball in the air
18:16 * whartung blows his whistle
18:20 * pdurbin tackles javaeebot
18:27 * Quest pokes grug
18:28 * Naros rolls his eyes.
18:39 sfisque god i love working with people who assume they know the platform.  we have a refactory jira ticket, "Refactor EJB injections to use CDI injection where applicable"
18:40 sfisque he wants to replace EJBs with CDI beans.  because, you know, they're the same thing…..  >.<
18:43 sess the beans are the same, but isnt the injection method slightly different?
18:43 sess i only know that @EJB allows for circular dependancy while @Inject does not
18:44 sess Quest:  jsf allows for very rapid development when you learn it
18:44 sess though i agree it has its problems
18:46 Quest sess,  so does php. but yes, it has problems. but what kind of you think about?
18:46 Quest sess,  rapid development = so does php. but yes, it has problems. but what kind of you think about?
18:47 tjsnell grug is back!
18:47 tjsnell php problems are legion
18:57 sess Quest:  php and jsf arent comparable
18:57 sess they fill completly different purposes
18:57 sess jsf allows for very fast ajax development, and against a stateful backend
18:58 sess it doesnt mix in business logic in view like php does
18:58 Quest sess,  was comparing the comment "rapid development" != good development == php == jsf == my view
18:58 sess php isnt that rapid
18:58 SoniEx2 so here's why Java sucks:
18:58 SoniEx2 [15:55:05] <@SoniEx0b10> !lua _G.print = getfenv().print _G.s = "s = \"print(\\\"\\\")\" .. s local f,e = loadstring(s) setfenv(f,_G) local f2,e = loadstring(s) setfenv(f2,_G) xpcall(f,f2)" local f,e = loadstring(s) setfenv(f,_G) local f2,e = loadstring(s) setfenv(f2,_G) xpcall(f,f2)
18:58 SoniEx2 [15:55:07] Shocky4 [~Shocky@bots.axxim.net] has quit IRC: Excess Flood
18:58 Quest sess,  hm
18:59 sess anyuways i agree that rapid doesnt mean its good in itself
18:59 SoniEx2 well, LuaJ + PircBotX
18:59 sess but its one of its strong parts
18:59 sess redeems it a bit at least
18:59 Quest sess,  why you dont like jsf
18:59 sess it's very complicated
19:00 sess and heavy
19:00 sess some bugs you get are extremly hard to troubleshoot
19:03 Quest hm
19:03 Quest complicated as well as rapid?
19:04 Quest sess,  i just like the idea of component based. its like wasting resourses
19:04 Quest thought I dont know much about jsf
19:04 Quest but thats a first impression
19:05 Quest on ever request / response. full component is transfered to and fro
19:07 sess resources are in general less worth than developing hours
19:08 Quest ya
19:08 sess rapid as in very little code to get a lot of functionality
19:09 Quest hm.. any comments about its architecture.?   like web is a req/resp model. jsf is not
19:09 sess complicated as you have no idea whats going on behind the scenes
19:09 sess its stateful
19:09 Quest ya. thats what I was saying. we have no idea whats going in backend
19:10 sess well you do if you learn it
19:10 Quest hm
19:11 Quest sess,  whats more in market and in serious development?     spriing, struts, java ee, hibernate, plain jdbc pooling, jsf ?
19:15 Quest I mean in your views if  i didnt asked too much
19:15 sess Quest:  from my experience, spring is popular in new applications
19:15 sess and struts in older
19:15 sess and a lot of hibernate
19:15 sess i prefer struts or javaee on top of hibernate
19:15 sess depending on the type of app
19:16 Quest hm
19:16 Quest struts 2 offcourse?
19:16 sess only seen struts 1
19:16 Quest ho ho. leave struts 1. shift to 2
19:16 sess but ive only worked for a few years
19:16 sess so dunno
19:16 sfisque sess : (from oracle's docs) : On the other hand, CDI doesn't provide any transactional, monitoring, or concurrency aspect out of the box. For transactions, JMX could be easily implemented with interceptors or decorators, but Java EE 6 does not provide them out of the box. CDI beans are not "active," as EJB 3 beans are. Managed CDI beans are usually executed in the context of JSF, Java API for RESTful Web Services (JAX-RS), or EJB 3.
19:17 sess sfisque:  i didnt really argue against that
19:17 sfisque i know, but i felt there was a lack of understanding the subtle differences
19:17 sess Quest:  id rather switch to spring mvc
19:18 Quest spring is hard to configure the first time
19:18 sfisque both are/can be managed and have some concept of "session" but their session contexts are VERY different and the Xact facilities provided by one is not provided by the other
19:18 tjsnell struts 1 for companies that don't innovate or like change so running java 1.4 and 1.5, most when they do migrate don't migrate to struts2
19:18 sess Quest:  not very
19:18 sess spring is very easy
19:18 Quest i felt though
19:19 Quest it took me one month to learn and setup basic spring with spring security
19:19 Quest annotation based mvc
19:21 sess then you probably had no web experience
19:21 sess from earlier?
19:21 sess simple spring mvc setup should be doable in a day
19:21 sess from examples
19:24 Quest I did servlet based apps in past
19:25 Quest from examples. it can be in hours even. but not to understand fully.
19:25 sess spring mvc = copypaste base xml config, then just annotate mvc controllers with @requestmapping
19:25 sess well you dont have to understand it really
19:25 sess to code decently with it
19:26 sess the annotations are very straight forward
19:29 Quest how can an Employee object be sent by ajax to html page as the browser only understands html/xml/json...  ?    http://www.technicalkeeda.com/jquery/spring-framework-jquery-ajax-request-and-json-response-example
19:29 Quest sess,  yes. thats what I will do now :)
19:30 sfisque you have both answers right in the question.   xml or json.  take your pick
19:31 Quest sfisque,  but the said example is returning an object return employee;
19:31 mikeit joined ##javaee
19:31 Quest and getting that JAVA object by data:'firstName=' + $("#firstName").val() + "&lastName=" + $("#lastName").val() + "&email=" + $("#email").val(), - See more at: http://www.technicalkeeda.com/jquery/spring-framework-jquery-ajax-request-and-json-response-example#sthash.YwUusOxg.dpuf
19:31 sess Quest:  notice @ResponseBody
19:32 sess spring automatically converts it
19:32 sess to JSON
19:32 Quest aaaaah
19:32 Quest really?
19:32 sfisque aye.  the framework either uses a default converter or you register a custom one
19:32 sess yes
19:32 sess very convenient
19:32 mikeit joined ##javaee
19:32 Quest lol. i thought @ResponseBody converts it to simple string
19:33 sfisque for example, jersey default handles most java "standard types", and can infer complex ones that are based on standard ones,  but you can register custom ones as needed
19:33 Quest hm
19:33 sess Quest:  json is a simple string
19:33 Quest what if i need xml?
19:33 sfisque aye
19:33 sess @responsebody means it will ´put the data in the response
19:33 sess as it is
19:33 sfisque then use @WebService
19:33 sfisque that will return soap packets
19:33 Quest sess,  what if the object had images
19:34 sess you mean a byte array?
19:34 sfisque customer converter to base64 or other encoding for the image
19:34 sess something like that
19:34 sess sounds reasonable
19:34 Quest sess,  dont i need serializaqtion?
19:34 sess the object will most likely have to be serializable yes
19:34 Quest sess,  yes might be byte[] then
19:34 sess thought im not sure why you would want to put a byte[] in json
19:34 Quest hm
19:35 Quest do i need to implement Employee class with serializable interface?
19:35 sfisque if he had a client side lib that could reconstitute an image or sound bite from the stream?
19:35 Quest sfisque,  hm. that was just an example
19:35 sfisque aye, my comment was an example too
19:35 sfisque :-)
19:35 Quest :) nice comment
19:36 Quest but never saw a use case of that
19:36 sfisque as for serializable, i'd guess it depends on the runtime Impl.  if they're wiring into the java.io.xxx stuff that uses Serializable, then yes.
19:36 sfisque otherwise, no
19:37 sess sfisque:  well images and such are most often fetched in a secondary request
19:37 Quest iam just populating the html by those objects
19:37 sess when using web clients at least
19:37 sess Quest:  are you just populating a web page with ajax data?
19:37 sess images should be fetched in its own request then
19:37 Quest yes
19:38 Quest sess,  why @ResponseBody makes json data as default.? why not xml or any other?
19:38 sess not sure how it works, never had to return xml
19:39 Quest k
19:39 sess you can probably configure it
19:39 Quest k
19:39 MegaMatt REST
19:40 sfisque i'm guessing it's the "default" for your impl
19:40 sfisque but REST is not tied to any encoding.  you can return BER from a rest endpoint
19:40 Quest hm
19:40 sess Quest:  from examples, i think it depends on the object returned
19:41 sess http://www.mkyong.com/spring-mvc/spring-3-mvc-and-xml-example/
19:41 sess here they have class Coffee annotated with @XmlRootElement
19:41 sess and return it with @ResponseBody
19:41 sess with jaxb on the classpath
19:41 sess that seems to be enough to return xml instead
19:41 sess very nifty
19:42 Quest hm
19:42 sess so @XmlRootElement -> XML, simple pojo -> json
19:42 Quest k
19:42 Quest let me try and be back
19:42 Quest thanks ! :)
19:43 sess not sure if it's the "proper" way if you're making a real web service
19:46 sess though i cannot say why it wouldn't be
20:35 Quest am.. people... I think I cant do ajax on my localhost. can I?
20:37 sess of course you can
20:37 sess there is nothing magic with ajax
20:37 sess its just normal requests
20:38 Quest i thought ajax was for same domain. well my domain is local host . so no issues
20:38 Quest but iam getting 406
20:38 Quest Not Acceptable
20:38 sess :s
20:38 sess never saw before
20:39 sess probably some configuration issue
20:39 sess in spring
20:39 sess http://stackoverflow.com/questions/4069903/spring-mvc-not-returning-json-content-error-406
20:39 sess perhaps this?=
20:43 sfisque looks like you need a config : <mvc:annotation-driven />  and a JSON mapper
20:45 sess or jaxb if its xml
20:45 sess wouldnt lack of annotation-driven just produce a 404?
20:45 sess since the bean wouldnt even be registred
20:45 sess lack of mapper i can imagine would produce an error like this perhaps
20:46 sfisque right
21:07 tommmied Quest, you talking about CORS ?
21:30 Fubar^_ joined ##javaee
21:30 grug_ joined ##javaee
23:17 jieryn joined ##javaee
23:17 jieryn joined ##javaee
23:53 mikeit joined ##javaee

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