greptilian logo

IRC log for #javaee, 2013-07-31

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 sfisque if B truly inherited getX() you'd get a different answer
00:00 sfisque but it doesnt, the method is called virtually and you get the unexpected answer
00:01 sfisque i was a little astonished until i looked at the assembled byte codes
00:01 whartung yea that's odd
00:03 whartung that makes sense though
00:03 whartung since variables are not dispatched
00:03 whartung but coded directly
00:03 whartung so it doesn't "look up" x in the current scope
00:04 whartung it's fate was sealed with A.getX() was compiled.
00:04 whartung but I agree it's not necessarily an intuitive outcome
00:06 sfisque aye.  astonishing to say the least when you see it for the first time :P
00:07 whartung yea
00:07 sfisque and i'm glad you feel similarly.  at least im not totally insane yet
00:07 sfisque :-D
00:08 whartung :)
00:08 sfisque as i commonly quip, "great minds think alike... OR insanity is contagious..."
00:08 whartung or the beer IS that good...
00:08 sfisque ROFL
00:09 SoniEx2 I need a quick and simple way to learn Swing
00:09 sfisque sun used to have a "swing set" tutorial with code.  maybe oracle still has it up on their site?
00:10 SoniEx2 something that isn't oracle tutorials
00:10 whartung yea that still exists
00:10 whartung the problem with swing is the simple way doesn't scale well, and then you have to learn it the hard way
00:10 SoniEx2 I want something like codecademy but for swing
00:11 whartung what do you want to do in swing?
00:11 sfisque aye.  i wish ibm had pushed xbeans harder.  it was wild when i came out.  basically it was FLEX about 8 years before flex was invented (UI was boilerplated in XML and all you did was decorate the eventing and models in java)
00:11 SoniEx2 a tracker
00:12 SoniEx2 something like this: http://en.wikipedia.org/wiki/OpenMPT
00:12 whartung heh
00:12 whartung that's not simple
00:12 whartung :)
00:12 whartung that would best be done learning either the NetBeans platform or Eclipse platform
00:13 whartung this will not be a quick or painless experience for you
00:13 SoniEx2 I already have my custom file format done... sort of... https://github.com/SoniEx2/NBX-API
00:14 SoniEx2 I want a GUI like this: http://www.stuffbydavid.com/mcnbs
00:19 sfisque so on a good note, i managed to get the PostConstruct nightmare down to two calls but that's expected because there are two references on the page (2 different beans, where one inherits from the other).  not great but better.  now i need a way to cache the data load so that it can be shared by both instances so i don't need to descend twice (god i want to strangle my cow-orkers)
00:20 whartung that's a different problem but cool
00:20 whartung I think :)
00:20 sfisque aye.  "better" ... in quotes :P
00:21 sfisque each descent was resulting in an expensive query (5-20 sec each time) which is ok once, but when you do it 6 times with the exact same bind variables, makes my eyeballs twitch
00:22 sfisque if you ever watch Venture Bro's, picture Brock a moment before he kills about 10-20 minions
00:22 whartung heh , no I can't say I;m familiar with them
00:23 sfisque oh man.  do yourself a favor.  if you grew up watching Johnny Quest, you will almost suffocate from laughter
00:23 whartung haha
00:23 whartung I remember I liked johnny quest
00:23 whartung I remember seeing an episode on the web and wondering "why" :)
00:23 cavemanlg joined ##javaee
00:24 sfisque heh
00:25 whartung I guedss it just did't age well
00:25 whartung Thunderbirds aged pretty good though!
00:25 sfisque aye
00:25 whartung ah -- adult swim - -I should have guess
00:26 sfisque :-D
00:27 sfisque VB is by far the best thing AS carries (carried?)
00:27 sfisque pure art
00:28 whartung the animation is excellent
00:28 whartung only thing I ever watched on AS was cowboy bebop
00:28 sfisque the story writing is prime too
00:28 sfisque ay CB rox
00:29 whartung <3 CB
00:32 whartung out the door, tomorrow is another day!
00:32 sfisque kk be well
00:34 caverdude joined ##javaee
01:02 sfisque hitting the road.  be well all.  code strong!
01:12 caverdude hi
01:20 cavemanlg joined ##javaee
01:21 caverman joined ##javaee
01:27 Quest joined ##javaee
01:27 caverdude joined ##javaee
01:33 cavemanlg joined ##javaee
01:58 caverdude joined ##javaee
02:05 sfisque joined ##javaee
02:06 sfisque1 joined ##javaee
02:10 cavemanlg joined ##javaee
02:17 caverdude joined ##javaee
03:28 caverdude sup
03:46 Quest hey
03:46 Quest caverdude,  ever worked with spring security?
03:47 caverdude no, sorry
03:47 caverdude never with spring at all
03:48 sfisque1 i hear there's a betty ford program for that
03:50 Quest sfisque,  used spring sec?
03:50 sfisque not actively, but i worked on a project that used it
03:51 Quest ok
03:51 sfisque it was "someone elses problem" :-)
03:52 Quest getting 404 not found error for /j_spring_security_check  and   in logs   WARNING: No mapping found for HTTP request with URI [/ttmaven/j_spring_security_check] in DispatcherServlet with name 'springDispatcher'  my spring-security.xmll http://pastebin.com/btPB3U1k
03:55 sfisque what url are you typing to get the 404?
03:56 Quest it shows when i pres login button on /login page
03:57 Quest the form action is  <form action="${pageContext.request.cont​extPath}/j_spring_security_check"
03:57 sfisque if it works like CMA, you don't reference the login page directly,  you just request some "protected page" and the service intercepts the call as "protected" and interposes the "login page"
03:57 sfisque it's not like auth in the CGI world
03:58 sfisque but that's assuming spring follows the Container Managed Auth model
03:58 Quest let me try some other page. one sec
03:59 sfisque i should probably use "mechanic" in place of model there, since model has a very specific meaning in the EE world
03:59 Quest welll, but going directly to login page should also do
03:59 sfisque that's not how the servlet spec works
03:59 sfisque the servlet spec works on the premise that you only need to login if a protected resource is requested
04:00 sfisque what you can do is "fake it" by having the "login" button go to some dummy protected page
04:01 Quest redeploying
04:14 Quest sfisque,  <filter>
04:14 Quest <filter-name>springSecurit​yFilterChain</filter-name>
04:14 Quest <filter-class>org.springframework.web.fil​ter.DelegatingFilterProxy</filter-class>
04:14 Quest </filter>
04:14 Quest
04:14 Quest <filter-mapping>
04:14 Quest <filter-name>springSecurit​yFilterChain</filter-name>
04:14 Quest <url-pattern>/*</url-pattern>
04:14 Quest </filter-mapping>
04:14 Quest oops
04:14 Quest sory
04:14 Quest sfisque,  org.springframework.beans.factory.x​ml.XmlBeanDefinitionStoreException: Line 13 in XML document from ServletContext resource [/WEB-INF/spring-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 13; columnNumber: 64; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'security:intercept-url'
04:14 Quest 13 is  <security:intercept-url pattern="/login" access="permitAll"/>
04:27 sfisque looks like a malformed xml file
04:27 Quest <security:intercept-url pattern="/login" access="permitAll"/>  what can be wrong in it
04:28 sfisque dunno.  does it adhere to the dtd and schema?
04:28 Quest dtd?
04:29 sfisque from the exception it looks like security:intercept-url is not a valid tag
04:30 sfisque assuming security is a valid bound namespace in the preamble?
04:31 Quest hm
04:31 sfisque is there somthing that looks like xmlns:security="blah blah blah" in the preamble?
04:33 Quest looks ok
04:39 Quest sfisque,  solved.
04:41 sfisque cool
05:12 grug joined ##javaee
05:38 Quest can any one look at it. using spring security with spring. says monitor servlet should be first one in chain and no mapping found for any of my pages. http://pastebin.com/eGymLp2F
05:41 Quest I disabled http monitor in tomcat 7.0.32 . monitor thing goes away now but still getting ul 31, 2013 10:42:35 AM org.springframework.web.servlet.DispatcherServlet noHandlerFound WARNING: No mapping found for HTTP request with URI [/ttmaven/] in DispatcherServlet with name 'springDispatcher'
05:58 Quest nevermind ^
05:59 Quest http://pastebin.com/xaPba5Za everything was working fine with spring core until I added spring security. observe line 8 and 23 (they both contradict with each other) )with error of No mapping found and org.springframework.web.servlet.DispatcherServlet noHandlerFound
06:28 Quest solved, i had dispatcher mapping as <url-pattern>/*</url-pattern>      it should have been like this     <url-pattern>/</url-pattern>
06:45 Quest http://stackoverflow.com/questions/1266303/no-mapping-found-for-http-request-with-uri-web-inf-pages-apiform-jsp
07:10 mrrng joined ##javaee
07:13 xll11 What should I put on my CV
07:13 xll11 ?
07:16 xll11 Should I include my github in my resumse? even if I only have one project there?
08:36 neuro_sys I think github is appropriate and useful in CVs.
10:01 pdurbin automatic github resume: http://resume.github.io/?pdurbin :)
11:20 SoniEx2|2 joined ##javaee
13:38 Naros joined ##javaee
13:42 mbc joined ##javaee
14:20 SoniEx2|2 joined ##javaee
14:29 kobain joined ##javaee
15:34 caverdude joined ##javaee
16:23 caverdude joined ##javaee
16:29 Quest joined ##javaee
17:27 tystr left ##javaee
18:43 Quest joined ##javaee
20:11 Quest Naros,  free?
20:12 Naros Whats up ?
20:14 Quest hi.
20:14 Quest a minut
20:16 Quest only System.out.println("debug ---- 2");   runs and i get an exception print Error in retrieving user   http://pastebin.com/9t7fyx2M
20:16 Quest sory ^
20:17 Quest only System.out.println("debug ---- 1");   runs and i get an exception print Error in retrieving user   http://pastebin.com/9t7fyx2M
20:17 Quest Naros, ^
20:18 Naros oh gosh, where to start LOL
20:18 Quest :)
20:18 Naros 1) your DAO should be an interface, not the implementation.
20:19 Naros This way if you decide to change the implementation from Hibernate to Toplink to JPA, this code won't need to change.
20:19 Quest ya. i didnt used spring @autowired. i know
20:19 Naros Aye, that's #2
20:19 Quest Naros,  ya. i did that intentionaly
20:19 Quest but it should work.
20:19 Naros Should be autowiring or at least @Resource annotating your DAOs
20:19 Quest Naros,  ya. i did that intentionaly just for testing
20:19 Naros k
20:19 Quest but it should work.
20:20 Naros in your catch block
20:20 Naros add two things
20:20 Naros e.printStackTrace();
20:20 Naros and System.out.println(e.getMessage());
20:20 Naros pastebin the stack & error
20:20 Quest hm. let me change the daoimpl to dao alone. as other things are connected to it...
20:20 Quest ok
20:21 Naros I suspect with you doing new on the DAO, the entity manager or session stuff isn't being injected.
20:21 Naros therefore, it's probably a NullPointerException if I had to guess
20:21 SoniEx2|2 joined ##javaee
20:21 whartung never eat an exception, if you catch one and don't know what to do it, throw another one (preferably a runtime exception)
20:22 Naros Agreed, but its very helpful to print the stack trace so you know where the code died.
20:22 Naros and why it died
20:23 whartung yes, but if you throw the exception, the framework will inevitably catch it and do that for you (if it doesn't, get a new framework :) )
20:23 Naros true that :P
20:24 Quest whartung,  hm
20:26 * Quest clean builds
20:28 Quest by the way, am i the only one who hates tomcat?
20:28 whartung I don't hate tomcat
20:28 Quest because of its slowness and bugs
20:28 whartung I prefer glassfish
20:29 Quest I Jboss
20:29 whartung I don't use tomcat enough to have encountered any major bugs, I've always found it pretty zippy
20:29 Quest its ok for mediam based projects
20:29 Quest quite famous
20:29 whartung what kind of bugs do you encounter?
20:30 Quest many
20:30 Quest http monitor
20:30 whartung because jboss uses tomcat internally, so did glass fish (they forked it long ago)
20:30 Quest local packages . jars
20:30 whartung local pacakges?
20:30 Quest ya. class path issues
20:30 whartung like what?
20:30 Quest i had to manullay past jar in tc dir
20:30 whartung it wouldn't see it in your war?
20:31 Quest no..
20:31 Quest iam not sure. it its totally a tc problem and not an ide problem
20:31 whartung what jar?
20:31 Quest but i had many
20:31 Quest spring jars
20:32 whartung well I can't comment on that.
20:32 Quest but any ways.  good now
20:32 Naros we dont put spring jars in tc lib dir
20:32 Naros they're in the war only
20:32 whartung yea, should be no reason for that at all
20:32 Quest ya. i just used maven.
20:32 whartung WEB-INF/lib
20:32 Quest well working fine after the paste though
20:32 Quest some other issues too.    http monitor filter should be the first one. bla bla
20:32 Naros Did you config anything special in context.xml ?
20:32 Quest disabled http monitor
20:32 Quest works fine now again
20:32 whartung well, you know just because you use maven doesn't mean you're not actually accountable for the output. If maven is "doing it wrong" then fixit.
20:32 Quest Naros,  no
20:33 Naros I'm using maven too :P
20:33 Naros Never see the issue
20:33 whartung I've not use the tomcat http monitor
20:33 whartung I used to use it all the time with netbeans and GF
20:33 Naros We use Tomcat 7.0.39 here with no issues with deployments, both maven based and ant-based deployments.
20:33 whartung but it's been really finicky and stupid past year or so, so I gave up.
20:33 Quest got the exception
20:33 Naros What is it?
20:34 Quest http://pastebin.com/wUvQKAye
20:34 whartung whats on CustomUserDetailsService.java:52
20:34 whartung sounds like what Naros was saying
20:35 Quest its  Users dbUser = userDAO.getUserByLoginId(email);
20:36 whartung so your userDAO is null
20:36 Naros right, so check that it actually is finding the record by the email
20:36 Quest how could it be
20:36 Naros the spec, iirc returns null on a find() if the record doesn't exist
20:36 whartung no, the only NULL here on that line, is userDAO
20:37 whartung we don't dereference the results of the getUser...
20:37 Quest hm
20:37 whartung and if email was null the problem would be in userDAO, not CustomeUserDetailsService
20:37 Naros I'm saying dbUser is likely null
20:37 Naros which is the output from the DAO
20:37 whartung he's not dereferenceing dbUser
20:37 Naros and hibernate returns null for a find() if the record cant be found
20:38 whartung (not yet)
20:38 Naros he does on 53
20:38 Quest the new service is http://pastebin.com/h8k2FAQX
20:38 whartung bt the error is on 52
20:38 whartung at web.service.common.CustomUserDetailsService.load​UserByUsername(CustomUserDetailsService.java:52)
20:38 whartung fifty too
20:38 Naros Quest, you annotated your DAO with @Repository?
20:38 Quest whartung,  how can it be null, Naros  how to find out if the getuserby email runs?
20:38 Quest Naros,  the dao class?
20:38 Naros Yes
20:39 Naros Where did you annotate @Repository
20:39 whartung I don't question "how can it be" I work from "is"
20:39 Naros This is a spring injection problem
20:39 Quest yes.
20:39 Quest @Repository
20:39 Quest public class UsersDAOImpl implements UsersDAO {
20:39 crimsonfubot Quest: Error: "Repository" is not a valid command.
20:39 whartung heh
20:39 Naros lol
20:40 Naros Change the DAO from @Autowired in the service to @Resource.
20:40 Naros See if that makes a difference.  I forget why we only autowire services and resource DAOs
20:40 Quest hm thats strange. it should work it @Autowired
20:40 Quest Naros,  can i add both. @autowired and @resource
20:41 Naros No
20:41 Naros Only 1
20:41 Quest Naros,  can i add both. @autowired and @resource to dao in service
20:41 whartung put in a breakpoint and see
20:41 Quest hm
20:41 Naros @Resource private UsersDAO userDao;
20:41 Quest hm thats strange. it should work it @Autowired . why isnt it
20:41 crimsonfubot Naros: Error: "Resource" is not a valid command.
20:41 Quest crimsonfubot,  sshh
20:41 crimsonfubot Quest: Error: "sshh" is not a valid command.
20:41 whartung HAHA
20:41 * Quest smashes his head
20:41 whartung crimsonfubot help
20:41 crimsonfubot whartung: (help [<plugin>] [<command>]) -- This command gives a useful description of what <command> does. <plugin> is only necessary if the command is in more than one plugin.
20:42 Quest now your talking
20:42 whartung that's right, it doesn't know anything
20:42 Quest crimsonfubot shutup plugin run();
20:42 crimsonfubot Quest: Error: "shutup" is not a valid command.
20:42 * Quest runs
20:43 Quest Naros,  just for understanding sake, it should work it @Autowired . why isnt it
20:43 sfisque joined ##javaee
20:43 Naros Aye, looks like both do the same thing but Resource allows you to override the name :P
20:43 Naros How did you setup Dependency Injection in spring?
20:43 Naros By name or type?
20:44 Naros New projects probably should use @Inject rather than @Autowired
20:44 Quest le me see
20:45 Naros Since autowired i believe is legacy spring
20:45 whartung new projects should use a full boat JEE container :D
20:45 Naros but that's moot right now, issue is your DI isn't happening.
20:46 Quest Naros,  is this what you meant/asked?
20:46 Quest <context:include-filter type="annotation" expression="org.springfram​ework.stereotype.Service"/>
20:46 Quest <context:include-filter type="annotation" expression="org.springframe​work.stereotype.Repository"
20:46 Quest or this <bean class="org.springframework.web.servlet.mvc.s​upport.ControllerClassNameHandlerMapping"/>
20:47 Naros No the include filter were right
20:47 whartung I feel a kitten just died...
20:47 Naros but what component scan base package did you specify?
20:47 Quest Naros,  looks like the error is gone
20:47 Quest let me confirm
20:47 Naros o.O
20:47 Quest no. my bad. it has not
20:48 Quest http://pastebin.com/1FHyRsxA
20:49 Quest disregard ^
20:49 Quest Naros,  this is the one http://pastebin.com/XjwVQ1yd
20:50 Naros I honestly think if you're having to drop spring jars into your TC lib folder for any reason, you have some serious configuration issues
20:50 Naros and those may likely affect anything that spring is doing for u
20:50 Quest hm. i guess same as before
20:50 Naros Aye the issue is that userDao is null
20:50 Quest let me delete them
20:50 Naros which means it isn't being injected by spring
20:50 Quest Naros,  why its null ?
20:50 Quest hm
20:51 Quest why not. i just used to run spring before i introduced spring security
20:51 Quest spring core was working fine
20:51 Naros is this some code you can drop into a pub github repo we could look at perhaps?
20:52 Quest ok
20:52 Naros if its some corporate code or something, be careful not to expose stuff u shouldn't.
20:52 Quest a .war would be fine?
20:53 Naros no i'm more interested in the project's config files & source
20:53 whartung no, need the source Quest
20:53 Naros spring configs, etc.
20:53 Naros You have something which seems very off here based on what you've mentioned
20:53 Quest I dont have anything precious in that. though. or i can just pase the .xmls?
20:54 Naros you could zip it up and post a zip perhaps ?
20:54 Quest sure
20:54 Quest thats what i was saying. ziped war
20:54 Naros war to me implies compiled ready to deploy
20:54 Naros no source in a war generally
20:54 Naros .java files anyway
20:55 Quest 22. mb
20:55 sfisque yah spring == bloated war
20:55 Quest :)
20:57 Quest Naros,  for the moment till i upload. http://pastebin.com/RFqpjKKa
20:57 Quest xmls ^
20:58 Quest spring sec, dispatcher, we
20:58 Quest spring sec, dispatcher, web
21:00 Naros btw Quest
21:00 Naros you can actually include your spring security xml inside your applicationContext.xml and shouldn't have to specify a context param for spring in web.xml :P
21:01 Quest ya.
21:01 Naros <import resource="applicatoinContext-SpringSecurity.xml" />
21:01 Quest just wanted to seperate things. will sperate  hibernate jpa too . soon
21:01 Naros nod
21:01 Quest Naros,  hm ok
21:01 Naros we have lots of applicatoinContext xmls for that reason
21:02 Naros just import them into a base one
21:02 Quest hm
21:02 Naros but nothing in the XML stood out
21:02 Quest ok
21:02 Naros things looked ok (besides the spring mvc stuff which i dont know)
21:02 Quest Naros,  you find anything wrong in the xmls?
21:02 Quest why would the user dao be null?
21:04 Naros It's hard to say beyond the generalized statement that spring isn't injecting beans.
21:04 Naros Let me find what the spring init line looks like, 1 sec
21:04 Quest Naros,  whartung  http://alpinema.com/spring/ttmaven.zip
21:05 whartung I was told not to download zip files from strangers - could be a virus! :D
21:05 Naros org.springframework.beans.factory.​support.DefaultListableBeanFactory outputs something like
21:05 Quest whartung,  :)
21:05 Naros Pre-instantiating singletons [....]
21:05 Naros do you see your UsersDAO listed in that log entry?
21:06 Quest hm.. let  me see
21:06 Naros that should be in the logs right after hibernate core initializes.
21:07 Quest I do i think . springframework.beans.factory.sup​port.DefaultSingletonBeanRegistry destroySingletons
21:07 Quest INFO: Destroying singletons in org.springframework.beans.factory.​support.DefaultListableBeanFactory@612f979f: defining beans [userController,groupsDAOImpl,usersDAOImpl,cust​omUserDetailsService,userServiceImpl,org.spring​framework.context.annotation.internalConfigurat​ionAnnotationProcessor,org.springframework.cont​ext.annotation.internalAutowiredAnnotationProce​ssor,org.springframework.context.annotation.int​ernalRequiredAnnotationProcessor,org.spri
21:07 Quest ngframework.context.annotation.internalCommonAnnot​ationProcessor,org.springframework.context.annotat​ion.internalPersistenceAnnotationProcessor,mvcCont​entNegotiationManager,org.springframework.web.serv​let.mvc.method.annotation.RequestMappingHandlerMap​ping#0,org.springframework.format.support.Formatti​ngConversionServiceFactoryBean#0,org.springframewo​rk.web.servlet.mvc.method.annotation.RequestMappin​gHandlerAdapter#0,org.springframework.web.servle
21:07 Quest t.handler.MappedInterceptor#0,org.springframework.​web.servlet.mvc.method.annotation.ExceptionHandler​ExceptionResolver#0,org.springframework.web.servle​t.mvc.annotation.ResponseStatusExceptionResolver#0​,org.springframework.web.servlet.mvc.support.Defau​ltHandlerExceptionResolver#0,org.springframework.w​eb.servlet.handler.BeanNameUrlHandlerMapping,org.s​pringframework.web.servlet.mvc.HttpRequestHandlerA​dapter,org.springframework.web.servlet.mvc.Simpl
21:07 Naros zomgz
21:07 Quest eControllerHandlerAdapter,org.springframework.web.​servlet.mvc.support.ControllerClassNameHandlerMapp​ing#0,urlMapping,viewResolver,indexController,org.​springframework.orm.jpa.support.PersistenceAnnotat​ionBeanPostProcessor#0,entityManagerFactory,jpaDia​lect,dataSource,transactionManager,org.springframe​work.aop.config.internalAutoProxyCreator,org.sprin​gframework.transaction.annotation.AnnotationTransa​ctionAttributeSource#0,org.springframework.trans
21:07 Quest action.interceptor.TransactionIntercept​or#0,org.springframework.transaction.co​nfig.internalTransactionAdvisor,session​Factory,org.springframework.context.ann
21:07 Quest oh no. sory........
21:07 * Quest uses pastebing.
21:07 * Naros reports Quest for spamming.
21:07 Quest http://pastebin.com/HMWsZTdc
21:08 Quest lolz, didnt knew that line was so long
21:08 * sfisque reaches for the KICK button
21:08 * Quest hides
21:08 whartung ah, I got demoted from operator status...
21:08 sfisque the gods have spoken
21:08 sfisque :P
21:08 * whartung is so unworthy
21:08 Quest whartung,  you didnt. you missed the commands ?
21:08 sfisque sacrefice a windows install disc in the nearest microwave to attone
21:09 whartung usually it promoted me when I joined...
21:09 Naros Alright so usersDaoImpl is there
21:09 Quest whartung,   -ChanServ(ChanServ@services.)- 5     whartung               +O [modified 1 week, 6 days, 08:04:53 ago]
21:10 Quest Naros,  ya. userdaoImpl is there.
21:10 Quest whartung,  you can become op when you are identified....
21:11 Naros Quest inside your UsersDAOImpl
21:11 Quest oh. i know what you are going to say
21:11 Naros lol
21:12 Quest am. no. never mind.
21:12 Quest i check it. its ok. (the thing i though you were going to say. is correct) So i think you would by saying something else
21:12 Quest :)
21:12 Quest so in side my UserDaoImpl?
21:13 Quest thought*
21:13 Naros Why do you take query.getResultList() and pass it into a new array list?
21:14 Naros List<?> list = query.getResultList();
21:14 Naros if(list == null || list.size() == 0) throw new UserNotFoundException();
21:14 Naros return list.get(0);
21:14 Quest query.getResultList()   is itself a list
21:14 Naros Aye, i believe it is.
21:14 Quest ::|
21:15 * Quest couldnt find a better face
21:15 Naros There may also be a uniqueResult() or equivalent method for getting 1 row from the query
21:15 Naros anyway, do me a favor.
21:15 sfisque looks like he's working aorund the fact that getSingleResult throws an exception if it returns  size( list ) <> 1
21:16 Naros catch the exception and throw something app specific for that imo
21:16 Naros but that's minor, to the bigger fish.
21:16 Quest iam just unfamilier with throw new UserNotFoundException();
21:17 Naros Quest, remove the spring jars from tomcat
21:17 Quest Naros,  i did
21:17 Quest Naros,  i already did
21:17 Naros Ah
21:18 Quest did a  new UsernameNotFoundException("User not found");
21:19 Quest by the way, should we everytime clean build after any change in code/xml?
21:20 * Quest cleans build
21:20 Naros I don't typically.
21:20 Naros But it depends on what you change
21:22 Quest Naros,  same error again. http://pastebin.com/CFU4AVJq
21:24 Naros 1 sec, trying to get the barebones app to load to test DI
21:24 Quest ok
21:27 Quest Naros,  I think we should clearup this mehtod first. http://pastebin.com/3YX6DP6g
21:27 Naros What URI do you invoke to get your error by the way?
21:27 Naros i dont know spring mvc :P
21:27 Quest the /loginfail
21:28 Naros loginfail gives me Hello World
21:28 Naros is that right?
21:28 Quest yes
21:28 Naros I got no errors
21:28 Quest Naros,  when i do System.out.println((Users)list.get(0).getEmail());   in that method above.      it does not allows me to do the    .getEmail() . i think its not a user object
21:29 Quest Naros,  look in the tomcat log
21:29 Quest the loginfal page and hello world is also visible to me. but with errors
21:30 Quest the loginfal page and hello world is also visible to me. but with errors in the tomcat logs
21:31 Naros I didn't get any tomcat errors.  let me add some debugging, 1 sec
21:32 Naros hm, are you sure loginfail runs that code you have been showing us?
21:33 Naros Your system outs are even printed.
21:33 Naros *aren't
21:33 Naros nvm got it
21:36 Quest hm
21:36 Quest only one sysout is printed. ----1
21:39 Naros This has me puzzled.
21:39 sfisque heisenbug.  the harder you look at it, the more elusive it becomes
21:39 Quest Naros,  I changed the method to this with debugs.  and none sys outs. http://pastebin.com/Af8jH8fx
21:40 Naros Right that's because the DAO is null and the method cant be invoked
21:40 Quest Naros,  so it means that the public Users getUserByLoginId(String email){    method isnt executing
21:40 Quest Naros,  now why would the Dao be null
21:40 Naros Spring's DI isn't working for you in your configs, Trying to determine why.
21:40 Naros idk if its due to spring mvc stuff u have
21:41 Quest would it be spring core problem or spring sec?
21:41 Quest it was working fine before i introduced spring sec
21:41 Naros well spring core is what handles the injection
21:41 Quest ya. ofcourse
21:43 Naros I might suggest you comment out the spring security filter in web.xml and remove the xml from the contextConfigLocation context param.
21:43 Naros then create a controller that just calls a dummy service that calls a DAO method
21:43 Naros see if the injection works
21:43 Quest hm
21:43 Naros if it doesn't work even with spring security stuff commented out, then its more of a spring config problem.
21:44 Quest a minut then
21:46 Naros if i use the /create URI, then the user service has a DAO which isn't null
21:46 Naros that seems to work.
21:47 Naros re-enabled spring-sec, added /create as permitAll, DAO still is not null
21:47 Naros so its that custom service
21:48 Quest Naros,  i already have done that in the zip. in user controller. @RequestMapping(value = "/create" )
21:48 Naros aye
21:48 Quest the /creates a test user. using dao. i will check that after comenting out spring sec
21:48 Naros i just tested /create with sprnig security off and with it on.
21:48 Naros both work ok
21:48 Naros aside from the fact the DB table on my end doesn't fit yours :P
21:49 Quest yes. it has created a user in the databse............... by /create.   no why it is working with spring sec
21:49 Quest oh. i just read what you said
21:50 Naros Alright so here's the difference
21:50 Quest Naros,  so. whats.. wrong..
21:50 * Quest is glad that spring core works!
21:50 Naros In my equivalent to your web.service.common.CustomUserDetailsService
21:51 Naros mine is declared as public class UserDetailsAuthenticationService extends AbstractUserDetailsAuthenticationProvider
21:51 Naros but it isn't annotated as a @Service.
21:51 Naros Inside that class, it actually autowires in a service
21:51 Naros @Autowired private UserService userService;
21:51 crimsonfubot Naros: Error: "Autowired" is not a valid command.
21:52 Naros inside that service, is the DAO
21:52 Naros lets try removing @Service on your CustomUserdetailService
21:52 Quest hm
21:52 Naros grr, still null
21:54 Quest Naros,  should i paste this http://pastebin.com/avvS2ZcC       AFTER the dispaccher?
21:54 Quest Naros,  should i paste this http://pastebin.com/avvS2ZcC       AFTER the dispaccher in web.xml?
21:54 Naros i dont think that matters.
21:55 Naros the issue seems to be injection isn't happening for this one bean
21:55 Naros it doesn't make any logical sense to me why
21:56 Quest hm.
21:56 Quest strange then.
21:57 sfisque does spring injection require accessor/mutators like CDI?  are they present?
21:57 sfisque it's been years since i've actually used spring directly
21:57 sfisque so i cannot remember
21:59 Quest dont know..
21:59 Naros far as I know, just annotating the property on the bean is sufficient
22:02 Naros I'll have to play with this some more tomorrow Quest.
22:02 Naros Your controller links into the service
22:02 Naros which has a DAO
22:02 Naros but for whatever reason this bean via spring security doesn't get injections.
22:03 Naros idk if there is something specific when using spring mvc + spring security u have to do
22:03 Naros there wasn't for us but again we aren't using spring mvc.
22:03 Naros struts2 allows us via a plugin to allow spring to manage our actions
22:03 Quest Naros,  sure
22:03 Quest thanks!
22:04 Quest great help!
22:05 Naros heh, not really but ok :P
22:05 Naros you've given me a nut I gotta try to crack
22:08 Naros Going to try 1 quick fix
22:10 Quest :)
22:12 Naros my test didn't work either.
22:12 Naros i ponder if I rip out MVC and put struts2 in its place will this continue to be an issue.
22:13 Naros root of the issue is that for some reason that defined bean in the xml doesn't get injected.
22:13 Naros while every other bean does
22:13 whartung Spring is EZ
22:13 Naros Oh
22:14 Naros if this works I'm going to smack Quest with a fish :P
22:15 Naros Quest: where does springDispatcher-servlet.xml get imported??? LOL
22:16 Naros LOL
22:16 Naros that's it
22:16 Naros You have springDispatcher-servlet.xml configured with your scanning
22:16 Quest the problem is that:
22:16 Naros but you never included that xml in your context locations
22:16 Naros so it never scanned anything to setup the dependency injection
22:17 Quest the bean inside the CustomUserDetailsService does not get injected.
22:17 Naros no
22:17 Naros in web.xml
22:17 Quest so there might be a problme with that class
22:17 Naros Add  /WEB-INF/springDispatcher-servlet.xml
22:17 Naros to the contextConfigLocation
22:17 Naros or move the scanning XML config to your applicationContext.xml
22:18 Naros the issue is because the springDispatcher-servlet.xml wasn't told to spring to load, it was never scanning properly to handle dependency injection.
22:18 Quest then why did /create worked
22:18 Naros my guess is mvc:annotation-driven
22:18 Naros perhaps that file is automatically loaded by spring-wmvc
22:18 Naros *mvc
22:19 Quest so i should just import the springdisp.xml      in applicationcontext.xml?
22:19 Naros so my suggestion would be to move everything from that file that isn't mvc related and put it in the applicationContext.xml
22:19 Naros and leave web.xml as-is
22:20 Naros and let springDispatcher-servlet.xml just be whatever it needs to be for mvc only
22:20 Quest I just did a  <import resource="springDispatcher-servlet.xml" />     in applicationconetxt.xml
22:20 Quest thats all?
22:20 Naros yah, try that and see if it works
22:20 Quest k
22:21 Naros you good?
22:23 Quest improvment
22:23 Quest now i have more errors. but they are sane now.    now i think the dao i injected. as  debug ---a is called. that was in side userdao getUserbylogiid
22:23 Quest ()
22:23 Naros Yep.
22:24 Naros You should be able to figure things out from there.
22:24 Naros I would highly suggest you make your xmls data centric if you're going to have multiple ones for various things..
22:24 Quest http://pastebin.com/y06yH0Cd
22:24 Naros global stuff in the appcontext then module specific in the others
22:24 Quest Naros,  hm. i hope so.
22:25 Naros yah that's a query issue :P
22:25 Naros I'll leave that for you to play with because I think its worth the time to get a bit familiar with the syntax :)
22:26 Naros but your framework should work as you intend
22:26 Naros if i can, i'll try to poke back in from home.
22:26 Naros if not, see u at 830am CT tomorrow.
22:26 Quest hm
22:26 Quest great
22:26 Quest wonderful
22:26 Quest thanks!
22:27 Naros np
22:27 Quest CT?
22:27 Quest california time?
22:27 SoniEx2 am I allowed to gayhug in here?
22:28 Quest SoniEx2,  sure.
22:28 Quest iam leaving
22:28 * SoniEx2 hugs everyone in an overly gay way ^-^
22:28 Quest :)
22:28 Quest lucky i left
22:28 SoniEx2 #minecraft doesn't like it :/
22:50 sfisque cool with me soniex2
22:50 sfisque :-)
22:51 SoniEx2 both #minecraft and ##transgender said it's a bit homophobic... but I'm gay myself and I'm only copying my boyfriend!
22:52 sfisque well, since at least one of the OPs in here is gender-queer, you're covered ;-)
22:52 sfisque just try to say on topic for the most part
22:52 sfisque ***stay
22:55 SoniEx2 are we talking about you? ^-^
22:56 * sfisque looks around innocently
22:57 SoniEx2 ... what's that supposed to mean? (sorry :P)
22:58 sfisque yes.  i dance on both sides of the fence, so to speak :-P
22:59 * SoniEx2 hugs sfisque in an overly cute way ^-^
22:59 SoniEx2 sorry I had to change it :/
22:59 sfisque all good :-)
22:59 SoniEx2 but it's cuter now :D
23:52 SoniEx2 sfisque: could you help me?
23:53 SoniEx2 with #nbx
23:53 whartung what is that?
23:53 SoniEx2 fancy stuff...
23:55 SoniEx2 just join read the topic ^-^
23:56 whartung whats it about?
23:56 SoniEx2 read the codename :P
23:56 whartung guess I'm not interested in anything that needs to be that secretive

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