Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL
Ok, let's see if I can actually phrase this question...

I have 3 comboboxes, each of them with the same options, let's say they're "name", "surname", "address", "age", "country".

Now, I need those 3 boxes to filter each other out. For example, if on the first combo box I choose "name", the second and third should not display the "name" option, and so on.

Any ideas?

Thanks.

Adbot
ADBOT LOVES YOU

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL
Ok, let's see...
I was handed a little proggie which combs a database, looks for different values (Select distinct), and then replaces them with different correlative numbers. This was done in order to "mask" a database so we lowly offshore code monkeys could not access sensitive information.

They realized this approach sucked, and now they want to use different kinds of "mask data" depending on the original data type.

So numbers (like phone numbers, ip addresses and such) will still be replaced by 1, 2, 3 and so on, but Strings will have to be replaces by, well, letters.

I thought about using randomly generated strings of a fixed length, but they need to be different for every distinct result on the original table, and I think checking every newly generated one to see if it hasn't been already used would be a mess. I was then thinking about an alphanumeric "counter"; is there any way of taking a string (let's say "AAAAAAA" for example's sake), and transform it into "AAAAAAB", "AAAAAAC" and so on and so forth?

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL
I'm gonna have to do some work with Spring rather soon, and I've never touched it. Any recommended places to get started?

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL
Yeah, my plan was basically see what I needed to do and then just google it, but that's how I usually do things and I wanted to get a headstart this time. I'll take a look at the official docs for now, but I'll bookmark that book to get later; I haven't used Spring in any positions so far and I'm realizing (a bit late) that it's a tool I actually should have.

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL

TheresNoThyme posted:

Hopefully this is obvious to you but it really matters what version of spring you're planning to work with (IE a legacy project with 3.x, a new project with spring 4, etc...) and if you're planning to google for information you should be wary that a lot of old articles will tell you to do things that no longer make sense and in some cases, due to package refactoring or spring's hatred of deprecated code, just won't work. This is true even across some minor versions. Spring publishes project examples for a lot of their stuff which is usually a good place to start in my opinion.

Awesome framework though if you're willing to spend the time with it. I'm upgrading a bunch of java data services to use lombok + spring mvc + spring data + spring security and it's a little bit disturbing how good it looks.

Yeah, noticed. :v:

I need to work on a little project as a job interview of sorts, basically develop a web service that gets some info from Weather Underground and then returns a JSON; that part, I have running.

My problem is that the next part involves deploying a simple html to tomcat (working with tomcat7), and have that webpage ping the webservice every minute or so and update itself. So far, so good, but I can't get tomcat to display the bloody thing. I'm a bit lost between the web.xml and the spring-servlet.xml, I either get the webservice running or the html; when I try to get both I either get a 404 on the html or a 500 error because I didn't declare a handler (which I did. I'm reading it right now!).

I'll get it eventually. I hope. :negative:

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL
We recently migrated from WAS6 to WAS8 at work, and now for some reason java is not throwing custom exceptions for one of the projects or logging stuff.

If I run test cases from eclipse, it works like a charm, throwing the exceptions it should (and it does in WAS6), and logging stuff. Once I deploy it, however, it kinda falls into a weird black hole where it's just not throwing the custom exceptions. I've put sysos everywhere and I've been trying to see if there's something weird with the code, but this particular project was not touched during the migration, so suddenly I reach this:

code:
if (match == null)
         {
            log.error("The grammar1 did not match with the response line=" + st
               + ".So far message got parsed upto :" + this.toString());
            throw new SAXException("The grammar2 did not match with the response line=" + st
               + ".So far message got parsed upto :" + this.toString());
         }
And that SAXException is just never thrown, but that log.error is logging perfectly.

I know it's a bit nebulous, but is there any obvious thing I'm missing here?

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL
Yeah, all throw lines are being reached. That grammar1 and grammar2 I changed the names so I could see which one it was logging, and I can see grammar1 on the output, so it should be reaching the exception right below that, considering it's right loving there inside the same block, and I can actually see the grammar2 when running it from eclipse, but once I deploy, I just get the first one. :(

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL

carry on then posted:

So if all the lines are being reached, then you should be able to put a try-catch for the exception around the call to whatever method your sample is in, and at least log something out there. Are you doing that?

What I think is happening is that something is swallowing your exception before it gets where you expect it to be. What log files do you look at for these entries, by the way?

Yeah, I thought it could be something was catching the exception way before where I was looking, not doing poo poo with it so I wasn't reaching me, but started going back and it's doing the same with all exceptions; it's reaching them but not throwing them. Weird thing is, the code for this part is exactly the same as before the migration, so it shouldn't be an issue code-wise.

I'm checking the system.out log for my local WAS8 server, and we have another log where all the proper logging goes, but it's not doing the logging either. I have things like this:

code:
syso(hey - syso)
log(hey - log)
And I can track the sysos without problem, but it's not logging a single thing. Other bits of the code use the same logging methods and those are logging properly.

This migration was a bloody mess. :(

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL

covener posted:

What kind of programming model / container is this code running in? Did you move to WAS Liberty when you moved to 8.x? I work on (some fringe pieces of) WAS at IBM, but don't have PMs. Contact me at covener@apache.org if you want to pursue.

It's EJB3, and no, it's just regular old WAS8 (8.0.0.6 I think we're running). I think there's something weird with how that particular project is interacting with the rest of the code; it looks like it's not throwing custom exceptions or using our custom logger, but it's logging when using the native java log. method.

I've just mined everything with throw exceptions calls and I'll see if it makes any difference.

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL

Volmarias posted:

Silly question, but have you tried decompiling the generated .class files and seeing if the throws even exist? Some libraries like proguard tend to make certain... Unwarranted Assumptions.

I hadn't, but I just did and yeah, they're all there. This is the weirdest poo poo.
Thanks all for the help, I'll probably end up involving the guy who did the migration in the first place since I'm a bit out of my depth here.

Adbot
ADBOT LOVES YOU

Edmond Dantes
Sep 12, 2007

Reactor: Online
Sensors: Online
Weapons: Online

ALL SYSTEMS NOMINAL

carry on then posted:

My only other thing to think about would be seeing if there are any FFDCs generated? But I've only really worked with Liberty when looking at those. (Like covener I actually work on WAS but I'm too new to have much experience with your direct issue.)

Looks like there's some activity in the ffdc, but I have no idea how to read that; I'm not seeing any of our exceptions in there though, only a few CORBA transaction reports.

Volmarias posted:

Are the exceptions that aren't throwing in code that you can modify? If so, can you add logging statements AFTER your throw and see if it gets reached? Wrap that log line in an if(true) to help foil the static analysis that says you'll never reach that.

I actually crammed code INSIDE the exceptions (after calling the super()); from eclipse I can see the system.outs so I know it's going there, but once I deploy it just stops paying attention to them; it's not that it's throwing them but not catching, it's just... skipping over that line of code (and some of the logging statements as well).

I thought it was a case of it ignoring custom exceptions, but I crammed a throw NullPointer in there and it's doing poo poo to that as well (the code is being updated, I change the sysouts to check that since I was afraid it wasn't deploying properly).

Ah well, I'm off work for the day, I'll have another crack at it on Friday (holiday tomorrow wooo :toot: )

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply