Search Results

Search found 45671 results on 1827 pages for 'facebook java api'.

Page 118/1827 | < Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >

  • What web server should I use if I want to run Java code behind it?

    - by Boaz
    At the moment, I have lot's of Java which does all kind of nifty stuff and I'm happy with it. The code is command line driven which have been great so far, but I recently decided I want to make the functionality available through web-services. Since my is complex and I'm happy with the way it's written , I don't want go through the pain of porting it to other languages. So I set out on a google journey to find out what web servers exist (on a Linux machine, though it's interesting to hear the answer without that limitation). From what I could find, it seems that there are two viable options: Apache Tomcat and Sun Java Server. What are the reason to choose one on top of the other? what are the strength of each and what are the weaknesses? Or, perhaps, there is a third one which is much easier, flexible and less cumbersome. Anyone?

    Read the article

  • regarding java version 1.3 to 1.4

    - by girinie
    Hi I am using java version as **java version "1.3.1_01" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01) Java HotSpot(TM) Client VM (build 1.3.1_01, mixed m**ode) But I have written an application. I am getting run time error as Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/CharSequence AS CharSequence is since 1.4 How can I come out of this problem? Can anybody help me with this? Thanks

    Read the article

  • Unmodifiable NavigableSet/NavigableMap in Java?

    - by Greg Mattes
    java.util.Collections has several unmodifiable methods that provide unmodifiable collection views by wrapping collections in decorators that prohibit mutation operations. Java 6 added support for java.util.NavigableSet and java.util.NavigableMap. I'd like to be able to have unmodifiable NavigableSets and NavigableMaps, but java.util.Collections#unmodifiableSortedSet(SortedSet) and java.util.Collections#unmodifiableSortedMap(SortedMap) are not sufficient because they do not support the operations that are particular to NavigableSet and NavigableMap. Are there de-facto implementations for unmodifiableNavigableSet and unmodifiableNavigableMap?

    Read the article

  • Using Api to submit userdata to external party

    - by Younes
    I have to submit subscription data to another website. I have got documentation on how to use this API however i'm not 100% sure of how to set this up. I do have all the information needed, like username / passwords etc. This is the API documentation: https://www.apiemail.net/api/documentation/?SID=4 How would my request / post / whatever look like in C# .net (vs 2008) when i'm trying to acces this API? This is what i have now, I think i'm not on the right track: public static string GArequestResponseHelper(string url, string token, string username, string password) { HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url); myRequest.Headers.Add("Username: " + username); myRequest.Headers.Add("Password: " + password); HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); Stream responseBody = myResponse.GetResponseStream(); Encoding encode = System.Text.Encoding.GetEncoding("utf-8"); StreamReader readStream = new StreamReader(responseBody, encode); //return string itself (easier to work with) return readStream.ReadToEnd();

    Read the article

  • auth.getSession not working

    - by dC
    hi all, i am having troubles with calling auth.getSession in my proxy. It is being called from a iPhone connect client. When the proxy URL is invocated from the iphone, FB returns a 100 invalid parameter error to the proxy. However the 2nd attempt from iPhone yields success. Both times the proxy is doing the same code, only the auth_token is different. Doing a good search, shows that this is a problematic method. I have tried everything in code and even called in a iPhone expert to see if the problem is on the iPhone client. I have concentrated my efforts on the java api being the problem, however i believe the problem lies else where. I have done the following checked and tested java code checked and test iphone code checked FB application settings. any help is most appreciated. ------Here is my java code.--------- String api_secret = FacebookProperty.getString(FacebookConstants.PROPERTY_API_SECRET); String api_key = FacebookProperty.getString(FacebookConstants.PROPERTY_API_KEY); String call_back_url = FacebookProperty.getString(FacebookConstants.PROPERTY_CALLBACK_URL); int connectTimeout = 200000; //use the xml helper // Make sure the user is logged in to Facebook String authToken = request.getParameter("auth_token"); log.info( "FACEBOOK: auth_token?: " + authToken ); Map<String, Object> model = new HashMap<String, Object>(); model.put(FacebookConstants.MODEL_WELCOME_SELECTED, true); FacebookXmlRestClient facebookRestClient = new FacebookXmlRestClient(api_key, api_secret); boolean generateSessionSecret = true; //always true of connect client try{ facebookRestClient.setConnectTimeout(connectTimeout ); String authSessionKey = facebookRestClient.auth_getSession(authToken, true); } catch (Exception e) { log.log( Level.SEVERE, e.toString()); log.log( Level.SEVERE, e.getMessage()); } String rawResponse = facebookRestClient.getRawResponse(); log.info( rawResponse ); -------the iphone code is ----------- session = [FBSession sessionForApplication:myApiKey getSessionProxy:myURL delegate:self]; -----------the error is -------------- <error_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:// api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd"> <error_code>100</error_code> <error_msg>Invalid parameter</error_msg> <request_args list="true"> <arg> <key>api_key</key> <value>bf22a0512c8558a1656d73160507460b</value> </arg> <arg> <key>auth_token</key> <value>fcd1e597aca5c9ba43875cdd01221be5</value> </arg> <arg> <key>call_id</key> <value>1269066988055</value> </arg> <arg> <key>format</key> <value>xml</value> </arg> <arg> <key>generate_session_secret</key> <value>true</value> </arg> <arg> <key>method</key> <value>facebook.auth.getSession</value> </arg> <arg> <key>sig</key> <value>e9f477fd72adf74cd2de72528fd9aa72</value> </arg> <arg> <key>v</key> <value>1.0</value> </arg> </request_args> </error_response>

    Read the article

  • Using the Google AJAX Search API for SEO Purposes

    - by User
    I am looking at writing a .net application that uses the Google AJAX Search API to determine where our website falls for a given term compared to a competitor. I can find alot about the old SOAP API however for the new AJAX api I cannot find any information on the following: Is this sort of use allowed as the Terms of use are vague Is there a limit to the number of requests per day As you can only get a max of 8 results at a time, is the only way to get the top 100 results to keep requesting the next set and is this an issue? Thanks

    Read the article

  • which java version does tomcat use

    - by Raghul
    I have set the JAVA_HOME to C:\Program Files\Java\jdk1.5.0_11 I have set the Classpath to C:\Program Files\Java\jre1.5.0_11 I have set the path to C:\Ruby193\bin;C:\XEClient\bin; F:\oracle\product\10.2.0\db_2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\Program Files\Java\jdk1.6.0_17\bin; C:\Program Files\jEdit;C:\Program Files\TortoiseSVN\bin; C:\Program Files\Microsoft SQL Server\90\Tools\binn\ Now my question is, what version of java does the tomcat run on? The tomcat console writes the whole 'path' and the cmd says it is java version 7 currently running in the system. Someone please help me out.. I have java 5,6,7 versions installed in my system and also tomcat 5,6,7. Now what is the tomcat's java version and the system's java version???

    Read the article

  • Authentication and authorization for RESTfull API (java jersery)

    - by abovesun
    Hi, implementing service something similar with tinyurl or bit.ly, I'm would like to expose service as API, I'm using java and jersey as RESTfull service implementation. I'm looking for simplest way for authentification of users who use API, OAuth is first thing coming in mind, but the problem is I don't need this 3 iteration calls with request token query, than access token query with callback url passing. I just need to give user ability to invoke api with no additional security calls to my server.

    Read the article

  • Java preferences API throughput

    - by Domchi
    I'm using Java Preferences API to store window position and size of Swing application. At this moment, I'm listening to window resize/reposition events and storing the position and size every time they change. However, that means that if user slowly resizes window which is 200px wide to 400px wide, I'll probably write new window size about 200 times during pretty short time. Preferences API uses whichever datastore is available on the host system (windows registry for Windows etc.) - but the question is, what are limitations or best practices for properties API? Is it OK, or would it be smart to write only when user has finished resizing? Anyone had experiences with Properties API on different platforms?

    Read the article

  • java.awt.HeadlessException thrown from HeadlessGraphicsEnvironment.getDefaultScreenDevice

    - by Omry
    I need to do some image processing on a java server (Debian with java version "1.6.0_12"), and I am receiving java.awt.HeadlessException from my code: java.awt.HeadlessException at sun.java2d.HeadlessGraphicsEnvironment.getDefaultScreenDevice(HeadlessGraphicsEnvironment.java:64) at WaxOn.getDefaultConfiguration(WaxOn.java:341) Even when java.awt.headless is set to true (as evident by this code printing so): if (!java.awt.GraphicsEnvironment.isHeadless()) { logger.warn("Headless mode is not enabled"); } else { logger.info("Headless mode"); } This is the code that throws the exception: public static GraphicsConfiguration getDefaultConfiguration() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); return gd.getDefaultConfiguration(); } Any idea how to solve this?

    Read the article

  • How to use SQLite3 with Java

    - by Bruce
    I am trying to build a simple java program which creates a db file, then a table and inserts dummy values in the table. I found this page http://www.zentus.com/sqlitejdbc/index.html and tried out the example given on the page but I am getting the following error - Exception in thread "main" java.lang.NoClassDefFoundError: Test Caused by: java.lang.ClassNotFoundException: Test at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: Test. Program will exit.

    Read the article

  • Running Java plugin 1.5 on Firefox + Snow Leopard

    - by Sam
    I have a Java applet that needs to be able to run on Java 1.5. I have successfully installed Java 1.5 on Snow Leopard and I am able to use it to run applets in Safari by changing the order of the versions in Java Preferences. However, Firefox (3.5.9) doesn't seem to be able to pick up the changes and keeps reverting to using the Java 1.6 plugin. How do I force Firefox to use the Java 1.5 plugin? I tried re-linking the /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK folder to point to my 1.5 directory, but that seems to change the system-level Java runtime, not the Firefox plugin (it opened up the console differently, but inside the console it reported Java plugin 1.6.0).

    Read the article

  • REST API - why use PUT DELETE POST GET?

    - by Andre
    So -i was looking through some articles on creating REST API's. And some of them suggest using all types of HTTP requests: like PUT DELETE POST GET. So - we would create for example index.php and write API this way: $method = $_SERVER['REQUEST_METHOD']; $request = split("/", substr(@$_SERVER['PATH_INFO'], 1)); switch ($method) { case 'PUT': ....some put action.... break; case 'POST': ....some post action.... break; case 'GET': ....some get action.... break; case 'DELETE': ....some delete action.... break; } Ok - granted - I don't know much baout web services (yet). But - wouldn't it be easier to just accept JSON object through normal $_POST and then respond in JSON as well. We can easily serialize/deserialize via php's json_encode and json_decode and do whatever we want with that data without having to deal with different HTTP request methods... Am I missing something? UPDATE 1: Ok - after digging through various API's and learning a lot about XML-RPC, JSON-RPC, SOAP, REST I came to a conclusion that this type of API is sound. Actually stack exchange is pretty much using this approach on their sites and I do think that these people know what they are doing Stack Exchange API.

    Read the article

  • Why can't untrusted code change the log level under Java Logging?

    - by cdmckay
    I'm have a Java app that also runs as an applet. The app also happens to use a library called BasicPlayer to play .ogg files. BasicPlayer has a built-in logger that uses Apache Logging Commons to create a logger for BasicPlayer.class using the built-in Java logger. The only way that I know about to turn off the BasicPlayer logging is to run this code: Logger.getLogger(BasicPlayer.class.getName()).setLevel(Level.OFF); This works fine when running as a regular app. However, when running as an applet, this code will throw a SecurityException because for some reason applets can't change the log level of non-anonymous loggers (see here for a sorta-explanation). Why would they do this? Who cares if an applet changes the log level?

    Read the article

  • are custom classes imported API included in .class files?

    - by kyrogue
    i have a question, i have a custom class which imports java.sql.; and i am creating a jsp page, in the jsp page, i did a page import of the custom class , however when i tried to call my custom class database methods it cant work. only when i did a page import of java.sql. did it work. so are custom classes imported API included in .class files? An error occurred at line: 6 in the jsp file: /resetpw.jsp Statement cannot be resolved to a type 3: 4: <% 5: db.connect(); 6: Statement stmt = db.getConnection().createStatement(); 7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts"); 8: 9: An error occurred at line: 7 in the jsp file: /resetpw.jsp ResultSet cannot be resolved to a type 4: <% 5: db.connect(); 6: Statement stmt = db.getConnection().createStatement(); 7: ResultSet rs = stmt.executeQuery("SELECT * FROM created_accounts"); 8: 9: 10: Stacktrace: org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:319) org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.31 logs. edited. added what error will come up if i did not do a page import of java.sql.*;

    Read the article

  • Java: ResultSet exception - before start of result set

    - by Rosarch
    I'm having trouble getting data from a ResultSet object. Here is my code: String sql = "SELECT type FROM node WHERE nid = ?"; PreparedStatement prep = conn.prepareStatement(sql); int meetNID = Integer.parseInt(node.get(BoutField.field_meet_nid)); prep.setInt(1, meetNID); ResultSet result = prep.executeQuery(); result.beforeFirst(); String foundType = result.getString(1); if (! foundType.equals("meet")) { throw new IllegalArgumentException(String.format("Node %d must be of type 'meet', but was %s", meetNID, foundType)); } The error trace: Exception in thread "main" java.sql.SQLException: Before start of result set at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:986) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:981) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:841) at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5656) at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5576) at nth.cumf3.nodeImport.Validator.validate(Validator.java:43) at nth.cumf3.nodeImport.Main.main(Main.java:38) What am I doing wrong here?

    Read the article

  • 'Locale' configuration and its relationship with Windows API

    - by The Kaykay
    Can the locale configuration of a system OR the keyboard type configuration of that system in anyway affect which API is called at the Kernel level? To be specific, if a program is invoking 'CreateFile()' API then the windows API documentation says that the call gets delegated to either CreateFileA or CreateFileW. If that program is being run on a system present in China with a Chinese Keyboard then which of the two functions will be called?

    Read the article

  • Change default java installation

    - by user1501700
    I have many Java versions installed on a Windows 7 machine. Some of them are 32 bits, some are 64 bits. Now as default it starts one of those last versions (1.7 64 bits). How do I tell my Windows 7 machine to use another version of Java? One of the reasons is that I'm developing a JNI project from Microsoft Visual Studio C++ - it uses also java 1.7 64 bits. Best regards, Andrej I have set: User variable: JAVA_HOME=C:\j2sdk1.4.2_04 PATH=%JAVA_HOME%\bin;%PATH% and system variable: JAVA_HOME=C:\j2sdk1.4.2_04 PATH=...a_lot_of_paths...;%JAVA_HOME%\bin;%PATH% I had no idea which is better to set - for user or system settings. Done both. System restart. And...it didn't helped :( When I run "java -version" from cmd i have java 1.7, but not java 1.4 like defined in PATH. after run C:where java I got two results: C:\Windows\System32\java.exe C:\j2sdk1.4.2_04\bin\java.exe Who let Java go to my windows directory ???!!! How to deal with that?

    Read the article

  • How to point to jdni.properties file to set properties in Java

    - by prosseek
    I can use System.getProperties() method to set properties in Java. System.getProperties().put("java.naming.factory.initial", "fr.dyade.aaa.jndi2.client.NamingContextFactory"); System.getProperties().put("java.naming.factory.host", "localhost"); System.getProperties().put("java.naming.factory.port", "16400"); How can I get the same effect by reading the properties stored in a file? When I have a jdni.properties with the following content: java.naming.factory.initial fr.dyade.aaa.jndi2.client.NamingContextFactory java.naming.factory.host localhost java.naming.factory.port 16400 How can I teach Java to read them as properties?

    Read the article

  • How to determine Windows Java installation location

    - by Lance May
    I'm trying to dynamically run a .jar from a C# assembly (using Process.Start(info)). Now, from a console application I am able to just run: ProcessStartInfo info = new ProcessStartInfo("java", "-jar somerandom.jar"); In an assembly, however, I keep getting a Win32Exception of "The system cannot find the file specified" and have to change the line to the full path of Java like so: ProcessStartInfo info = new ProcessStartInfo("C:\\Program Files\\Java\\jre6\\bin\\java.exe", "-jar somerandom.jar"); This obviously won't do. I need a way to dynamically (but declaratively) determine the installed location of Java. I started thinking of looking to the registry, but when I go there I noticed that there were specific keys for the versions and that they could not even be guaranteed to be numeric (e.g. "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6" and "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.6.0_20"). What would be the most reliable "long-haul" solution to finding the most up-to-date java.exe path from a C# application? Thanks much in advance.

    Read the article

  • Use of ebay API

    - by Hab
    I am given a task to R& D ebay api. As i have tried to explore on net i still have no clear idea that how and why to use it in my apps. Also are there many ebay api's for different purposes? Any sample code available using this api in objective c for iPhone. Any doc available providing general info about it.

    Read the article

  • Java programming accessing object variables

    - by Haxed
    Helo, there are 3 files, CustomerClient.java, CustomerServer.java and Customer.java PROBLEM: In the CustomerServer.java file, i get an error when I compile the CustomerServer.java at line : System.out.println(a[k].getName()); ERROR: init: deps-jar: Compiling 1 source file to C:\Documents and Settings\TLNA\My Documents\NetBeansProjects\Server\build\classes C:\Documents and Settings\TLNA\My Documents\NetBeansProjects\Server\src\CustomerServer.java:44: cannot find symbol symbol : method getName() location: class Customer System.out.println(a[k].getName()); 1 error BUILD FAILED (total time: 0 seconds) CustomerClient.java import java.io.*; import java.net.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; public class CustomerClient extends JApplet { private JTextField jtfName = new JTextField(32); private JTextField jtfSeatNo = new JTextField(32); // Button for sending a student to the server private JButton jbtRegister = new JButton("Register to the Server"); // Indicate if it runs as application private boolean isStandAlone = false; // Host name or ip String host = "localhost"; public void init() { JPanel p1 = new JPanel(); p1.setLayout(new GridLayout(2, 1)); p1.add(new JLabel("Name")); p1.add(jtfName); p1.add(new JLabel("Seat No.")); p1.add(jtfSeatNo); add(p1, BorderLayout.CENTER); add(jbtRegister, BorderLayout.SOUTH); // Register listener jbtRegister.addActionListener(new ButtonListener()); // Find the IP address of the Web server if (!isStandAlone) { host = getCodeBase().getHost(); } } /** Handle button action */ private class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { try { // Establish connection with the server Socket socket = new Socket(host, 8000); // Create an output stream to the server ObjectOutputStream toServer = new ObjectOutputStream(socket.getOutputStream()); // Get text field String name = jtfName.getText().trim(); String seatNo = jtfSeatNo.getText().trim(); // Create a Student object and send to the server Customer s = new Customer(name, seatNo); toServer.writeObject(s); } catch (IOException ex) { System.err.println(ex); } } } /** Run the applet as an application */ public static void main(String[] args) { // Create a frame JFrame frame = new JFrame("Register Student Client"); // Create an instance of the applet CustomerClient applet = new CustomerClient(); applet.isStandAlone = true; // Get host if (args.length == 1) { applet.host = args[0]; // Add the applet instance to the frame } frame.add(applet, BorderLayout.CENTER); // Invoke init() and start() applet.init(); applet.start(); // Display the frame frame.pack(); frame.setVisible(true); } } CustomerServer.java import java.io.*; import java.net.*; public class CustomerServer { private String name; private int i; private ObjectOutputStream outputToFile; private ObjectInputStream inputFromClient; public static void main(String[] args) { new CustomerServer(); } public CustomerServer() { Customer[] a = new Customer[30]; try { // Create a server socket ServerSocket serverSocket = new ServerSocket(8000); System.out.println("Server started "); // Create an object ouput stream outputToFile = new ObjectOutputStream( new FileOutputStream("student.dat", true)); while (true) { // Listen for a new connection request Socket socket = serverSocket.accept(); // Create an input stream from the socket inputFromClient = new ObjectInputStream(socket.getInputStream()); // Read from input //Object object = inputFromClient.readObject(); for (int k = 0; k <= 2; k++) { if (a[k] == null) { a[k] = (Customer) inputFromClient.readObject(); // Write to the file outputToFile.writeObject(a[k]); //System.out.println("A new student object is stored"); System.out.println(a[k].getName()); break; } if (k == 2) { //fully booked outputToFile.writeObject("All seats are booked"); break; } } } } catch (ClassNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { try { inputFromClient.close(); outputToFile.close(); } catch (Exception ex) { ex.printStackTrace(); } } } } Customer.java public class Customer implements java.io.Serializable { private String name; private String seatno; public Customer(String name, String seatno) { this.name = name; this.seatno = seatno; } public String getName() { return name; } public String getSeatNo() { return seatno; } }

    Read the article

< Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >