greptilian logo

IRC log for #javaee, 2013-09-10

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 pdurbin tjsnell: http://irclog.greptilian.com/search.pl?channel=javaee&q=strong :)
01:36 neuro_sys joined ##javaee
01:40 neuro_sys joined ##javaee
01:44 neuro_sys joined ##javaee
01:50 sfisque is all good pdurbin
01:51 Quest joined ##javaee
01:56 neuro_sys joined ##javaee
02:43 [[thufir]] joined ##javaee
05:30 znurgl joined ##javaee
05:53 dangertools joined ##javaee
05:53 dangertools joined ##javaee
06:43 neuro_sys hello, does anyone know how to post a java to xml object to a rest service?
06:44 tangatools joined ##javaee
06:44 tangatools joined ##javaee
06:54 [[thufir]] neuro_sys: ?jaxp?
06:56 neuro_sys [[thufir]]: I figured out thanks, although I'm using xstream
06:57 neuro_sys I was confused about if I should have sent the xml data through headers or the body.
06:57 [[thufir]] ohh, ok :)
06:57 neuro_sys now I seem to have another problem though :P
06:57 neuro_sys The client marshalles the object via Xstream
06:58 neuro_sys but the jax-rs server uses jaxb, and maybe that's why it's failing with a 400 bad request
08:02 pdurbin joined ##javaee
08:35 crimsonfubot joined ##javaee
09:16 tangatools joined ##javaee
09:16 neuro_sys joined ##javaee
09:19 SoniEx2 joined ##javaee
09:19 tjsnell joined ##javaee
09:19 raoul- joined ##javaee
09:37 znurgl joined ##javaee
10:17 acuzio neuro_sys: yes that would be
10:24 neuro_sys acuzio: yes, figured it out as well.
11:49 SoniEx2 joined ##javaee
12:05 znurgl joined ##javaee
13:16 Quest joined ##javaee
13:17 Naros joined ##javaee
13:35 manulite joined ##javaee
13:40 Guest25908 left ##javaee
13:40 Quest joined ##javaee
13:49 kobain joined ##javaee
13:53 znurgl joined ##javaee
14:10 [[thufir]] joined ##javaee
14:18 Quest want to maintain no. or threads called/running  in a method/class. say 10. if one thread dies for some reason. another thread is started to replace it. what is a good strategy? thread pools or any other?
14:23 Naros thread pools are generally the way to keep a set of threads with a min and max cap running to service jobs.
14:25 Naros http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html
14:25 Naros most of your schedule and job frameworks use something that wraps this or similar classes
14:26 Quest ya. are there other ways?
14:26 Naros other ways as in writing your own versus using what java gives you?
14:26 Quest Naros,  well, writting my own would be foolish
14:27 Naros precisely :P
14:27 Quest I meant java provides threadpools only i guess. and executor service (if i recall correct)
14:27 Naros That's probably one of the things I love most about java is that it has tons of constructs already there for you in the stock library unlike things like C++ where you have to use software vendors for these types of things like TBB, boost, etc. :P
14:28 Naros or heaven forbid writing your own /slasheswrist
14:28 Naros Java provides you the executor and thread pool services yes.  You dont need to worry about the underlining implementations necessarily.
14:29 Naros you submit jobs that implement the necessary interfaces and you're on your way
14:30 Naros In my codebase we use the FutureTask<> runnable with an executor.
14:30 Quest hm
14:30 Quest Future is next generation of threads
14:30 Quest Future is next generation of runnable threads
14:30 Naros We submit long running requests to a set of background workers and return the user to a "wait screen" if non-ajaxed or the ajax code polls the server for status on a timer interval
14:31 Naros Future is just a way to get the result of a job in simple terms.
14:36 cheeser joined ##javaee
14:37 cheeser Quest: please stop coming in to ##java and spamming people with shit.
14:37 cheeser left ##javaee
14:37 StanAccy joined ##javaee
14:37 notmoose joined ##javaee
14:37 notmoose left ##javaee
14:37 StanAccy left ##javaee
14:38 * tjsnell eyes dreamreal
14:38 Quest tjsnell,  he is muted
14:38 Quest you wont be able to see his reply..
14:41 tjsnell pity, smartest guy here can't speak
14:41 tjsnell hrmm
14:41 Quest smartness != well mannered
14:42 Quest if he does that in ##java, he will do that same thing here. so +q
14:42 Quest untill he learns manners
14:45 tjsnell wait, so you muted him not because of what he did here but what he did in a different channel!?
14:45 Quest that too
14:45 tjsnell wow
14:46 Quest ##javaee-offtopic for all kinds of non-tech chat though
14:46 tjsnell never
14:46 Quest for next time ^
14:46 tjsnell #java-talk suffices
14:46 Quest then only tech chat here.
14:52 tjsnell was kicked by Quest:  thats for not liking you nick
14:52 tjsnell joined ##javaee
14:53 Naros o.O
14:53 Quest ... :)
14:53 tjsnell none tech to ##javaee-offtopic please
14:54 Quest tjsnell,  you are not the ones giving instructions here. last warning
14:54 tjsnell I'm repeating channel rules. That's verbotten?
14:55 Quest your repeating them to the ops (who set it. and can overide them and dont need to be dictated)
14:55 tjsnell do they not apply to the ops?
14:55 tjsnell sorry
14:55 Quest no problem :)
14:55 pdurbin good lord, can we please talk about java ee?
14:56 tjsnell sush!
14:56 pdurbin whartung: are you around? I wonder if you've seen this: https://svn.softwareborsen.dk/oiosaml.java/sp/trunk/docs/intro.html
14:56 Quest pdurbin,  they keep on pissing / teasing me
15:04 kinabalu joined ##javaee
15:07 acuzio what happens if you want to have a session timeout of a long time on the server ?
15:10 acuzio Quest: who is pissing / teasing you ?
15:10 acuzio What did i miss ?
15:12 acuzio anyone ?
15:12 Quest acuzio,  nevermind. I cooled down
15:13 acuzio you cooled down - !! what does that manea ?
15:13 acuzio mean even
15:16 Quest acuzio,  session timout is a server specific feature. you have to change it in server configs.
15:17 Quest making long sessions is usuall practice for many reasons. e.g long polling
15:18 Quest acuzio,  So, if you want a session timeout to be reflected in the app, you can do so with Javascript concurrently
15:18 Quest JS is an other option too.
15:19 Quest JS keeps sending requests to keep the session alive
15:19 Quest bad practice thought ^
15:20 acuzio Quest: i want to set session timeout to 5 days
15:20 acuzio Is that ok ?
15:20 Quest what ever you want..... but it must be logical to your needs.
15:20 Quest http://stackoverflow.com/questions/15382895/session-timeout-in-web-xml
15:22 Quest acuzio,  some times cookies just get you relogged in. no need for session. it totally depends on the use case
15:23 acuzio cookis relogged in - how does that work ?
15:23 Naros acuzio: do you mean you want the server to maintain session persistent information for 5 days or just that a user is automatically authenticated up to 5 days when they close their browser?
15:24 acuzio the latter
15:24 Quest acuzio,  you save the username / pass in cooker. when any user comes to site. check cookies. auto log him up.
15:24 acuzio in cooker ?
15:24 acuzio what is cooker ?
15:24 Quest cookie
15:24 Quest dont you know what cookie is ?
15:24 Quest acuzio,  answer what Naros  asked .
15:25 Quest what kind of info you want to persist?
15:25 acuzio Quest: i did  -
15:25 sfisque and please do not store the password in the cookie
15:25 Quest oh
15:25 Quest sfisque,  ya thats unsafe..
15:26 acuzio Quest: but you said username/pass in cooker
15:26 sfisque aye.  that's teh quick and dirty way to do it (it works) but it's a huge security hole
15:26 Quest ya. thats a typo. its cookie
15:27 acuzio so you cannot store username/pass in cookie -
15:27 Quest sfisque,  ya but it matters on use case. how important is the password. (or some phrase code is used just to recognise user).  many do it. e.g stackoverflow.com
15:27 sfisque oh i know.  and there are breaches every week, but that doesnt make it right
15:27 Quest sfisque,  cookies are usualy encrypted.
15:27 Quest ya. thats true too.
15:28 acuzio cookies are encrypted
15:28 sfisque if it's 2 way encrypted, it's pretty much crackable.
15:28 acuzio ?
15:28 Quest if its a back account creds. dont do it. if its some chat/ forum creds. sure
15:28 Quest acuzio,  if you want them to. yes
15:28 acuzio but no one has answered my question
15:29 Quest acuzio,  why do you need persistant session?"
15:29 sfisque actually its deeper than that.  if there is any financial/medical/legal access, you cannot store the creds on disc.  you'll be breaking he law.  if it's something "benign" like quest points out, you can do it, but since people reuse passwords, it's a bigger hole thant you guess
15:29 Quest acuzio,  i have. <Quest> acuzio,  session timout is a server specific feature. you have to change it in server configs.
15:29 Quest <Quest> making long sessions is usuall practice for many reasons. e.g long polling
15:30 * Quest agrees
15:30 acuzio Quest: But does it have any effect on server ? - can i just make it persistent forever
15:30 sfisque aye but you don't want to extend sessions beyond an hour or two, especially in HA setting.  otherwise you're going to hold onto all sorts of resources too long (db connections, stateful beans, etc.)
15:30 Quest yes.
15:30 Quest you can
15:30 Quest but.......
15:30 Quest acuzio,  why do you need persistant session?"
15:31 Quest sfisque,  good point
15:31 acuzio I wnat user to come back to where he left Quest
15:32 Quest db conections may be closed()ed up. but true about beans and other statful things
15:32 Quest acuzio,  ah.
15:32 Quest acuzio,  you dont want the user to be prompted about the user name / pass again and again?
15:33 acuzio Quest: thats not what i said
15:33 sfisque you can simulate that by serializing their session bits.  when they come back, they still authenticate, but then u deserialize the session and restore them to their "current point"
15:34 acuzio How do i know when to serialize ?
15:34 Quest acuzio,  then  you just want the browser to rememeber the user who returned?      the site may prompt for password though?
15:34 acuzio Quest: no
15:34 Quest then?
15:34 znurgl joined ##javaee
15:35 topriddy1 joined ##javaee
15:35 acuzio sfisque: how do you know when to serialize and where , additionally how is this related to the session timeout ?
15:37 sfisque you can attach a listener for "session close" (timeout, logout, etc.)  you can then capture the bits you need, serializes them however you want, and then let the container continue decomposing the session
15:37 sfisque time for me to skedaddle.  ttys.  code strong!
15:43 whartung no pdurbin I have not seen that. the web page looks nice
15:47 pdurbin whartung: I'm wondering about OIOSAML vs. OpenAM: http://openam.forgerock.org
15:48 whartung well open AM is a full boat identity product, the page you linked to me was just a SAML SP servlet. Is there more to it?
15:48 pdurbin not sure. my only requirement is SAML
15:50 pdurbin SAML/Shibboleth: https://redmine.hmdc.harvard.edu/issues/2657
15:50 whartung well, the SAML profiles for authentication have two major components: the Identity Provider (IdP) and the Service Provider (SP). The IdP is what basically holds on to the user names and passwords, the SP is what provides the service (a banking application for example). Which part are you doing?
15:54 pdurbin whartung: SP
15:54 pdurbin other folks are setting up IdPs
15:57 whartung ok
15:57 whartung then that first thing you linked to should be what you need.
15:58 pdurbin OIOSAML? yeah
15:58 pdurbin I mean, either one might work
15:59 whartung sure, ideally. OpenAM is the full suite -- IdP and SP, mostly IdP. The other one, based on the page, is just an SP implementation
15:59 pdurbin yeah, that's my understanding as well
16:00 Quest without executor service or thread pool.     how to keep track of 10 threads. check if they all are running and start if one does?
16:00 topriddy joined ##javaee
16:00 whartung I don't know how the OIOSAML is integrated, I never cared for how Shib does it out of the box.
16:01 whartung why would you NOT use an executor Quest
16:01 Quest just to understand threads at an initial level and possibilites
16:02 Naros can you elaborate specifically on what it is you want to understand at such a low level?
16:02 Quest just exploring threads
16:02 Naros a thread is nothing more than a single path of execution.  public static main() is a thread :P
16:02 Quest whartung,  putting them in a list might help. as a raw strategy
16:03 Naros but that's ultimately what an executor is doing amongst a plethora of other bookkeeping stuffs
16:03 Quest put threads in list. execute them. how to check if one is runing then? how to get the reference to each thread?
16:04 Quest hm. how about we discuss "making out own method"
16:04 whartung you have to maintain your own state about the thread
16:05 Naros A good reference: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/concurrent/ThreadPoolExecutor.java?av=f
16:05 Quest ya. how to check each thread state after getting a reference to it?
16:05 Quest Naros,  ya but thats executor
16:06 Naros but that is precisely what you're asking to implement on your own is an executor framework.
16:06 Quest am ya.
16:07 Naros So if you look at addWorker()
16:07 Naros you'll see it creates a new worker, then gets the thread reference for that worker.
16:08 Naros in the concurrent api it uses a thread factory.
16:08 Naros which basically just does new Thread(Runnable r)
16:09 Naros and that's your thread reference.
16:09 Quest Naros,  no worker..
16:09 Quest list.add(thread)      list.get(5);    thread. start();   ...... what? how to see if its alive() ?
16:10 Naros look at the Thread class.
16:10 Naros getState returns an enum of it's state
16:10 Quest ok. its getState instead of isalive. but how.
16:10 Naros Thread t = new Thread(myRunnable);
16:10 Quest ok.
16:10 Quest then
16:11 Naros Thread.State s = t.getState();
16:11 Quest ok
16:11 Quest then add to list?
16:11 Naros a thread can be NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAIT, TERMINATED
16:11 Quest ya. i know
16:11 Naros you'd want to check for terminated, remove it from the list and start a enw one.
16:12 Naros you can also use isAlive too
16:12 Quest wait wait. i know how to do that all with a single thread
16:12 Naros but that just tests whether the runnable has finished.
16:12 Quest I am asking , how to maintain 10 threads
16:12 Naros for(int i = 0; i < 10; ++i) { threadPool.add(new Thread(runnableObject)); } :P
16:12 Naros where thread pool is just a List<Thread>
16:12 Quest there comes the threadpool. which i dont want
16:13 Naros its just a list >.<
16:13 Naros List<Thread> threadPool = new ArrayList<Thread>();
16:13 Quest oh.
16:13 Quest cool
16:13 whartung a thread pool is where you have a list of pre-made threads. When one goes idle, it becomes available for a new task
16:14 Naros but java has it's own ThreadPool class which does more than just hold a reference list of thread objects as whartung points out.
16:14 Naros that is where logic for checking idle vs running vs terminated come into play.
16:15 Naros you set a hard cap and a soft cap for number of threads and allow some logic to maintain the pool's capacity.
16:17 Quest ok
16:17 Quest http://pastebin.ca/2447621
16:17 Naros playing with threads in a sample app is fine to get a general idea.
16:17 Naros but i'd highly recommend you not do this for production code.
16:17 whartung absoutely
16:17 whartung its like writing your own DB pool.
16:17 whartung no reason today
16:18 Naros Precisely and the stock code available to do it has far more bells and whistles that would take you months or years to get right :P
16:18 Quest hm
16:18 Quest realy. if i write my own. it will take months?
16:19 Naros Take a look at the code in the executor framework in the java.util.concurrent package
16:19 Quest ya. its huge
16:19 Naros it isn't just a few lines of code
16:19 whartung the point is that there are edge cases and subtleties discovered over the years
16:19 Quest so using the arraylist and threads is not easy
16:19 whartung it's not the lines of code per se, it's time and experience that they represent
16:20 Quest lots would have to be made. so its , you can say very difficult/
16:20 Quest whartung,  yes. agreed
16:20 Naros it's just going to be more bulletproof than writing your own.
16:20 Naros it's code that's tested N-times over :)
16:20 Quest Naros,  ok can you look at http://pastebin.ca/2447621
16:21 whartung it's just that the JDK stuff has been used by zillions of folks in zillions of projects under really crazy conditions. So it's well understood and ideally has most of the gotcha's coded out of it
16:21 Naros you're creating a pool and starting the threads, makes sense.
16:21 Naros but what happens if the thread doesn't start?
16:21 Quest ok. once i start each. how to see each thread if its running or not?
16:21 Naros but your second loop shouldn't create a new thread
16:22 Naros I'd recode that like this
16:22 Quest or how to see total no. of thread running?
16:23 Naros http://pastebin.ca/2447629
16:23 Naros the pool should only hold running threads.
16:23 Naros threadPool.size() :P
16:23 Quest the thread will be added in the arraylist as in a "running state" ????????
16:24 Naros sure, why not?
16:24 Quest oooooooh.
16:24 Naros it shouldn't be added to the list if it cant start.
16:24 Naros maybe that means you shutdown all other threads and unwind the stack.
16:24 Naros maybe that means you log the error and try again
16:24 Naros entirely up to u
16:25 Quest a minut..
16:25 Quest thanks in advance ^  great
16:26 topriddy1 joined ##javaee
16:26 pdurbin whartung: I've been using http://testshib.org as an IdP but if I want to run one an IdP my laptop, what do you suggest?
16:26 whartung oh I don't know. You can try SimpleSAML, it's a PHP app. Shib is just a beast to configure
16:27 * pdurbin looks at http://simplesamlphp.org/docs/1.5/simplesamlphp-idp
16:27 pdurbin er. http://simplesamlphp.org/docs/stable/simplesamlphp-idp
16:28 pdurbin maybe I'll try to point my SP at https://github.com/dvn/shibpoc at it
16:28 pdurbin whartung: thanks
16:28 whartung yw
16:28 whartung let me know how it goes
16:29 pdurbin whartung: what about the IdP from Shibboleth? Just for a quick test or two?
16:29 Quest Naros,  I was in an image that running thread cant be added in an arraylist. but you proved me wrong. (my inexeperience). so thats why all curiosity occured in me. any way. if 10 threads are started fine and added to list. but one stops after some time.  it will be in the list right? but in a terminated state?
16:29 whartung it's just a pain to configure pdurbin
16:29 whartung it's actually not awful to configure, but the documentation is terrible IMHO
16:29 pdurbin heh. ok. fair enough
16:29 Naros Quest: In theory, that is correct.
16:30 Quest Naros,  so I have to check (iterate list) for eachthread and see its state. if one is dead. i start another one.
16:30 topriddy joined ##javaee
16:30 Naros remove it from the list and start another yes.
16:30 whartung it's super high level and super detailed at the same time. Unless you're expert in the SAML vocabulary, it's a real slog.
16:30 Naros just be sure to remove from the list first :P
16:30 Quest Naros,  cool. thanks!
16:30 pdurbin I've definitely not an expert in SAML
16:30 pdurbin I'm*
16:30 Quest Naros,  what are you working on these days by the way?
16:31 Naros It changes by the day :P.  I'm an SAP basis administrator, MSSQL/Oracle DBA, and the senior java dev here.
16:31 Naros right now I'm working on migrating several releases through the QA process for both SAP and our java webapp product.
16:32 topriddy1 joined ##javaee
16:32 Quest Naros,  sap erp?
16:32 topriddy2 joined ##javaee
16:32 Naros Yep
16:33 Quest what does sap stands for. erp is enterprise resource planning
16:33 Naros SAP stands for SAP :P
16:33 pdurbin heh
16:33 Quest Naros,  we are working on otmm. open text media management. former name DAM. digital asset management.  heard of it?
16:33 Naros Can't say I have.
16:33 Quest similar to sap in some ways
16:34 Naros Asset Management sounds like it might be a distant cousin :)
16:34 Quest Naros,  ever heard of artesia?
16:34 topriddy joined ##javaee
16:35 Quest Naros,  http://www.opentext.com/2/global/products/digital-asset-management/products-opentext-digital-asset-management-for-sap-dam.htm
16:35 topriddy3 joined ##javaee
16:35 Quest its java based
16:36 Naros that product is more on the opposite side of the fence from what I deal with
16:36 Naros We aren't concerned with marketing, sales and media content.
16:36 Naros Our focus is on the manufacturing, MRO space primarily with indirect materials management.
16:36 Quest oh. its mainly for  media
16:36 Quest oh.
16:36 Quest ok.
16:37 Naros so we deal with purchasing, warehouse management, inventory management, that sorta stuff
16:37 Quest what experience in java you have?
16:37 Naros Well I have experience both with Oracle and SAP's SRM and storefront modules written in Java.
16:38 Quest no core java , desktop apps or javaee?
16:38 Naros I dabble for fun with desktop like apps and such but most everything is web-based that I generally touch or webdynpro
16:38 Quest hm. nice.
16:39 Quest lunch time.. brb.!
16:39 Quest dinner*
16:39 Quest thx
16:39 Naros enjoy
16:43 topriddy joined ##javaee
16:44 topriddy1 joined ##javaee
16:47 topriddy1 joined ##javaee
16:49 topriddy joined ##javaee
16:50 topriddy2 joined ##javaee
16:52 topriddy3 joined ##javaee
16:55 topriddy joined ##javaee
18:35 sfisque joined ##javaee
18:37 sfisque joined ##javaee
18:39 sfisque joined ##javaee
19:08 karthikeyan joined ##javaee
19:14 manulite joined ##javaee
19:23 znurgl joined ##javaee
19:50 toshiba joined ##javaee
20:35 sfisque joined ##javaee
20:50 sfisque joined ##javaee
20:50 SoniEx joined ##javaee
21:40 topriddy joined ##javaee
21:41 topriddy1 joined ##javaee
21:45 topriddy joined ##javaee
21:45 topriddy1 joined ##javaee
21:49 topriddy2 joined ##javaee
21:50 topriddy joined ##javaee
21:51 topriddy1 joined ##javaee
21:53 topriddy2 joined ##javaee
21:55 topriddy joined ##javaee
21:56 topriddy1 joined ##javaee
21:58 topriddy2 joined ##javaee
21:59 topriddy3 joined ##javaee
22:01 topriddy joined ##javaee
22:02 topriddy1 joined ##javaee
22:05 topriddy2 joined ##javaee
22:08 topriddy joined ##javaee
22:08 topriddy1 joined ##javaee
22:09 topriddy3 joined ##javaee
22:20 Quest 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.