=== doko_ is now known as doko | ||
gnagno | hello all | 13:50 |
---|---|---|
gnagno | I have a problem with java programs, if I run them as normal user they don't work, but if I run them with sudo they work, any solution? | 13:51 |
persia | Packaged programs or unpackaged programs? If the former, which one? | 13:53 |
gnagno | any program | 13:55 |
gnagno | now I am trying with a simple "hello word" | 13:55 |
gnagno | just imagine I make a very simple program, compile it and any time I try to run it I have to use sudo | 13:55 |
persia | Which JRE do you have installed? | 13:57 |
gnagno | this is the output from java -version | 13:59 |
gnagno | java version "1.6.0_20" | 13:59 |
gnagno | Java(TM) SE Runtime Environment (build 1.6.0_20-b02) | 13:59 |
gnagno | Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode) | 13:59 |
persia | And that's installed from the package? | 13:59 |
persia | Hrm. | 13:59 |
gnagno | yep | 13:59 |
persia | I've never heard of this issue before. | 13:59 |
persia | You get "permission denied" when you try to run without sudo? | 13:59 |
gnagno | no | 13:59 |
persia | What error do you get? | 13:59 |
gnagno | this: http://pastebin.com/1R7JDkLU | 14:00 |
gnagno | do you want I paste the log file too? | 14:00 |
nthykier | do your user have LD_LIBRARY_PATH or LD_PRELOAD set to anything? | 14:07 |
nthykier | but yes, it would be nice to see the log file as well | 14:08 |
nthykier | gnagno: ^ | 14:08 |
nthykier | Gah, my mouse just died on me >.< stupid battery | 14:08 |
* persia took too long and got "WE ARE CURRENTLY MOVING SERVERS, DUE TO THIS, A FEW PASTE ARE CURRENTLY OFFLINE, THEY WILL BE BACK IN A FEW MINUTES." :( | 14:09 | |
gnagno | wait wait... I discovered something strange | 14:09 |
gnagno | now my simple hello world app is working with normal user | 14:09 |
persia | Oh, excellent. | 14:10 |
gnagno | can you please look at this one? http://pastebin.com/ZmX09u79 | 14:10 |
gnagno | if I uncomment line #16 it is not working | 14:10 |
gnagno | maybe the problem is somehow related to some library? | 14:11 |
* persia gets the same error message | 14:11 | |
nthykier | ooooooh, sounds like someone broke swing | 14:11 |
nthykier | smells like a bug report | 14:12 |
gnagno | and this is the content of the log file: http://pastebin.com/7abuwVrw | 14:12 |
gnagno | Netbeans is not working too... I have to lauch it as root | 14:13 |
gnagno | persia, did you get my same error message with my simple program? | 14:17 |
persia | Yes, and my browser crashed. | 14:18 |
persia | But I agree with nthykier: it's probably enough to file a bug report. | 14:18 |
nthykier | gnagno: wait... why is your sun java using motif? | 14:20 |
nthykier | I thought gtk+ was the backing implementation of Java on Linux in Ubuntu? | 14:21 |
gnagno | nthykier, I don't know... I don't think I changed it | 14:22 |
gnagno | how can I change it back to gtk+ ? | 14:23 |
nthykier | Don't know | 14:23 |
persia | Ought be gtk | 14:23 |
nthykier | yeah, it ought to be gtk... you definitely want to mention that it uses motif and not gtk in the bug report | 14:24 |
persia | Indeed. | 14:24 |
nthykier | and then pass the bug number to persia so he can click the "I am also affected by this" button ;) | 14:25 |
persia | Um, except I'm not :) | 14:25 |
nthykier | :) | 14:27 |
gnagno | I am googling to see if I can change this from motif to gtk | 14:31 |
gnagno | anyway don't you think it's strange that it's working with sudo and not with my normal user | 14:40 |
gnagno | ? | 14:40 |
persia | It is strange, hence the request to file a bug. | 14:40 |
nthykier | well, that is kind of why I asked about the LD_PRELOAD and LD_LIBRARY_PATH, as I recall sudo unsets those before starting the application (since keeping them opens possible root exploits) | 14:43 |
nthykier | though I did not see anything in the crash log that suggests it was using non-standard libraries | 14:45 |
gnagno | someone else have my same problem: http://ubuntuforums.org/archive/index.php/t-1257346.html | 14:47 |
nthykier | erh, is the log supposed to say OS:squeeze/sid and not (e.g.) Maverick? | 14:48 |
nthykier | s/log/crash log/ | 14:49 |
nthykier | Hmm it does not really look like the method that crashes can crash | 14:53 |
gnagno | why squeeze ? I am using Meverick | 14:59 |
nthykier | Yeah, Squeeze is the current development release of Debian... well, maybe Ubuntu has just imported the Debian package without changes and it is hardcoded into Java itself when it was built | 15:05 |
gnagno | do you think it is possible that the root user can access some libraries that my normal user cannot? | 15:06 |
gnagno | and this is why netbeans and swing programs are not working for my normal user? | 15:06 |
nthykier | it is possible, but unless you have been messing with chmod/chown in /usr/lib/ and /lib then it is not very likely | 15:07 |
gnagno | actually I noticed that the program is raising the error in the moment I call hw.setVisible(true); | 15:07 |
nthykier | yupe the log also suggests this is the case | 15:08 |
nthykier | rather - it confirms this is the case (see "Java Frames:") | 15:09 |
pato | hello | 15:09 |
gnagno | so the problem is in the rendering moment | 15:09 |
gnagno | hello pato | 15:09 |
nthykier | gnagno: btw, do you experience this problem when using OpenJDK ? | 15:11 |
pato | sorry to bother today. I am having and issue when compiling through ireport and netbeans. Its all related to having the java driver installed | 15:11 |
pato | I have it | 15:11 |
pato | but it is like is not finding it at all | 15:11 |
pato | it worked on fedora, but it justs fails on ubuntu | 15:12 |
pato | anyone has any ideas? | 15:12 |
nthykier | gnagno: btw, what exactly did you write when you start your application? | 15:12 |
gnagno | nthykier, with openjdk it is working | 15:12 |
nthykier | Yay for open source software | 15:12 |
gnagno | nthykier, do you mean what is the content of the app file? | 15:13 |
gnagno | ok I guess I can use openjdk :) | 15:13 |
nthykier | the app file? | 15:13 |
gnagno | you asked me what exactly did you write when you start your application? | 15:14 |
gnagno | what do you mean? | 15:14 |
nthykier | well, do you write "java $classname" or what? | 15:14 |
gnagno | oh yes | 15:14 |
gnagno | java package.classname | 15:14 |
nthykier | so java package.classname and sudo java package.classname ? | 15:15 |
gnagno | yep | 15:15 |
gnagno | the second one is working | 15:15 |
gnagno | actually netbeans is still not working, even with openjdk | 15:15 |
nthykier | Hmm, "which java" and "sudo which java" - do they output the same? | 15:16 |
gnagno | yes | 15:16 |
gnagno | I even tryed java -version and sudo java -version | 15:16 |
nthykier | okay - just checking (sudo could also change the PATH) | 15:17 |
=== pato is now known as patojamriska | ||
nthykier | patojamriska: : as in netbeans cannot find a java compiler? | 15:17 |
nthykier | or netbeans fails to start? | 15:17 |
patojamriska | no | 15:18 |
patojamriska | this is the error i get | 15:18 |
nthykier | gnagno: hmm, what error does netbeans give you ? | 15:18 |
patojamriska | Caused by: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://VMCITSMSQL2A:1433;DatabaseName=HDQUERY | 15:18 |
gnagno | this is netbeans error: http://pastebin.com/RC7Gxdkt | 15:19 |
patojamriska | but I have the driver there | 15:19 |
patojamriska | I can connect via a dicrect netbeans connection, but if I instanciate the driver with java.sql.drvier..... it just doen't work | 15:20 |
nthykier | Hmm, been a while since I last played with SQL drivers | 15:20 |
patojamriska | well, like I said, I just pointed the driver in the classpath in fedora, and it worked fine. I updated to ubuntu and all of a sudden I can't work because of this | 15:21 |
patojamriska | I been looking for an answer everywhere and no one seems to know | 15:21 |
nthykier | If the driver is from an Ubuntu package the jar may be named slightly different and be placed in /usr/share/java | 15:22 |
nthykier | gnagno: same error with OpenJDK ? | 15:22 |
patojamriska | ok let me check nt | 15:22 |
gnagno | nthykier, this is with OpenJDK | 15:23 |
nthykier | "/usr/lib/jvm/java-6-sun/bin/java" -Djdk.home="/usr/lib/jvm/java-6-sun" | 15:23 |
nthykier | that is not openjdk :P | 15:23 |
gnagno | uhm... I did update-java-alternatives | 15:24 |
nthykier | possible, but your local netbeans is still using sun java | 15:24 |
nthykier | maybe JAVA_HOME is set | 15:24 |
gnagno | yes, you're right | 15:24 |
patojamriska | naa, I still get the no suitable driver | 15:26 |
nthykier | patojamriska: what is the package/jar you are using? | 15:26 |
patojamriska | sqljdbc4.jar | 15:26 |
gnagno | I uncommented JAVA_HOME and netbeans is still using java-6-sun | 15:27 |
gnagno | sorry, I meant I commented | 15:27 |
patojamriska | gnagno: try to use the java command to change the default java | 15:28 |
nthykier | patojamriska: mmm, cannot see that jar being present in any java package I am aware of. did you download it from a third-party vendor? | 15:29 |
patojamriska | yeah | 15:29 |
patojamriska | great MSoft | 15:29 |
gnagno | patojamriska, how to use the java command to change the default java? | 15:30 |
patojamriska | gnagno: sudo update-alternatives --config java | 15:30 |
nthykier | actually you may find update-java-alternatives very convenient for changing system java | 15:31 |
gnagno | thanks, I did it but netbeans is still using java-6-sun | 15:31 |
patojamriska | nthykier: It shouldn't be tis hard, specially if you add the jar to the system and point it on the classpath | 15:31 |
patojamriska | hmm | 15:31 |
nthykier | patojamriska: admittedly it should work the same on Ubuntu and Fedora | 15:32 |
patojamriska | exactly | 15:32 |
patojamriska | I got no idea why is not working | 15:32 |
patojamriska | now, If I deploy it to the server on tomcat, it works half ways sometimes | 15:32 |
patojamriska | because I can't troubleshoot the report on NB | 15:33 |
nthykier | NB? | 15:33 |
patojamriska | netbeans | 15:34 |
patojamriska | or iReport | 15:34 |
patojamriska | or pure java | 15:34 |
patojamriska | none do it | 15:34 |
patojamriska | :( | 15:34 |
nthykier | ah netbeans | 15:34 |
nthykier | I am an eclipse user | 15:34 |
nthykier | not used to all the netbeans related abbreviations :) | 15:35 |
nthykier | hmm, does this sql jar have any dependencies? | 15:37 |
nthykier | or is it a complete stand alone? | 15:37 |
patojamriska | that's ok | 15:37 |
patojamriska | complete stand alone | 15:37 |
patojamriska | I wish ireport would have the plugin for eclipse | 15:37 |
nthykier | okay - that rules out something being loaded on Fedora that was not loaded in Ubuntu | 15:37 |
nthykier | you could write one *hint hint* | 15:37 |
nthykier | hehe | 15:37 |
patojamriska | :) | 15:37 |
patojamriska | yeah I been looking at the source and thinking about it | 15:38 |
patojamriska | but I am on a big project right now that does not give me much spare time for it | 15:38 |
nthykier | btw, are you using sun-java or OpenJDK? | 15:40 |
nthykier | or even GCJ? | 15:40 |
nthykier | also, have you people tried using netbeans from Ubuntu - as I understand it Ubuntu got 6.9 in Maverick (haven't checked it though) | 15:42 |
patojamriska | sorry I was lookign at the other screen | 15:48 |
patojamriska | 6.8 ubuntu | 15:48 |
patojamriska | sun | 15:48 |
patojamriska | and openjdk | 15:48 |
patojamriska | none work | 15:48 |
patojamriska | and on fedora was working on both | 15:48 |
gnagno | I tryed now to install netbeans from package, still got the same error tought it installed a lot of dependencies | 15:50 |
nthykier | gnagno: if the Ubuntu package does not respect your system settings for java (and you do not have JAVA_HOME set in your terminal/environment) then you should file a bug against it | 15:54 |
patojamriska | I hate to say this but I am going to have to install windows to work on this thing of netbeans for a while | 15:55 |
gnagno | patojamriska, I was going to say the same... | 15:55 |
nthykier | fair enough | 15:56 |
gnagno | I just am not used to windows | 15:56 |
patojamriska | i hate windows | 15:57 |
patojamriska | i might as as well on the java forum and see if anyone has any ideas | 15:57 |
patojamriska | thank you for your time though nt | 15:58 |
patojamriska | oh | 15:59 |
patojamriska | check this out | 16:00 |
patojamriska | I changed the parameter to use the local connection on the report, and have another pointing to mysql and now I get this | 16:00 |
patojamriska | Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://cedev/PartsInventoryDevelopment | 16:00 |
nthykier | mm, we do have an mysql driver in Ubuntu last I checked - you probably have to tell netbeans where to find it though | 16:01 |
patojamriska | is on my classpath | 16:01 |
nthykier | btw, those URLs looks "strange" | 16:02 |
patojamriska | how come? | 16:03 |
nthykier | well, regular URLs are read as protocol://host/resource but yours (ignored the jdbc: part) does not seem to have hostnames in them | 16:05 |
nthykier | again it is ages since I last looked at Java and SQL drivers :P | 16:06 |
patojamriska | well I use teh hostname of the dev machine == cedev | 16:06 |
patojamriska | and teh resource the database name | 16:06 |
patojamriska | it works fine on the straight connections | 16:06 |
patojamriska | :) | 16:06 |
nthykier | sure :P | 16:07 |
patojamriska | lol | 16:07 |
nthykier | our university computers have aliases in their /etc/hosts file for all their machines, so I know that the URL could be valid... just that most setups do not use aliases like that :) | 16:10 |
gnagno | I am still fighting with java and swing | 16:11 |
nthykier | I learned long ago that GUI programming is generally not me... I can do all the component logic and connect the events, but I cannot be bothered to create something that looks decent | 16:13 |
nthykier | mmm... headless programs :P | 16:14 |
patojamriska | :) | 16:22 |
patojamriska | no luck | 16:31 |
patojamriska | im going to have to use windows | 16:31 |
gnagno | patojamriska, windows in evil | 17:04 |
persia | Let's not argue about how one or another operating system is bad. | 17:12 |
persia | Arguing about why one or another is good, on the other hand, is less objectionable. | 17:12 |
persia | We can always learn to improve :) | 17:12 |
gnagno | persia, of course I was irhonic :) | 17:15 |
gnagno | I just need to make swing work under ubuntu :/ | 17:16 |
gnagno | I am leaving thank you very much for your help | 17:57 |
patojamriska | im out as well | 18:23 |
patojamriska | i'll be back later | 18:23 |
patojamriska | thanks for all the help | 18:23 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!