Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.
... while writing a java program using Java EE. The problem is that all the links to fix this issue by getting the required jar file are dead links. Can anyone help me fix my "Stubbed" version of EE or help solve this problem in some other way?
Your link listed an error message that could result from many different types of problems. The problem in the link was due to a corrupt or missing installation of Java EE. To remedy that problem, you should get and install the Java EE SDK from Oracle. It is impossible to know whether the linked forum-post is identical to your issue, from the information you provided. Nimur (talk) 03:05, 5 April 2012 (UTC)[reply]
Valid point. Here is the code in question. I use a full file path as the "f" (file) param.
Sample code
packagemyircbot;importjava.util.Date;importjava.util.Properties;importjavax.activation.DataHandler;importjavax.activation.FileDataSource;importjavax.mail.Message;importjavax.mail.MessagingException;importjavax.mail.Multipart;importjavax.mail.Session;importjavax.mail.Transport;importjavax.mail.internet.InternetAddress;importjavax.mail.internet.MimeBodyPart;importjavax.mail.internet.MimeMessage;importjavax.mail.internet.MimeMultipart;publicclassmailSender{publicstaticStringto,subject,body,file;mailSender(Stringt,Strings,Stringb,Stringf){to=t;subject=s;body=b;file=f;}publicvoidsendEmail(){Stringfrom="xxxxxxx@gmail.com";Propertiesproperties=newProperties();properties.put("mail.smtp.host","smtp.gmail.com");properties.put("mail.smtp.port","587");Sessionsession=Session.getDefaultInstance(properties,null);try{MimeMessagemessage=newMimeMessage(session);message.setFrom(newInternetAddress(from));message.setRecipient(Message.RecipientType.TO,newInternetAddress(to));message.setSubject(subject);message.setSentDate(newDate());// Set the email message text.MimeBodyPartmessagePart=newMimeBodyPart();messagePart.setText(body);// Set the email attachment fileMimeBodyPartattachmentPart=newMimeBodyPart();FileDataSourcefileDataSource=newFileDataSource(file){@OverridepublicStringgetContentType(){return"application/octet-stream";}};attachmentPart.setDataHandler(newDataHandler(fileDataSource));attachmentPart.setFileName(file);Multipartmultipart=newMimeMultipart();multipart.addBodyPart(messagePart);multipart.addBodyPart(attachmentPart);message.setContent(multipart);Transport.send(message);}catch(MessagingExceptione){e.printStackTrace();}}}
I hope this is much more useful. Additionally i would like to note that the libraries i am using are JDK 1.7 (Default), and "Java EE 6 API Library - javaee-api-6.0.jar".
Also here is the error:
Exception in thread "Thread-2" java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at myircbot.myChaos.main(myChaos.java:85)
at myircbot.myChaos.run(myChaos.java:18)
at java.lang.Thread.run(Thread.java:722)
Line 85 of myChaos is where i instantiate an object of type mailSender.
Now we have something to go on, at least. As before, I suspect your Java EE installation is malformed, or you have both SE and EE installed, but you are inadvertantly running Java SE. Your mailSender class imports several JavaEE worker-classes (e.g. javax.mail.transport and its siblings). I assert that you can reproduce this issue with far less code than you provided (and you could provide a standalone, compile-able listing).
How are you running your code? Is it embedded into a Java application server? Have you started the correct EE JVM, or are you using an SE JVM, or are you "not really sure how the JVM is initialized"? If it is the latter, then we need to attack that problem first, before we spend any time diagnosing a classloader problem. Nimur (talk) 15:22, 5 April 2012 (UTC)[reply]
I am using Netbeans to compile this. I guess I'm "not sure which JVM is initialized" but i dont know how this could be J2SE, as i uninstalled that in favor of J2EE with JDK7.
The Java EE6 API library comes from C:\Program Files\NetBeans 7.0.1\enterprise\modules\ext.
Red alert! i somehow found a "Java Platform Manager" in netbeans and it seems that JDK 1.7 default is J2SE. The classes all come from C:\glassfish3\jdk7\jre\lib\ . So even though i installed J2EE, and glassfishi s the folder that it goes to, im running J2SE??? How do i fix this within netbeans? Surely J2EE came with J2EE components? o.0
Excellent. The first thing you really learn, when you migrate from SE to EE, is that you always have more than one version of Java on your machine. The second thing you usually learn is, you've probably been using the wrong version of Java to run your program. Glad to see it got fixed. Nimur (talk) 01:43, 6 April 2012 (UTC)[reply]
(ec) It is a custom error-page sent in response to an HTTP 404 error. Strictly, all we know is that the server reported that it couldn't find "sse.dll" - are you sure this file is present on the server? From context of the URL, I can infer a little bit more, but with less certainty. This appears to be your website; and it looks like you attempted to install a program in your common gateway interface directory to perform a US Census lookup. The program may actually be missing on the server, so the 404 may be correct. However, if the server permissions are incorrect, i.e. you cannot launch a DLL-based CGI tool, or if something else went wrong, the server may also report 404 when it should actually send HTTP 500 ("internal server error," or a similar more specific code). I have also formatted your link text; this will not affect any subsequent efforts to diagnose the issue, but makes the Reference Desk render it better. Nimur (talk) 15:11, 5 April 2012 (UTC)[reply]
Pruning the link a bit to http://www.kittybrewster.com/cgi-bin/ I get a HTTP 403 error, which is not unusual. However, it also says: «Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.» So the 404 Error on the original full link might perhaps be related in that you redirect 403 Errors and 500 Errors (internal server error) to the 404 error page? -Laniala (talk) 15:45, 5 April 2012 (UTC)[reply]
Hmm, so you're not wondering what the response from your server means or why you got that 404 error? But you are wondering what the text in the URL means or why you got that strange looking query? If that is the case it is trying to run ./cgi-bin/sse.dll (if there is no such file on your server then that is of course the reason for the 404 error).
If this dll has any security vulnerabilities I have no idea. But without knowing more of what your site is actually accepting of queries, then it could perhaps (wild guess) have been a random attempt at exploiting such a thing. I'm sure somebody else has more ideas (if this is actually what you're wondering). -Laniala (talk) 11:42, 6 April 2012 (UTC)[reply]
How do you know the page number for a book in the Kindle app for the iPad or Windows?
I want to be able to cite a book I bought on Kindle, but I can't seem to figure out what page number I'm on. It says I'm at location 1970 out of 6998. I need to know the page number. Anyone know? A Quest For Knowledge (talk) 15:36, 5 April 2012 (UTC)[reply]
Page numbers depend on edition. There is no reason why a dynamically reflowed e-book edition would even have a page number. I suggest you cite the edition and the given location. If our citation templates are insufficient, we should adapt them to reality, not the other way round. Reality is quite hard to bend, even if Steve Jobs or James Randi may give a different impression. --Stephan Schulz (talk) 15:43, 5 April 2012 (UTC)[reply]
At minimum, you should give a chapter/section name or number, if available. Some style guides (I think the MHRA) recommend you give a paragraph number (by counting paragraphs), but this may not be practical. One solution, which is non-standard but could be helpful, is to give the first few words of the paragraph ("Paragraph starting 'Foo bar baz'"). If it's a direct quote, someone can search the book, so you don't need to be so precise. I've no idea if location numbers are portable/consistent across devices, or between EPUB/Kindle/PDF versions, so it would be better not to rely on them. --Colapeninsula (talk) 09:08, 6 April 2012 (UTC)[reply]
Hello. From an IT point of view, is it possible to cast a secret ballot online? If voters login to confirm their eligibility, it is possible to match the ballot to the identity of the voter? Or do online voters just have to take a leap of faith in the website's privacy policy? Thanks in advance. --Mayfare (talk) 17:28, 5 April 2012 (UTC)[reply]
More basically, any "private key" encryption method can safely identify the sender of a value as paired with a public key you can store in your voting system's records. However, if you don't have a "trusted" entity that can tally your votes, then there is, of course, no practical way of securing the identities while aggregating the votes. It sounds like your situation is down to one of trust, and not of technical limitations. 162.111.235.36 (talk) 17:25, 9 April 2012 (UTC)[reply]
If anyone of Intel's Atom processors were ever to be used in a portable media player similar to an iPod Classic, iPod Nano, or iPod touch which on be used? I am thinking an E6xx (Tunnel Creek), maybe an E620. --Melab±1☎22:55, 5 April 2012 (UTC)[reply]
What's the actual question? Are you asking people to speculate? or are you asking for specific industry "insider knowledge"? It seems Atoms are more media box rather then portable media player which seem to be sewn up at the moment by [[ARM architecture] processors. Intel seems poised to enter the mobile market and their main hurdle does indeed seem to be power consumption, but price and performance are also factors. Here is a recent article about atom v arm. Vespine (talk) 01:37, 10 April 2012 (UTC)[reply]
I was asking for educated guesses—that's usually the kind of answer I think I receive. Sometimes a person who works with computers can synthesize an answer. --Melab±1☎20:42, 10 April 2012 (UTC)[reply]
Does this link work? It did as of March 24, when I discovered it. It was a new form for changing the name of your Facebook Brand Page. Today, once my boss at the museum gives me the go ahead? Not working. Is it just me? -- Zanimum (talk) 23:31, 5 April 2012 (UTC)[reply]
That link doesn't give me anything but a blank page. This page says that it's not possible to change the name of your business page if you have more than 100 likes. (Seems like an arbitrary number to me but it's their number) If you have more than 100 likes then you'll have to delete and recreate the page. Dismas|(talk)23:44, 5 April 2012 (UTC)[reply]