PDA

View Full Version : plz help



shamuat
Mar 17th, 2008, 07:34 AM
hi

Can u help to start spring batch first application. I am a newbie. I dont know how the folder path would for my sample. I ran samples. Can u give me simple steps to create sample. I have seen helloworld sample docs but it doesnt looks helpful. I would be grateful to you

Thanks in advance.

lucasward
Mar 17th, 2008, 10:24 AM
I dont know how the folder path would for my sample.

I'm a little confused by this question. What kind of folder path? If you wanted to reuse the current samples project, you could just create a new application context for your job in src/main/resources/jobs/, copying an existing sample jobs configuration for a starting point. From there you would only need a simple Junit test case to launch.

shamuat
Mar 17th, 2008, 10:35 PM
Sorry I mean folder structure(src/main/java, src/main/resource ... ). I dont know how to start own sample. While compiling JAVA files compiler is not recognizing interfaces( like ItemReader, Tasklet etc) and classes. Should I do anything here?

Thanks in advance.

lucasward
Mar 17th, 2008, 10:55 PM
We use the maven standard directory layout:

http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

It seems like it would be hard to create a file in eclipse outside of a source directory though. It sounds like there is some kind of classpath issue if ItemReader isn't being recognizes, how have you set up your projects?

shamuat
Mar 17th, 2008, 11:01 PM
I am doing in notepad so I have planned to import that to eclipse. Can I do like that?

shamuat
Mar 18th, 2008, 05:31 AM
Hi

I want to run only trade job from samples. I am doing this on eclipse. I created the directory path for that. I am picking up the trade specific files and including them to this new sample proj. Now here how should I import Referenced Libraries. :confused:... Please help me. I am new to this thing. But I should learn all this at earliest. I dont know How could I manage?

robert.kasanicky
Mar 18th, 2008, 05:44 AM
you can run "mvn eclipse:eclipse" and let maven generate the eclipse project for you. Or you can use one of the available eclipse maven plugins to setup the classpath

shamuat
Mar 18th, 2008, 05:47 AM
Thanks

So should I compile all JAVA files(Tasklet, Advice etc., etc., ).

shamuat
Mar 18th, 2008, 05:59 AM
how should I start my project I have copied every java files and xml files related to trade sample to my folder then while I am running using mvn test command.

[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionExcep tion: The plugin 'org.apache.m
aven.plugins:maven-resources-plugin' does not exist or no valid version could be
found
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.verifyPlugin(Defa
ultLifecycleExecutor.java:1286)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.getMojoDescriptor
(DefaultLifecycleExecutor.java:1522)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.bindLifecycleForP
ackaging(DefaultLifecycleExecutor.java:1016)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.constructLifecycl
eMappings(DefaultLifecycleExecutor.java:980)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoal(Defau
ltLifecycleExecutor.java:458)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.execute(DefaultLi
fecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMav en.java:333)
at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:126)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:2 82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(L auncher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher. java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode (Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.ja va:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFo undException: The p
lugin 'org.apache.maven.plugins:maven-resources-plugin' does not exist or no val
id version could be found
at org.apache.maven.plugin.version.DefaultPluginVersi onManager.resolvePl
uginVersion(DefaultPluginVersionManager.java:229)
at org.apache.maven.plugin.version.DefaultPluginVersi onManager.resolvePl
uginVersion(DefaultPluginVersionManager.java:91)
at org.apache.maven.plugin.DefaultPluginManager.verif yPlugin(DefaultPlug
inManager.java:167)
at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.verifyPlugin(Defa
ultLifecycleExecutor.java:1257)
... 18 more

Please help me

Dave Syer
Mar 18th, 2008, 06:29 AM
This isn't really a Spring Batch related question - more a basic IDE / development environment question. There are too many ways for people to want to set up their own project, so we aren't going to be much help here I'm afraid.

If you are new to Java and/or Eclipse, Maven etc, you could try copying the whole spring-batch-samples project and removing stuff you don't need instead of the other way round?

shamuat
Mar 18th, 2008, 06:40 AM
Yes Dave,

I did samples were running fine. I want to run each and individual job at a time. As you said I am new to maven so can you help me on this. I did hello world sample written all java files and configuration file. Then I tried to compile java file but it was unsuccessful.

I will tell u the steps so u can tell me I am doing right or not

1.After writing java/xml files. I should compile java files
2.then mvn test
3.mvn eclipse:eclipse
4.import that folder to eclipse
5. Junit test

If any above step is wrong pls forgive me.

Dave Syer
Mar 18th, 2008, 06:46 AM
Broadly speaking those steps are OK. You don't need to compile separately - "mvn test" will do that for you. Also "mvn eclipse:eclipse" is not compulsory, but is one way to get an Eclipse project quickly from a Maven one.

shamuat
Mar 18th, 2008, 06:55 AM
Thank you so much

That is what I tried earlier(without compiling java file I just did mvn test) but the exception was some plugin error (as I asked in my previous post). I am trying to get rid of the exception.

thank you Once again for your help.