Announcement Announcement Module
Collapse
No announcement yet.
Deploying Spring Integration Jar on Unix Box Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deploying Spring Integration Jar on Unix Box

    Hi Team,
    I'm looking to deploy a Spring Integration application created Jar onto Unix Box.
    Facing issues while trying to refer the dependency Jar location to run the jar.

    I was able to run the jar with the below configurartion in the Pom file.
    The below approach the jars location becomes hard coded. The place where the script runs it needs to have the directory /dependency-jars/ , else the jar will throw an exception -
    Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/support/ClassPathXmlApplicationContext
    at com.hcl.jdbc.poller.main.method.JdbcPollerMainAppS erver.main(JdbcPollerMainAppServer.java:10)
    The apllication is not able to refer to the spring context jar.

    How can i configure the pom such that it picks up the location set through the script?


    Script Details -


    Code:
    #!/usr/bin/ksh -x 
    
    export JAVA_HOME=/usr/project/ls2intf/jdk1.5.0_07 
    
    for  file in /usr/project/ls2intf/bin/dependency-jars/*.jar ; do 
        CLASSPATH=$CLASSPATH:$file 
    done 
    
    $JAVA_HOME/bin/java -jar /usr/project/ls2intf/bin/Jdbc-Poller-1.0.0-SNAPSHOT.jar
    The common lib location that i want to pass is -
    /usr/project/ls2intf/lib/ls2lib/common/spring/dependency-jars/*.jarPom file Config-


    Code:
    <build> 
                    <plugins> 
                            <plugin> 
                                    <groupId>org.apache.maven.plugins</groupId> 
                                    <artifactId>maven-compiler-plugin</artifactId> 
                                    <version>2.3.2</version> 
                                    <configuration> 
                                            <source>${jdk.version}</source> 
                                            <target>${jdk.version}</target> 
                                    </configuration> 
                            </plugin> 
    
                            <plugin> 
                                    <groupId>org.apache.maven.plugins</groupId> 
                                    <artifactId>maven-jar-plugin</artifactId> 
                                    <version>2.4</version> 
                                    <configuration> 
                                            <archive> 
                                                    <manifest> 
                                                            <addClasspath>true</addClasspath> 
                                                            <mainClass>com.hcl.jdbc.poller.main.method.JdbcPollerMainAppServer</mainClass> 
                                                            <classpathPrefix>dependency-jars/</classpathPrefix> 
                                                    </manifest> 
    
                                            </archive> 
                                    </configuration> 
                            </plugin> 
    
                            <plugin> 
                                    <groupId>org.apache.maven.plugins</groupId> 
                                    <artifactId>maven-dependency-plugin</artifactId> 
                                    <version>2.5.1</version> 
                                    <executions> 
                                            <execution> 
                                                    <id>copy-dependencies</id> 
                                                    <phase>package</phase> 
                                                    <goals> 
                                                            <goal>copy-dependencies</goal> 
                                                    </goals> 
                                                    <configuration> 
                                                            <includeGroupIds>javax.mail,log4j,junit,org.springframework,org.springframework.integration,dbJMS,dbNaming,dbUtils,javax.jms,tibjms,com.ibm,commons-dbcp,commons-logging,commons-pool,aopalliance</includeGroupIds> 
                                                            <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory> 
                                                    </configuration> 
                                            </execution> 
                                    </executions> 
                            </plugin> 
    
                    </plugins> 
    
                    <pluginManagement> 
                            <plugins> 
                                    <plugin> 
                                            <groupId>org.eclipse.m2e</groupId> 
                                            <artifactId>lifecycle-mapping</artifactId> 
                                            <version>1.0.0</version> 
                                            <configuration> 
                                                    <lifecycleMappingMetadata> 
                                                            <pluginExecutions> 
                                                                    <pluginExecution> 
                                                                            <pluginExecutionFilter> 
                                                                                    <groupId>org.apache.maven.plugins</groupId> 
                                                                                    <artifactId>maven-dependency-plugin</artifactId> 
                                                                                    <versionRange>[2.0,)</versionRange> 
                                                                                    <goals> 
                                                                                            <goal>copy-dependencies</goal> 
                                                                                    </goals> 
                                                                            </pluginExecutionFilter> 
                                                                            <action> 
                                                                                    <execute /> 
                                                                            </action> 
                                                                    </pluginExecution> 
                                                            </pluginExecutions> 
                                                    </lifecycleMappingMetadata> 
                                            </configuration> 
                                    </plugin> 
                            </plugins> 
                    </pluginManagement> 
    
            </build>

  • #2
    Hi Folks, Anybody faced the same issue?
    Appreciate if somebody could direct me in the right direction.

    Comment

    Working...
    X