• SebastianBraun
  • NEWBIE
  • 55 Points
  • Member since 2012

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies

Hi all,

I've been building an application in Eclipse which extracts data from salesforce and using an imported CSV file, updates and inserts records.  It works fine from within Eclipse and I'm happy it's ready for deployment, but I cannot get the application working if I try and run it from cmd.  I get this error:

 

Exception in thread "main" java.lang.NoClassDefFoundError: uploader/jar
Caused by: java.lang.ClassNotFoundException: uploader.jar
        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: uploader.jar.  Program will exit.

I've been all over google and tried every solution out there, but can't find why it won't work.  Here's the steps I'm using to build the jar and run it, please if anyone can show me where I'm going wrong, I'd be delighted!  I'm not a java programmer...

 

The project is called uploader as is the package, by the way

 

  1. Right click on project and click Export.  Choose "Jar file" and Next.
  2. Select my project as the resource and ensure .classpath and .project files are selected.  Choose to Export generated class files and resources, to Compress the contents of the JAR file, and choose the location for the Jar file to go, then hit Next.
  3. Choose to Export class files with compile errors, and warnings.  Choose to Save the description of this JAR in the workspace, and give the location as /uploader/jardesc.jardesc.  Hit Next.
  4. Choose to Generate the manifest file, Save the manifest in the workspace and Use the saved manifest in the generated JAR description file.
  5. Point the Main Class to the correct place by clicking Browse and choosing the only option that I'm given, which is uploader.Main, then click Finish.

If I now open the manifest file, I seethe following:

 

Manifest-Version: 1.0
Main-Class: uploader.Main

 So that looks correct to me.

 

However, if I open a command prompt, cd to the directory containing the jar file then say java uploader.jar, that's when I get the error above.

 

Can anyone see anything that looks wrong?  I can't get past this point!

 

 

EDIT:

more information, if I run with java -jar uploader.jar, I get this error instead:

 

Exception in thread "main" java.lang.NoClassDefFoundError: com/sforce/ws/Connect
ionException
Caused by: java.lang.ClassNotFoundException: com.sforce.ws.ConnectionException
        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: uploader.Main. Program will exit.

 Perhaps that can help pinpoint the problem?

Hi,

 

i'm looking for a way to get all groups where a given user is a member of.

 

Something like this:

 

/chatter/groups/me

/chatter/groups/userId

 

Thanks in advance,

 

Sebastian

Hi Everyone,

 

i have a little control device with android on it, which communicates with the Salesforce Rest API. Because i have no User-Interaction here i'm using grant_type password to authenticate my devices to salesforce. My problem now is, how to handle the session timeouts. In contrast to grant_type refresh-token i do not get a refresh-token.

 

https://help.salesforce.com/help/doc/en/remoteaccess_oauth_username_password_flow.htm

 

Therefore i'm not sure whats the best-practice to handle the timeout. Right now, i'm checking the respone and if its not 201 (created) and the message says invalid sessionid, i just login again. 

 

Thanks in advance

 

Sebastian

Hi,

 

my Example WS Methode is quite simple:

 

webService static String hello(FeedItem feedItem) 
    {
        insert feedItem;      
        return 'CREATED: '+feedItem.iD;
    }

 

My Problem is that the generated WSDL contains all Types, which are related to FeedItem, but i want to keep this interface generic. So i change the Method as follows:

 

 

webService static String hello(SObject feedItem) 
    {
        If (feedItem instanceof FeedItem) 
        {
            insert feedItem;    
            return 'CREATED: '+feedItem.Id;
        } 
        Else 
        {
            return 'Error';
        }
    }

 

Unfortunately the generated WSDL contains all SObject-Types. Is there any possibility to make this generic like the Partner-WSDL?

 

Greetings Sebastian

Hi Everyone,

 

is there a possibility to bookmark a FeedItem via the SOAP-API?

 

Thanks in advance

 

Sebastian

Hi,

 

im trying to join FeedItem and FeedCommt.

 

In normal SQL I would do it like this:

 

"Select f.Body, c.CommentBody from FeedItem f join FeedComment c on f.Id = c.FeedItemId"

 

Nothing seems to work, so i hope you guys can tell whats wrong with that SOQL-Query:

 

"SELECT CommentBody, FeedItem.Body FROM FeedComment"

 

Thanks in advance

 

Sebastian

Hello everyone,

 

does someone know if it is possible to extend or customize the chatter page/layout by adding own Visualforce components?

 

Thanks in advance

 

Sebastian

Hi everyone,

 

i'm just wondering if theres a possibility to add an Attachment to a FeedItem. According to the Documentation you can only attach files to:

 

• Account
• Asset
• Campaign
• Case
• Contact
• Contract
• Custom objects
• EmailMessage
• EmailTemplate
• Event
• Lead
• Opportunity
• Product2
• Solution
• Task

 

Thanks in advance :smileyhappy:

 

Sebastian

Hi,

 

i'm looking for a way to get all groups where a given user is a member of.

 

Something like this:

 

/chatter/groups/me

/chatter/groups/userId

 

Thanks in advance,

 

Sebastian

Hi Everyone,

 

is there a possibility to bookmark a FeedItem via the SOAP-API?

 

Thanks in advance

 

Sebastian

Following the excellent vid:  http://www.youtube.com/watch?v=tK2CiLb5vgc&feature=player_embedded

 

And these instructions for Java http://wiki.developerforce.com/page/Introduction_to_the_Force.com_Web_Services_Connector

 

I get this error...

 

C:\Documents and Settings\spollock\workspace>java -classpath wsc-18.jar com.sfor
ce.ws.tools.wsdlc enterprise.wsdl enterprise.jar
[WSC][wsdlc.run:311]Created temp dir: C:\DOCUME~1\spollock\LOCALS~1\Temp\wsdlc-t
emp-6823038187248261205-dir
Exception in thread "main" com.sforce.ws.wsdl.WsdlParseException: Parse error: e
nterprise.wsdl (The system cannot find the file specified)
at com.sforce.ws.wsdl.WsdlFactory.create(WsdlFactory.java:61)
at com.sforce.ws.tools.wsdlc.<init>(wsdlc.java:75)
at com.sforce.ws.tools.wsdlc.run(wsdlc.java:311)
at com.sforce.ws.tools.wsdlc.main(wsdlc.java:302)
Caused by: java.io.FileNotFoundException: enterprise.wsdl (The system cannot fin
d the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sforce.ws.wsdl.WsdlFactory.create(WsdlFactory.java:58)
... 3 more

 

What step did I miss?

Hi all,

I've been building an application in Eclipse which extracts data from salesforce and using an imported CSV file, updates and inserts records.  It works fine from within Eclipse and I'm happy it's ready for deployment, but I cannot get the application working if I try and run it from cmd.  I get this error:

 

Exception in thread "main" java.lang.NoClassDefFoundError: uploader/jar
Caused by: java.lang.ClassNotFoundException: uploader.jar
        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: uploader.jar.  Program will exit.

I've been all over google and tried every solution out there, but can't find why it won't work.  Here's the steps I'm using to build the jar and run it, please if anyone can show me where I'm going wrong, I'd be delighted!  I'm not a java programmer...

 

The project is called uploader as is the package, by the way

 

  1. Right click on project and click Export.  Choose "Jar file" and Next.
  2. Select my project as the resource and ensure .classpath and .project files are selected.  Choose to Export generated class files and resources, to Compress the contents of the JAR file, and choose the location for the Jar file to go, then hit Next.
  3. Choose to Export class files with compile errors, and warnings.  Choose to Save the description of this JAR in the workspace, and give the location as /uploader/jardesc.jardesc.  Hit Next.
  4. Choose to Generate the manifest file, Save the manifest in the workspace and Use the saved manifest in the generated JAR description file.
  5. Point the Main Class to the correct place by clicking Browse and choosing the only option that I'm given, which is uploader.Main, then click Finish.

If I now open the manifest file, I seethe following:

 

Manifest-Version: 1.0
Main-Class: uploader.Main

 So that looks correct to me.

 

However, if I open a command prompt, cd to the directory containing the jar file then say java uploader.jar, that's when I get the error above.

 

Can anyone see anything that looks wrong?  I can't get past this point!

 

 

EDIT:

more information, if I run with java -jar uploader.jar, I get this error instead:

 

Exception in thread "main" java.lang.NoClassDefFoundError: com/sforce/ws/Connect
ionException
Caused by: java.lang.ClassNotFoundException: com.sforce.ws.ConnectionException
        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: uploader.Main. Program will exit.

 Perhaps that can help pinpoint the problem?