Announcement Announcement Module
Collapse
No announcement yet.
Classes Not Found Exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Classes Not Found Exception

    Hey

    I am trying to run one of the "showcase" Sample program that comes Spring Social Module. I'm getting class not found exceptions, tried switching to different facebook and linkedin versions with no success.

    Class SocialConfig.java

    unable to find and import following classes:

    import org.springframework.social.facebook.web.Disconnect Controller;
    import org.springframework.social.linkedin.api.LinkedIn;


    I have the following module versions defined in pom file.

    <org.springframework.social.facebook-version>1.0.2.BUILD-SNAPSHOT</org.springframework.social.facebook-version>
    <org.springframework.social.linkedin-version>1.0.0.M3</org.springframework.social.linkedin-version>

    Note: Versions defined in sample pom file (see below) results in invalid pom file - red cross appears, only disappears when upgarded to above versions.

    <org.springframework.social.facebook-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.facebook-version>
    <org.springframework.social.linkedin-version>1.0.0.RC1</org.springframework.social.linkedin-version>

  • #2
    Can anyone spot anything wrong with this .pom file? It seems to have an error but wont indicate where - just red on file.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    	<groupId>org.springframework</groupId>
    	<artifactId>social</artifactId>
    	<name>SpringSocialExample</name>
    	<packaging>war</packaging>
    	<version>1.0.0-BUILD-SNAPSHOT</version>
    	<properties>
    		<java-version>1.6</java-version>
    		<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
    		<org.aspectj-version>1.6.9</org.aspectj-version>
    		<org.slf4j-version>1.5.10</org.slf4j-version>
    		<org.springframework.social-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social-version>
    		<org.springframework.social.facebook-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.facebook-version>
    		<org.springframework.social.twitter-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.twitter-version>
    		<org.springframework.social.linkedin-version>1.0.0.RC1</org.springframework.social.linkedin-version>
    		<org.springframework.security-version>3.1.0.RELEASE</org.springframework.security-version>
    	</properties>
    	<dependencies>
    		<!-- Spring -->
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-context</artifactId>
    			<version>${org.springframework-version}</version>
    			<exclusions>
    				<!-- Exclude Commons Logging in favor of SLF4j -->
    				<exclusion>
    					<groupId>commons-logging</groupId>
    					<artifactId>commons-logging</artifactId>
    				 </exclusion>
    			</exclusions>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-webmvc</artifactId>
    			<version>${org.springframework-version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-jdbc</artifactId>
    			<version>${org.springframework-version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework</groupId>
    			<artifactId>spring-tx</artifactId>
    			<version>${org.springframework-version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.security</groupId>
    			<artifactId>spring-security-web</artifactId>
    			<version>${org.springframework.security-version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.security</groupId>
    			<artifactId>spring-security-taglibs</artifactId>
    			<version>${org.springframework.security-version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.security</groupId>
    			<artifactId>spring-security-config</artifactId>
    			<version>${org.springframework.security-version}</version>
    		</dependency>		
    		<dependency>
    		    <groupId>org.springframework.social</groupId>
    		    <artifactId>spring-social-core</artifactId>
    	        <version>${org.springframework.social-version}</version>
    	    </dependency>
    	    <dependency>
    		    <groupId>org.springframework.social</groupId>
    		    <artifactId>spring-social-facebook</artifactId>
    	        <version>${org.springframework.social.facebook-version}</version>
    	    </dependency>
    		<dependency>
    		    <groupId>org.springframework.social</groupId>
    		    <artifactId>spring-social-facebook-web</artifactId>
    	        <version>${org.springframework.social.facebook-version}</version>
    	    </dependency>
    		<dependency>
    		    <groupId>org.springframework.social</groupId>
    		    <artifactId>spring-social-twitter</artifactId>
    	        <version>${org.springframework.social.twitter-version}</version>
    	    </dependency>
    		<dependency>
    		    <groupId>org.springframework.social</groupId>
    		    <artifactId>spring-social-linkedin</artifactId>
    	        <version>${org.springframework.social.linkedin-version}</version>
    	    </dependency>
    		<dependency>
    		    <groupId>org.springframework.social</groupId>
    		    <artifactId>spring-social-web</artifactId>
    	        <version>${org.springframework.social-version}</version>
    	    </dependency>
    				<!-- JSR 303 with Hibernate Validator -->
    		<dependency>
    			<groupId>javax.validation</groupId>
    			<artifactId>validation-api</artifactId>
    			<version>1.0.0.GA</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-validator</artifactId>
    			<version>4.1.0.Final</version>
    			</dependency>
    			<!-- CGLIB, only required and used for @Configuration usage -->
    		<dependency>
    			<groupId>cglib</groupId>
    			<artifactId>cglib-nodep</artifactId>
    			<version>2.2.2</version>
    		</dependency>
    		<!-- Apache Tiles -->
    		<dependency>
    			<groupId>org.apache.tiles</groupId>
    			<artifactId>tiles-jsp</artifactId>
    			<version>3.0.0</version>
    		</dependency>
    		<dependency>
    			<groupId>org.apache.tiles</groupId>
    			<artifactId>tiles-el</artifactId>
    			<version>3.0.0</version>
    		</dependency>
    				
    		<!-- AspectJ -->
    		<dependency>
    			<groupId>org.aspectj</groupId>
    			<artifactId>aspectjrt</artifactId>
    			<version>${org.aspectj-version}</version>
    		</dependency>	
    		
    		<!-- Logging -->
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>slf4j-api</artifactId>
    			<version>${org.slf4j-version}</version>
    		</dependency>
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>jcl-over-slf4j</artifactId>
    			<version>${org.slf4j-version}</version>
    			<scope>runtime</scope>
    		</dependency>
    		<dependency>
    			<groupId>org.slf4j</groupId>
    			<artifactId>slf4j-log4j12</artifactId>
    			<version>${org.slf4j-version}</version>
    			<scope>runtime</scope>
    		</dependency>
    		<dependency>
    			<groupId>log4j</groupId>
    			<artifactId>log4j</artifactId>
    			<version>1.2.15</version>
    			<exclusions>
    				<exclusion>
    					<groupId>javax.mail</groupId>
    					<artifactId>mail</artifactId>
    				</exclusion>
    				<exclusion>
    					<groupId>javax.jms</groupId>
    					<artifactId>jms</artifactId>
    				</exclusion>
    				<exclusion>
    					<groupId>com.sun.jdmk</groupId>
    					<artifactId>jmxtools</artifactId>
    				</exclusion>
    				<exclusion>
    					<groupId>com.sun.jmx</groupId>
    					<artifactId>jmxri</artifactId>
    				</exclusion>
    			</exclusions>
    			<scope>runtime</scope>
    		</dependency>
    
    		<!-- @Inject -->
    		<dependency>
    			<groupId>javax.inject</groupId>
    			<artifactId>javax.inject</artifactId>
    			<version>1</version>
    		</dependency>
    				
    		<!-- Servlet -->
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>servlet-api</artifactId>
    			<version>2.5</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>javax.servlet.jsp</groupId>
    			<artifactId>jsp-api</artifactId>
    			<version>2.1</version>
    			<scope>provided</scope>
    		</dependency>
    		<dependency>
    			<groupId>javax.servlet</groupId>
    			<artifactId>jstl</artifactId>
    			<version>1.2</version>
    		</dependency>
    		<!-- Test -->
    		<dependency>
    			<groupId>junit</groupId>
    			<artifactId>junit</artifactId>
    			<version>4.7</version>
    			<scope>test</scope>
    		</dependency>        
    	</dependencies>
    	<repositories>
    		<repository>
    			<id>org.springframework.maven.release</id>
    			<name>Spring Maven Release Repository</name>
    			<url>http://repo.springsource.org/release</url>
    			<releases><enabled>true</enabled></releases>
    			<snapshots><enabled>false</enabled></snapshots>
    		</repository>
    		<!-- For testing against latest Spring snapshots -->
    		<repository>
    			<id>org.springframework.maven.snapshot</id>
    			<name>Spring Maven Snapshot Repository</name>
    			<url>http://repo.springsource.org/snapshot</url>
    			<releases><enabled>false</enabled></releases>
    			<snapshots><enabled>true</enabled></snapshots>
    		</repository>
    		<!-- For developing against latest Spring milestones -->
    		<repository>
    			<id>org.springframework.maven.milestone</id>
    			<name>Spring Maven Milestone Repository</name>
    			<url>http://repo.springsource.org/milestone</url>
    			<snapshots><enabled>false</enabled></snapshots>
    		</repository>
    	</repositories>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.9</version>
                    <configuration>
                        <additionalProjectnatures>
                            <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                        </additionalProjectnatures>
                        <additionalBuildcommands>
                            <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                        </additionalBuildcommands>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <compilerArgument>-Xlint:all</compilerArgument>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.2.1</version>
                    <configuration>
                        <mainClass>org.test.int1.Main</mainClass>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>

    Comment


    • #3
      Problem was to do with the war file. The name should match with sample .pom file

      <modelVersion>4.0.0</modelVersion>
      <groupId>org.springframework.social.samples</groupId>
      <artifactId>spring-social-showcase</artifactId>
      <name>Spring Social Showcase</name>
      <packaging>war</packaging>
      <version>1.0.0</version>

      Comment


      • #4
        Glad you figured it out. Looking at the times on your posts, it seems you've encountered the same phenomenon that I often encounter: That is, you find the answer yourself within minutes of asking someone else to help you find your problem. I'm not sure why this happens, but I do it all of the time. Either way, at least the problem gets solved!

        Comment

        Working...
        X