I am trying to send SMS from java web application using Twillo app. But I am getting the following error at Glassfish server 4.1.1   java.lang.NoClassDefFoundError:   org/apache/http/conn/HttpClientConnectionManager    at    Message message = Message.creator(new PhoneNumber(""),   I have added Twilio 7.41.2 jar in my netbeans ide library folder. But I       have not added any maven dependency in pom.xml as this is not maven enabled the project, is this the error due to missing maven dependency?     index.jsp    &lt;form action="sms" method="post"&gt;   &lt;input type ="submit"/&gt;   &lt;/form&gt;    Servlet sms.java    import com.twilio.Twilio;   import com.twilio.rest.api.v2010.account.Message;   import com.twilio.type.PhoneNumber;   import java.io.IOException;   import java.io.PrintWriter;   import javax.servlet.ServletException;   import javax.servlet.http.HttpServlet;   import javax.servlet.http.HttpServletRequest;   import javax.servlet.http.HttpServletResponse;    protected void doPost(HttpServletRequest request, HttpServletResponse    response) throws ServletException, IOException {   PrintWriter out = response.getWriter();    try{    final String ACCOUNT_SID = "myaccountsid";   final String AUTH_TOKEN = "my string authtoken";    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);    Message message = Message.creator(new PhoneNumber("recipient phone no"),   new PhoneNumber("recipient phone no"),"Hello This is Tom").create();    out.println(message.getSid());       processRequest(request, response);      }  catch(IOException | ServletException e){     }   }   Any help is much appreciated.
785
I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?
110820
I'm currently making a callout to a 3rd party vendor and I'm getting a huge response. What is currently messing me up is this section:   "MessageSeq":13,"Description":"config file: config-qa1.txt\"","MessageTS":"2014-02-17T14:46:58","MessageLevel":4,"IsSystemMessage":false   As you can see here, the portion at the end of the Description value is ended with backslash double quote. If I attempt to parse this via the JSONParser I get an exception. Does anyone have an recommendations on how to resolve this?  Exception Message:  System.JSONException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries at [line:1, column:3699]  Updated with sample Code   public class ResponseWrapper{     // fields from JSON to auto map     public Integer messageSeq;     public String Description;     public String messageTS;     public Integer messageLevel;     public Boolean isSystemMessage;     // parsing fields     private ResponseWrapper theResponse;     private JSONParser parser;      public void parse(String jsonString){         parser = JSON.createParser(jsonString);         parseJSON();     }      private void parseJSON(){            while (parser.nextToken() != null) {             if (parser.getCurrentToken() == JSONToken.START_OBJECT) {                 theResponse = (ResponseWrapper)parser.readValueAs(ResponseWrapper.class);                            }         }     } }  String responseString = '{"MessageSeq":13,"Description":"config file: config-qa1.txt\"","MessageTS":"2014-02-17T14:46:58","MessageLevel":4,"IsSystemMessage":false}'; system.debug('\n\nBEFORE\n' + responseString); ****Place code in here to test such as ReplaceALL*** ResponseWrapper parser = new ResponseWrapper(); parser.parse(responseString);
28359
I'm trying to build an Android test application integrated to the SalesForce platform. I have downloaded the SDK from , and imported it to my workspace. Everything works fine except my test app, even the  they have provided along with the SDK work without problem. As a first step, what I tried was to clone the basic features (just login as of now) from the RestExplorer app. The following are my important files.  public class Home extends Activity {  private PasscodeManager passcodeManager; private RestClient client; private TokenRevocationReceiver tokenRevocationReceiver;  RestClient getClient() {     return client; }  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);      passcodeManager = SalesforceSDKManager.getInstance().getPasscodeManager();     tokenRevocationReceiver = new TokenRevocationReceiver(this);     setContentView(R.layout.activity_home);  }  @Override  public void onResume() {     super.onResume();     registerReceiver(tokenRevocationReceiver, new IntentFilter(ClientManager.ACCESS_TOKEN_REVOKE_INTENT));           if (passcodeManager.onResume(this)) {   // Bring up passcode screen if needed         String accountType = SalesforceSDKManager.getInstance().getAccountType();   // Login options         new ClientManager(this, accountType, SalesforceSDKManager.getInstance().getLoginOptions(), SalesforceSDKManager.getInstance().shouldLogoutWhenTokenRevoked()).getRestClient(this, new RestClientCallback() {    // Get a rest client             @Override             public void authenticatedRestClient(RestClient client) {                 if (client == null) {                     SalesforceSDKManager.getInstance().logout(Home.this);                     return;                 }                 Home.this.client = client;                           }         });     } }  @Override protected void onPause() {     passcodeManager.onPause(this);     unregisterReceiver(tokenRevocationReceiver);     super.onPause(); } }   I have added the permissions as required  &lt;permission android:name="com.salesforce.samples.restexplorer.C2D_MESSAGE"     android:protectionLevel="signature" /&gt;  &lt;uses-permission android:name="com.salesforce.samples.restexplorer.C2D_MESSAGE" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.GET_ACCOUNTS"/&gt; &lt;uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/&gt; &lt;uses-permission android:name="android.permission.ACCOUNT_MANAGER"/&gt;   And extended the application object to give a call to init();  public class MyApp extends Application { @Override public void onCreate() {     super.onCreate();     SalesforceSDKManager.initNative(getApplicationContext(), new KeyImpl(), Home.class); } }   Now, I'm getting the error in my Android debug log. The log as I see is attached below. It keep the activity restarting till I forcefully kill the application.  11-08 15:56:23.883: I/ClientManager:getRestClient(9334): No account of type com.salesforce.androisdk found 11-08 15:56:23.898: W/AccMgrCallback:run(9334): android.accounts.AuthenticatorException: bind failure 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager.convertErrorToException(AccountManager.java:1726) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager.access$400(AccountManager.java:144) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.AccountManager$AmsTask$Response.onError(AccountManager.java:1572) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.accounts.IAccountManagerResponse$Stub.onTransact(IAccountManagerResponse.java:69) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at android.os.Binder.execTransact(Binder.java:388) 11-08 15:56:23.898: W/AccMgrCallback:run(9334):     at dalvik.system.NativeStart.run(Native Method)   Do anyone have any idea about this isse? It is such a basic app, I was not expecting anything unusual. Did I do anything wrong in my app?
123258
@RestResource(urlMapping='/Merchandise/*') global with sharing class MerchandiseManager {      @HttpGet     global static Merchandise__c getMerchandiseById() {         RestRequest req = RestContext.request;                 String merchId = req.requestURI.substring(                                   req.requestURI.lastIndexOf('/')+1);         Merchandise__c result =                         [SELECT Name,Description__c,Price__c,Total_Inventory__c                         FROM Merchandise__c                          WHERE Id = :merchId];         return result;     }      @HttpPost     global static String createMerchandise(String name,         String description, Decimal price, Double inventory) {         Merchandise__c m = new Merchandise__c(             Name=name,             Description__c=description,             Price__c=price,             Total_Inventory__c=inventory);         insert m;         return m.Id;     } }   i am trying to execute these from postman,    but throwing below error,how i can authenticate,please help urgent requirement.     {       "message": "Session expired or invalid",       "errorCode": "INVALID_SESSION_ID"   }
61815
I read the Java tutorials on Sun for JAR files, but I still can't find a solution for my problem. I need to use a class from a jar file called jtwitter.jar, I downloaded the file, and tried executing it (I found out yesterday that .jar files can be executed by double clicking on them) and Vista gave me an error saying "Failed to load Main-Class Manifest attribute from [path]/jtwitter.jar".  The guy who coded the .jar file wants me to import it, but where do I store the .jar file to import it in my code? I tried putting both the .jar file and my .java file in the same directory, didn't work.  The file I'm trying to work for is here:   I'm using JCreator LE.
61801
I'm new to Ubuntu, using 18.04 and trying to install Netbeans or Eclipse but neither of them works.  At first my java was version 10. Searching for solutions I found many suggestions to install version 8 so I installed that and changed my default java to 8, but I'm getting new errors.  Here is the error of eclipse which is in its configuration folder (after running eclipse from terminal, eclipse guided me there to see the error):  !SESSION Sat Jun 09 15:21:19 CEST 2018 ----------------------------------------- !ENTRY org.eclipse.equinox.launcher 4 0 2018-06-09 15:21:19.382 !MESSAGE Exception launching the Eclipse Platform: !STACK java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:626)     at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)     at org.eclipse.equinox.launcher.Main.run(Main.java:1438)     at org.eclipse.equinox.launcher.Main.main(Main.java:1414)   Netbeans doesn't even give error messages - it just can't load.  Again I searched to see what is wrong it seems these applications even need older versions of java but I can't find any older version. (java doesn't support them)  Can someone please help?
33241
I tried it and the errors are:  Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:472) at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:488) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1608) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) at java.desktop/java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:532) at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:613) at java.desktop/javax.swing.UIManager.getSystemLookAndFeelClassName(UIManager.java:660) at com.cburch.logisim.gui.start.Startup.parseArgs(Startup.java:250) at com.cburch.logisim.Main.main(Main.java:32)   The error seems to be...     Caused by: java.lang.ClassNotFoundException: org.GNOME.Accessibility.AtkWrapper       at  java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)       at   java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)       at java.base/java.lang.Class.forName0(Native Method)       at java.base/java.lang.Class.forName(Class.java:374)       at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:485)       ... 14 more     OUTPUT for  apt-cache policy logicsim logisim  logisim:   Installed: 2.7.1~dfsg-1   Candidate: 2.7.1~dfsg-1   Version table:  *** 2.7.1~dfsg-1 500         500 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages         500 http://in.archive.ubuntu.com/ubuntu bionic/universe i386 Packages         100 /var/lib/dpkg/status N: Unable to locate package logicsim   OUTPUT for update-java-alternatives -l  java-1.11.0-openjdk-amd64      1101       /usr/lib/jvm/java-1.11.0-openjdk-amd64 java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64
77222
I have a really simple Java class that effectively decorates a Map with input validation, with the obvious void set() and String get() methods.  I'd like to be able to effectively call those methods and handle return values and exceptions from outside the JVM, but still on the same machine Update: the caller I have in mind is not another JVM; thanks @Dave Ray  My implementation considerations are typical    performance ease of implementation and maintenance (simplicity?) reliability flexibility (i.e. can I call from a remote machine, etc.)   Is there a 'right way?' If not, what are my options, and what are the pro/cons for each?  (Stuff people have actually done and can provide real-life feedback on would be great!)
60274
I've inherited a web project (Servlets) which is currently build inside eclipse.  I want to add maven around it. But the project's source directory is not following the maven convention. Instead of being inside src/main/java, it's src/package/name/...  I don't want to change anything right now because they are working at full speed towards a milestone. Can I configure maven to accept src/ as the java source directory ? Thanks
97259
When I look at System Preferences > Java > Update, I see      Your system has the recommended version of Java.   Java 7 Update 79  From Terminal, java -version:     java version "1.7.0_71"   Java(TM) SE Runtime Environment (build 1.7.0_71-b14)   Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)  From Terminal, export:     JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home"  In addition to that, I also have the Java from Apple/Oracle installed as well (when first prompted to install when opening a Java-based app when there's no Java yet installed)   Questions:   Is Java 7 Update 79 == jdk1.7.0._71.jdk? Or are these separate? When running some thing with Java, there is always the following:      objc[63077]: Class JavaLaunchHelper is implemented in both   /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/bin/java   and   /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/libinstrument.dylib.   One of the two will be used. Which one is undefined.    I'd be more than willing starting from scratch had I understood the steps to do that properly (remove, re-install). If it matters, am running OS X 10.10.
101710
An existing integration from Salesforce to Oracle stopped working this morning. When I send an http request from Salesforce to an Oracle webservice, I get a message "System.CalloutException: Received fatal alert: bad_record_mac". This seems like a common Java related error related to SSL and there are some suggested fixes on the web. However, I do not find any reference to this error in the context of Salesforce.   Has anyone seen this error in Salesforce? What was the issue and how did you resolve this?
3374
While upgrading today, something caused my wireless network manager to disappear. Not even connecting via wired connection.  This error is being shown by files:  **(nm-applet:2716): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files   (nm-applet:2716): nm-applet-WARNING **: Error connecting to ModemManager: Error calling StartServiceByName for org.freedesktop.ModemManager1: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Cannot launch daemon, file not found or permissions invalid   (nm-applet:2716): nm-applet-WARNING **: Could not find ShellVersion property on org.gnome.Shell after 5 tries   (nm-applet:2716): nm-applet-WARNING **: Failed to register as an agent: (2) The name org.freedesktop.NetworkManager was not provided by any .service files    Is there a patch I can download through windows and send through to my ubuntu, or is it a case of having to reload everything? I tried running two versions back but still no internet access.
123721
When I try to run a simple Hello World program I keep getting a message saying Could not find the main class.   I found  which suggested that my CLASSPATH variable is messed up, but I couldn't find a way to fix it.  What am I doing wrong?
77150
I have a Journey which sends the Subscriber SMS messages, 2/4 journey entries (all unique subscribers) don't receive the SMS.  The error displayed in the SMS activity in my Journey History is the following:      Failed - Object reference not set to an instance of an object.   Can anyone advise what this means? If it was configuration surely all subscribers wouldn't receive the message? I can confirm all subscribers have a mobile number and they use the same format and country code. Not sure if it helps but the entry source is Salesforce Data Entry.  Edit:  There can be entries where the Subscriber record does not exist in the AllSubscribers list as they do not have email addresses attached (only mobile numbers) but my journey only contains SMS message activities, no email. I have checked and even on some Subscribers that do have AllSubscribers records suffer the same activity error.
47239
I am getting errors when attempting to 'Create' a custom "O2C_Alert__c" object with a SOAP request.  My request is:  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"&gt;    &lt;soapenv:Header&gt;       &lt;urn:SessionHeader xmlns:urn="urn:enterprise.soap.sforce.com"&gt;          &lt;urn:sessionId&gt;SESSION_ID&lt;/urn:sessionId&gt;       &lt;/urn:SessionHeader&gt;    &lt;/soapenv:Header&gt;    &lt;soapenv:Body&gt;       &lt;urn:create&gt;          &lt;!--Zero or more repetitions:--&gt;          &lt;urn1:sObjects&gt;             &lt;!--Zero or more repetitions:--&gt;             &lt;urn1:type&gt;O2C_Alert__c&lt;/urn1:type&gt;                 &lt;urn1:CreatedDate&gt;20151231&lt;/urn1:CreatedDate&gt;                 &lt;urn1:Alert_Code__c&gt;STD&lt;/urn1:Alert_Code__c&gt;                 &lt;urn1:Status__c&gt;New&lt;/urn1:Status__c&gt;                 &lt;urn1:Customer_Id__C&gt;0123456789&lt;/urn1:Customer_Id__C&gt;                 &lt;urn1:Name&gt;Kroger&lt;/urn1:Name&gt;                 &lt;urn1:Order_Id__c&gt;0123456789&lt;/urn1:Order_Id__c&gt;          &lt;/urn1:sObjects&gt;       &lt;/urn:create&gt;    &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt;   The response I am getting back is:  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;    &lt;soapenv:Body&gt;       &lt;soapenv:Fault&gt;          &lt;faultcode&gt;sf:INVALID_TYPE&lt;/faultcode&gt;          &lt;faultstring&gt;INVALID_TYPE: Must send a concrete entity type.&lt;/faultstring&gt;          &lt;detail&gt;             &lt;sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault"&gt;                &lt;sf:exceptionCode&gt;INVALID_TYPE&lt;/sf:exceptionCode&gt;                &lt;sf:exceptionMessage&gt;Must send a concrete entity type.&lt;/sf:exceptionMessage&gt;                &lt;sf:row&gt;-1&lt;/sf:row&gt;                &lt;sf:column&gt;-1&lt;/sf:column&gt;             &lt;/sf:InvalidSObjectFault&gt;          &lt;/detail&gt;       &lt;/soapenv:Fault&gt;    &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt;   Thanks for any and all help.
60323
My first post,pretty excited.I want to make a soap api call which insert multiple records. I am using 2 different salesforce instances. destination side  global with sharing class SoapDemo1 {    global class AccountWrapper    {       webservice string Name;       AccountWrapper(Account a)       {         this.Name=a.Name;       }    }     webservice static List&lt;Account&gt; CreateMultipleAccounts(List&lt;Account&gt; accs)    {        List&lt;Account&gt; FinalList=new List&lt;Account&gt;();         for(Account a:accs)        {           Account a1=new Account();           a1.Name=a.Name;            FinalList.add(a1);           }         if (FinalList.size() &gt; 0)        {           Database.Insert(FinalList);        }         return FinalList;     }     }   I generated the class wsdl file and also partner wsdl file  ****source side:**** I upload the class wsdl file generated from destination, when I parse no errors, but when I click Generated Apex code, it shows error as:     Unable to find complexType for   {}anyType    I changed anyType to string and again repeated the process but it shows error as:     Unable to find complexType for   {}JunctionIdListNames   Please help me out
92671
public class ExampleClass {       public static void publishCaseUpdateNotifications(List&lt;Case&gt; cases) {     List&lt;Case_Updated__e&gt; notifications = new List&lt;Case_Updated__e&gt;();     for (Case c: cases) {         notifications.add(new Case_Updated__e(             Case__c = (String)c.Id,             CreatedByName__c = UserInfo.getName(),             CaseNumber__c = c.CaseNumber         ));     }       List&lt;Database.SaveResult&gt; results = EventBus.publish(notifications);      for (Database.SaveResult result : results) {         if (!result.isSuccess()) {             for (Database.Error error : result.getErrors()) {                 System.debug('Error returned: ' +                     error.getStatusCode() +' - '+                     error.getMessage());             }         }       }      }    }   My Test Class: getting error   @isTest   public class ExampleTestClass {    @isTest   static void testClassforExample(){         Case testcase = new Case(Subject ='Test',);      list&lt;Case_Updated__e&gt; caseUpdate =      ExampleClass.publishCaseUpdateNotifications(testcase );       }      }   My Error is Method does not exist or incorrect signature: void publishCaseUpdateNotifications(Case) from the type ExampleTestClass   Please suggest me how to resolve this error.     trigger Cases on Case (after insert) { if(Trigger.isAfter) {     System.debug('I will be replaced shortly!'); }  }   Do we need test class for above trigger. Please suggest me too