greptilian logo

IRC log for #javaee, 2013-11-11

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:20 sfisque joined ##javaee
00:20 zoot now i found java:comp/env/hello
00:21 zoot but do i really need to type this? @Resource(lookup="java:comp/env/hello") String hello;
00:21 zoot hmm maybe
00:22 zoot it should look up java:comp/env/bank.Cashier/hello, if injected in java:comp/env/bank.Cashier
00:23 sfisque you're missing the point of jndi lookup
00:23 sfisque jndi allows the deployer to be completely agnostic of how you code your product
00:28 zoot no i'm just having a problem:
00:28 zoot 00:53 < zoot> http://pastebin.com/jYD9UBfe
00:28 zoot 00:53 < zoot> what i'm doing wrong?
00:28 zoot 00:53 < zoot> i droped that env-thingy in my web.xml
00:28 zoot 00:56 < zoot> hm.. i can't find jndiname=java:comp/env/hello
00:28 zoot since glassfish is ignoring my jar-ejb in my war project :S
00:30 zoot INFO: ejb java:comp/env/hello
00:30 zoot it wasn't put under the ejb
00:30 zoot so it should work in my war project too
00:30 zoot :/
00:32 sfisque try just @Resource( name="hello" )
00:32 lv2eof joined ##javaee
00:33 zoot wth
00:33 zoot it works now
00:33 zoot but it is 1:34am too
00:34 lv2eof Hello :)
00:35 zoot hai
00:38 lv2eof joined ##javaee
00:46 AlCoF joined ##javaee
02:47 AlCoF joined ##javaee
02:59 AlCoF___ joined ##javaee
03:13 bitwize joined ##javaee
03:29 sajjadg joined ##javaee
05:38 SLovenberg joined ##javaee
09:27 balo morning
10:02 sajjadg joined ##javaee
10:52 lv2eof joined ##javaee
10:57 WileTheCoyot joined ##javaee
10:57 WileTheCoyot hello everyone
10:59 WileTheCoyot what is the best place to check if the user is logged in? in the jsps or in the servlets?
11:36 sajjadg joined ##javaee
11:47 MegaMatt joined ##javaee
11:53 [twisti] joined ##javaee
11:53 [twisti] left ##javaee
11:53 sess does anyone know if it's possible to automatically set an HTTP header after the web framework of choice has returned its response?
11:53 sess im trying to automatically set cache-control if the response is a file download
11:53 sess but it's too early in a filter before doFilter and it's too late after doFilter
12:02 balo set http header after we got the response? I'm not sure you know how http works.
12:03 balo you can try to override getWebResponse or onEndRequest methods and set header on the response
12:04 balo if you are using wicket example
12:05 javier joined ##javaee
12:16 sess balo:  its not that i have to do it after the response is commited
12:16 sess that is probably not possible
12:16 sess but a way to hook in and change it just before it's commited or something
12:16 sess im using JSF
12:19 WileTheCoyot joined ##javaee
12:19 WileTheCoyot hello guys
12:19 balo according to my little research in the topic, indeed, there isn't a trivial answer to this. did you try to create a new filter?
12:20 balo I used to set headers in apache (I'm using ajp)
12:22 WileTheCoyot is possible to edit web.xml so i can write /mydir/myjsp.jsp istead of /project_name/web/mydir/myjsp.jsp
12:28 sess balo:  i have filters, but before doFilter i dont know if its a file download or not)
12:28 sess and after doFilter its too late
12:29 sess i use primefaces filedownload, so i just return a file instance from an action, then the framework sets some headers and commits response
12:29 sess for now i added some response headers on each action, but that feels a bit risky since you can easily forget to do so
12:29 SLovenberg joined ##javaee
12:35 SLovenberg joined ##javaee
12:48 SLovenberg joined ##javaee
14:14 Quest joined ##javaee
14:18 Naros joined ##javaee
14:31 cem_ joined ##javaee
14:31 cem_ hi
14:32 cem_ i have a js file of 32 kB and after using certain tool the size got reduced to 23kB how that is possible ?
14:35 balo uglifier? or is it just removed the whitespaces?
14:36 cem_ like uglifier
14:41 pdurbin seems possible. seems normal
14:42 SLovenberg joined ##javaee
15:11 sajjadg hey guys.
15:12 kobain joined ##javaee
15:18 sajjadg joined ##javaee
15:20 cem_ wooow
15:25 Naros sajjadg: hello.
15:25 sajjadg Naros, hi bro
15:26 Naros cem_: I've used filters before to do precisely that not only on .js files but the output of jsp files too :P
15:26 Naros Has helped wonders when specific user groups are on very low bandwidth connections.
15:26 Naros and browsers don't support compression.
15:32 sess cem_: usually they rename variables and functions to short names and remove all whitespace
15:32 sess minifying scripts
15:32 sess probably removes unused code aswell
15:37 sajjadg joined ##javaee
16:15 sajjadg I don't have a web.xml file in my application and I want to config tomcat server error page...what should I do? I extended ResourceConfig and did a little change in it. but I don't know about advance configuration without web.xml
16:20 sess add a web.xml :d
16:22 sajjadg :D
16:23 sajjadg yeah
16:23 pdurbin what's wrong with having a web.xml?
16:23 sajjadg but what if I need some startup configuration with code
16:23 sajjadg ?
16:24 sajjadg pdurbin, nothing. but servlet 3.0 introduced a class to remove web.xml I though it will replace it
16:24 pdurbin ah. the trend of getting rid of configuration via XML. ok
16:24 sajjadg I need to run a database configuration code at the startup
16:24 sajjadg pdurbin, yeah. and I like it ;)
16:25 sajjadg pdurbin, it is not a good thing in some situation like this :P
16:25 pdurbin sajjadg: stop trying to be fancy ;)
16:25 sajjadg my reason to extend Application class was to be able to put my java db config code in it
16:26 sajjadg I had hard time with spring xml configuration and that had very bad affect on my relationship with XML :D
16:27 * pdurbin is trying to make peace with XML
16:27 sajjadg I don't have any problem with it in Java EE. but with spring it's hard by XML or annotation
16:28 sajjadg I have problem with Spring :D
16:28 sajjadg not xml
16:28 sajjadg :D
16:30 sross07 joined ##javaee
16:30 sross07 left ##javaee
16:31 sfisque joined ##javaee
16:32 sajjadg eclipse users here
16:32 sajjadg check this out :D
16:32 sajjadg http://editbox.sourceforge.net/
16:32 sajjadg gotta go
16:32 sajjadg take care
16:32 sajjadg God Bless all of you
16:32 sajjadg Goodbye
16:33 cem_ why somewant hilight background ?
16:35 sajjadg cem_, it help you have more control on the code
16:35 sajjadg at least works for me
16:35 SoniEx joined ##javaee
16:35 sajjadg albeit this plugin do it too much
16:36 sajjadg but the first level highliting is ok
16:36 sajjadg sometimes I want to find the start and and of a block of code <div>...</div>
16:37 sajjadg and highlighting help you there...
16:37 sajjadg netbeans 7.3+ had a feature that shows the first line of the block no matter where you are...
16:37 sajjadg it's very cool
16:38 sajjadg you click on the line containing close brace } and it show you the opening one public void func(..) {
16:38 sajjadg very useful
16:38 sajjadg I should consider going back to netbeans maybe :P
16:38 sajjadg eclipse is moving slow
16:39 cem_ some syntax hilighting is far more enough for me ,i dont do that much work
16:48 SLovenberg joined ##javaee
17:19 sfisque i think today i shall hate on jboss7.1
17:21 whartung do tell
17:21 SLovenberg joined ##javaee
17:21 sfisque trying to upgrade from 5.1 to 7.1 (because 6.x are web profile only) and let's just say, porting all my datasources is "counter intuitive" and none of my apps just "drop in".  F jboss7
17:22 sfisque they should have included a tool to run the DS.xml files through an xslt that massages them for inclusion into the new standalone.xml file
17:23 whartung bah
17:23 whartung The GF xml file has largely remained consistent over the years.
17:23 sfisque i'd switch to GF4 but some of my personal products leverage jboss annotations
17:23 whartung especially for staples like connection pools
17:23 sfisque aye.  i disliked GF2, but GF3+ is a real evolution
17:24 sfisque i'm now googling for "migration" guides.  i cant be the only person who is finding 5.x -> 7.x untenable
17:26 whartung I have avoided Jboss all these years because back i the day, I had a traumatic episode trying to set up an Oracle connection pool.
17:26 sfisque on 4.x and 5.x it's "a snap"  very simple boilerplate xml file and drop the jdbc driver into the server/{profile}/lib dir.  done
17:27 sfisque in 7, i have to turn the driver into a module and then configure it as a module.  what?  F U jboss
17:27 whartung heh
17:38 * cem_ never seen sfisque pissed off like that
17:50 SLovenberg joined ##javaee
18:05 SLovenberg-2 joined ##javaee
18:30 MegaMatt joined ##javaee
18:38 acuzio sfisque: ah the world of JBoss modules
18:39 acuzio sfisque: you might find that waterfly or dragonfly or whatever its called is touting its module system as one of the "plus" points - which it is - except when it snot
18:45 whartung mmm...snot
19:13 bitwize joined ##javaee
19:19 acuzio when its not :-)
20:43 AlCoF_ joined ##javaee
21:01 SLovenberg joined ##javaee
21:26 sfisque i think you had it right the first time acuzio
21:26 sfisque :P
21:27 sfisque followed every guide on deploying mysql driver, and i keep ending up with same "dependency" error message in the log.   harrumph
21:28 sfisque i want to move up to ee6 at the very least, since my personal products are running on 5.1, but jb7.1 is proving to be "not worth the headache".  i liked jb4 and 5 because they were simple to configure
21:28 sfisque drop the jar in the lib dir, write a small xml file, done
21:35 sfisque it looks like it's a bug in 7.1x.  i guess i'll have to try WFly8.  sigh
21:36 sfisque oh, nm, the bug is for openshift, a different redhat product
21:51 * sfisque sighs
21:52 sfisque had to upgrade my mysql driver.  did it on a whim.  they really need to call stuff out like that in their docs
21:57 pdurbin when will jboss support java ee 7?
21:57 sfisque i beleive it wont,  they have a new code branch called wildfly (version 8) which i believe is targeted at ee7
21:57 sfisque i'ts in beta right now
21:58 sfisque version 8
21:58 sfisque once i get all my deployments ironed out from moving from 5.1 to 7.1 i'll probably switch to WF8 when it goes GA
21:58 sfisque javaeebot lucky wildfly 8
21:58 javaeebot sfisque: http://www.wildfly.org/about/
22:00 sfisque and then i'll be able to remove more code switching from EE5 to EE7
22:00 sfisque :P
22:00 sfisque i expect, by EE9 a fully functioning EE product will be 3 java files and one xhtml file
22:00 pdurbin right, so they're at beta 1 already. cool. http://www.wildfly.org/download/
22:00 sfisque >.<
22:01 pdurbin and they seem to be making regular releases
22:02 sfisque aye.   now that i fixed my datasource issue, i'm back to drinking the koolaid
22:03 sfisque i'm hoping my EE5 stuff will just drop in to 7.1.1 and i can then start piecemeal porting up  to EE6 and eventually EE7 without having to "fix" things
22:03 jieryn_ joined ##javaee
22:08 whartung "No more jar hell!"
22:08 whartung I don't think that means what they think it means
22:09 sfisque platform question: if i'm "in" a stateless bean, is there a way to capture when the transaction commits/closes.  i know SFSBs have a handler for that, but i'm in a SLSB where i need to capture this
22:09 whartung we already had this discussion sfisque
22:10 whartung now, that said
22:10 whartung I'm pretty sure you can get access to the current transcation
22:10 whartung and connect a listener to it.
22:10 whartung so, you may not know when it STARTED, but you can be notified when it ends
22:12 sfisque aye.  i'm in a case wehre i'm storing something in a ThreadLocal, and i need to clean up when the XAct ends, because threads are pooled and reused in the container.  i'm seeing cases where transactions are getting other transactions threadlocal because the threads are pooled and not spawned ad hoc.
22:12 whartung yea, you should be able to do that -- we've done that before with auditing.
22:12 whartung I don't think we do it any more tho
22:12 whartung lemme look
22:12 sfisque that's exactly what it's for.  basically i need the ThreadLocal for cases where we run @Asynch
22:13 sfisque because the @SessionScoped goes away and we need to store identity stuff
22:13 sfisque the real solution would be to run the Asynch in a SFSB but i don't have the cycles to refactor that
22:14 MegaMatt joined ##javaee
22:15 sfisque i have a a PreUpdate/PrePersist interceptor with a ThreadLocal and i want to null it out when the xact commits
22:17 sfisque i cant do the clean up in the SLSB because xact wont commit until the asynch method quits (unless i convert over to BMT, which again is a refactor we cannot bear atm [no extra QA cycles left for regression testing]
22:17 whartung I don't know why they did this: "Only a stateful session bean with container-managed transaction demarcation can receive session synchronization notifications. Other bean types must not implement the SessionSynchronization interface or use the session synchronization annotations."
22:18 whartung this is clever
22:18 whartung "A stateful session bean class is not required to implement this interface."
22:18 whartung no mixed messages there...
22:20 SoniEx joined ##javaee
22:24 sfisque yah.  if i was in a SFSB i'd be golden
22:24 whartung http://docs.oracle.com/cd/E19159-01/819-3672/beanm/index.html
22:24 whartung You can access the Application Server transaction manager, a javax.transaction.TransactionManager implementation, using the JNDI subcontext java:comp/TransactionManager or java:appserver/TransactionManager.
22:24 sfisque oh, nifty
22:26 whartung http://docs.oracle.com/javaee/5/api/javax/transaction/TransactionManager.html
22:26 whartung getTransaction
22:26 whartung http://docs.oracle.com/javaee/5/api/javax/transaction/Transaction.html
22:26 whartung registerSynchronization
22:26 whartung http://docs.oracle.com/javaee/5/api/javax/transaction/Synchronization.html
22:26 whartung afterCompletion
22:26 whartung there ya go
22:26 sfisque afterCompletion())
22:26 sfisque yah.  damn you and your faster typing
22:26 sfisque :P
22:28 sfisque so now i can see if i can inject it rather than having to do a jndi lookup
22:28 whartung YEa, I bet @Resource will work
22:28 sfisque nice find whartung
22:28 * sfisque gives whartung a hi-5
22:29 sfisque yah, i was hoping i wouldnt have to use @Resource because i still have to use the JNDI name, rather than having it DI'ed by type
22:29 sfisque i shall dig.
22:29 sfisque meeting.  swtiching to phone
22:30 whartung meeting, switching to guns.
22:31 pdurbin stun, I hope
22:33 pdurbin I just re-discovered this podcast and it's both awesome and on-topic. Tons of links in their show notes: http://blogs.jsfcentral.com/JSFNewscast/entry/enterprise_java_newscast_episode_16
22:38 sfisque_p joined ##javaee
22:38 sfisque_p Meeting hell - :-(
22:45 sfisque_p joined ##javaee
22:51 sfisque yay meeting ended early - i must sacrefice a windows cd to the interweb gods
22:52 whartung \o/! A windows CD sacrifice! It IS a good day!
22:52 SoniEx2 sfisque: wait
22:52 SoniEx2 remember to use a 50kamps transformer
22:53 sfisque >.<
22:53 SoniEx2 http://www.youtube.com/watch?v=uXEPy6Za6cI
22:54 whartung That…that's a lot of copper!
22:54 SoniEx2 lol
23:08 sfisque ooh, this might be handy:  @TransactionScoped
23:08 whartung isn't' that a CDI thing?
23:08 sfisque yah
23:41 jieryn 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.