You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by Susan Cline <ho...@pacbell.net> on 2016/06/06 19:26:42 UTC

DevelopmentStreamScopeTest - compile errors due to StreamScopeTest

Hi,

I’m trying to set up a new project in eclipse for quarks.  After adding the target/java8/lib jars to most of my projects everything seems to be building in Eclipse correctly except for DevelopmentStreamScopeTest.java.

It is looking for StreamScopeTest.java, which is under utils/streamscope/src/test/java/quarks/test/streamscope.

But the compiled class is not contained in target/java8/utils/streamscope/lib/quarks.utils.streamscope.jar - does anyone know how to fix this to get DevelopmentStreamScopeTest.java to build?

Thanks,

Susan

Re: DevelopmentStreamScopeTest - compile errors due to StreamScopeTest

Posted by Dale LaBossiere <dm...@gmail.com>.
A terminology thing… when I say “building in Eclipse” I mean Eclipse doing the building - Project > Build Automatically and such.  It’s a completely separate set of .class files, etc than those generated by build.xml and building in Eclipse doesn’t generate Quarks jars.

Running Quarks samples, like DevelopmentMetricsSample, from a **Quarks development workspace** (one where the Quarks' source/projects are built with Eclipse) seems to work fine.

_quarks is an Eclipse workspace project/folder artifact, not a directory in the git repository.

As noted in DEVELOPMENT.md, _quarks exists solely to provide access to the top level repository artifacts via Eclipse, like build.xml, and it has the unfortunate noted characteristic.  If you don’t need access to such top level artifacts in Eclipse, then you don’t need to import the _quarks project (or at least shouldn’t but I haven’t tried that in a long time).  In all cases you’ll need to import the rest of the Quarks projects.  How you create the git repo clone (via git or Egit) doesn’t affect things.

You can then run these samples via Run as > Java Application.  The .classpath for the samples is setup to reference the Eclipse generated quarks .class files.

Some, not all, samples have scripts (under scripts) to run them outside of Eclipse where they use the ant build generated Quarks jars.

If you want to behave more like a simple consumer of "Quarks binary release” that’s a different flow.  I.e., you’re starting with a “ant release” generated tarball.  DEVELOPMENT.md doesn’t / shouldn’t cover that scenario, something else is needed.  You’d extract the tarball.  The built samples are under <release>/target/java8/samples/lib and the source under samples/src, and scripts under scripts.  Currently there are no .project or .classpath files for the samples bundled up this way to facilitate importing these sample sources into Eclipse.  It would be nice if there were.

— Dale


> On Jun 7, 2016, at 6:58 PM, Susan Cline <ho...@pacbell.net> wrote:
> 
> I was confused - I was combining the instructions for trying to build a quarks application with trying to build
> quarks using eclipse.
> 
> So once I followed the instructions in the “Getting Started with Apache Quarks” page:
> 
> http://quarks.incubator.apache.org/docs/quarks-getting-started.html <http://quarks.incubator.apache.org/docs/quarks-getting-started.html>
> 
> I could build the sample application that is referenced there.
> 
> However, I still have a problem with trying to run examples / samples from Eclipse and that was the intent of my original question.
> I originally modified the .classpath files in Eclipse using the context menu “Build Path —> Configure Build Path” for each of the folders under incubator-quarks.  
> 
> But now, when I start fresh with a new workspace, I’m still having issues.  Here is what I’ve tried two separate ways and have been unsuccessful:
> 
> First way:
> 
> First off I don’t see a _gradle directory, but after I did the following:
> 
> 1) updated my source code using 
> 
> git checkout master
> git fetch upstream
> git rebase upstream/master
> git push
> 
> 2) I created a new eclipse workspace
> 
> 3) I selected “Import Project” from the new eclipse workspace
> 
> 4) I selected a root directory of ~/git/incubator-quarks
> I then clicked the _quarks project where it asks you to select the project.  Since this is the top level project for quarks, I figured this was the right one.  I did NOT check ‘Search for nested projects’ because I tried that before and got duplicate projects.
> 
> 5) After that, I clicked on build.xml and ran ‘Run As -> Ant Build’.
> 
> So Quarks builds fine in eclipse, but I still can’t seem to run any applications .. I was trying to run, specifically, the topology/DevelopmentMetricsSample
> 
> When I click on that file, and bring up the context menu it does not even have ‘Run As —> Java application’. it only has
> Run As —> Run on Server or Run Jetty.
> 
> Also, if I try to configure the build path for the entire _quarks project, it says ‘No actions available’.
> 
> Way 2:
> 
> Use the Git repositories feature of eclipse to try to import the project.
> 
> I pointed to my local clone and then clicked on the clone and selected Import Projects.
> The first time I did this I pointed to my _quarks directory, and got the same problem as above … no way to configure my build path.
> 
> So then I tried selecting the _quarks directory and selecting nested projects and de-selecting the _quarks project.
> Now I can see all of the folders under incubator-quarks.
> 
> But once again when I do it this way I don’t see the build.xml file at the top level of quarks, and I have the red x’s on several projects.
> 
> Does anyone know what I have done wrong?  Once I get this setup I will document it on the wiki or website.
> 
> Thanks,
> 
> Susan
> 
> 
>> On Jun 7, 2016, at 8:22 AM, Dale LaBossiere <dm...@gmail.com> wrote:
>> 
>> Why and how are the various .classpath file modified?  That’s the first place I’d look to resolve Eclipse build problems.
>> 
>> At a higher level, I think http://quarks.incubator.apache.org/docs/quarks-getting-started.html <http://quarks.incubator.apache.org/docs/quarks-getting-started.html> is perhaps (implicitly) describing an environment where the building of Quarks isn’t performed in the same Eclipse workspace as the Quarks application you’re trying to create.  (though this can work. more below)
>> 
>> e.g.,
>> “Downloading Apache Quarks” => download quarks and build via ant as described in the DEVELOPMENT.md.  Don’t even bother with Eclipse for that part.
>> “Setting up your environment” => create an Eclipse workspace, and follow the rest of the directions.  Configure it to use the ant created jars from the first step.
>> 
>> On the “all in one workspace” flow...
>> 
>> So I just tried doing everything from a single Eclipse workspace and it worked fine:
>> - built Quarks from a git repo clone in Eclipse.  You also need to run the ant build to generate the jars that the “getting started” flow describes using.  e.g., in Eclipse select _gradle > build.xml > Run as > Ant Build.  Or run ant from the command line.
>> - used the same Eclipse workspace for “Setting up your environment”.  For the new project’s setup, use “Add External Jars” to select the jars build above (e.g., from ~/git/incubator-quarks/target/java8/lib).
>> 
>> I didn’t try this with (a) building Quarks from a download instead of a clone (there was a recent build.xml fix for that, though it doesn’t seem like you’re encountering that problem) and/or (b) configuring the new project’s classpath to depend on the various Quarks projects in the workspace (though I can’t think of any reason why that wouldn’t work).
>> 
>> Hope that helps
>> — Dale
>> 
>>> On Jun 7, 2016, at 10:38 AM, Susan Cline <ho...@pacbell.net> wrote:
>>> 
>>> Thanks for your response.
>>> 
>>> I do have a utils in my .classpath file, but it is not /utils
>>> 
>>> <classpathentry kind="src" path="utils”/>
>>> 
>>> Closing and opening the project does not fix the problem.
>>> 
>>> Susans-MBP-429:incubator-quarks susancline$ git status
>>> On branch master
>>> Your branch is up-to-date with 'origin/master'.
>>> Changes not staged for commit:
>>> (use "git add <file>..." to update what will be committed)
>>> (use "git checkout -- <file>..." to discard changes in working directory)
>>> 
>>> 	modified:   connectors/.classpath
>>> 	modified:   console/.classpath
>>> 	modified:   providers/.classpath
>>> 	modified:   providers/.project
>>> 	modified:   samples/.classpath
>>> 	modified:   test/.classpath
>>> 	modified:   utils/.classpath
>>> 
>>> I don’t have a top level project, I just have individual projects.
>>> 
>>> What I am trying to accomplish is to perform a build in eclipse.  It seemed like something new users might want - to have all of their eclipse projects build without errors.  Following the instructions here: 
>>> 
>>> http://quarks.incubator.apache.org/docs/quarks-getting-started.html
>>> 
>>> are not clear, and I thought it would be good to clarify these instructions for new users so everything builds correctly.
>>> 
>>> Thanks,
>>> 
>>> Susan
>>> 
>>> 
>>>> In your eclipse workspace, with Eclipse building quarks, it’s providers/.classpath that makes StreamsScopeTest.class available when DevelopmentStreamScopeTest is built.  That .classpath include a “src” entry for /utils.  And utils/streamscope/test.classes/quarks/test/streamscope/StreamScopeTest.class should be present.
>>>> 
>>>> I’m unclear in what you’re trying to — what sort of thing this new project constitutes.  What’s in the new project’s .classpath?
>>>> 
>>>> If you “close” your new project, does the workspace still have build problems?  What does “git status” report?
>>>> 
>>>> — Dale
>>>> 
>>>> 
>>>>> On Jun 6, 2016, at 3:26 PM, Susan Cline <ho...@pacbell.net> wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> I’m trying to set up a new project in eclipse for quarks.  After adding the target/java8/lib jars to most of my projects everything seems to be building in Eclipse correctly except for DevelopmentStreamScopeTest.java.
>>>>> 
>>>>> It is looking for StreamScopeTest.java, which is under utils/streamscope/src/test/java/quarks/test/streamscope.
>>>> 
>>> 
>> 
> 


Re: DevelopmentStreamScopeTest - compile errors due to StreamScopeTest

Posted by Susan Cline <ho...@pacbell.net>.
I was confused - I was combining the instructions for trying to build a quarks application with trying to build
quarks using eclipse.

So once I followed the instructions in the “Getting Started with Apache Quarks” page:

http://quarks.incubator.apache.org/docs/quarks-getting-started.html <http://quarks.incubator.apache.org/docs/quarks-getting-started.html>

I could build the sample application that is referenced there.

However, I still have a problem with trying to run examples / samples from Eclipse and that was the intent of my original question.
I originally modified the .classpath files in Eclipse using the context menu “Build Path —> Configure Build Path” for each of the folders under incubator-quarks.  

But now, when I start fresh with a new workspace, I’m still having issues.  Here is what I’ve tried two separate ways and have been unsuccessful:

First way:

First off I don’t see a _gradle directory, but after I did the following:

1) updated my source code using 

git checkout master
git fetch upstream
git rebase upstream/master
git push

2) I created a new eclipse workspace

3) I selected “Import Project” from the new eclipse workspace

4) I selected a root directory of ~/git/incubator-quarks
I then clicked the _quarks project where it asks you to select the project.  Since this is the top level project for quarks, I figured this was the right one.  I did NOT check ‘Search for nested projects’ because I tried that before and got duplicate projects.

5) After that, I clicked on build.xml and ran ‘Run As -> Ant Build’.

So Quarks builds fine in eclipse, but I still can’t seem to run any applications .. I was trying to run, specifically, the topology/DevelopmentMetricsSample

When I click on that file, and bring up the context menu it does not even have ‘Run As —> Java application’. it only has
Run As —> Run on Server or Run Jetty.

Also, if I try to configure the build path for the entire _quarks project, it says ‘No actions available’.

Way 2:

Use the Git repositories feature of eclipse to try to import the project.

I pointed to my local clone and then clicked on the clone and selected Import Projects.
The first time I did this I pointed to my _quarks directory, and got the same problem as above … no way to configure my build path.

So then I tried selecting the _quarks directory and selecting nested projects and de-selecting the _quarks project.
Now I can see all of the folders under incubator-quarks.

But once again when I do it this way I don’t see the build.xml file at the top level of quarks, and I have the red x’s on several projects.

Does anyone know what I have done wrong?  Once I get this setup I will document it on the wiki or website.

Thanks,

Susan


> On Jun 7, 2016, at 8:22 AM, Dale LaBossiere <dm...@gmail.com> wrote:
> 
> Why and how are the various .classpath file modified?  That’s the first place I’d look to resolve Eclipse build problems.
> 
> At a higher level, I think http://quarks.incubator.apache.org/docs/quarks-getting-started.html <http://quarks.incubator.apache.org/docs/quarks-getting-started.html> is perhaps (implicitly) describing an environment where the building of Quarks isn’t performed in the same Eclipse workspace as the Quarks application you’re trying to create.  (though this can work. more below)
> 
> e.g.,
> “Downloading Apache Quarks” => download quarks and build via ant as described in the DEVELOPMENT.md.  Don’t even bother with Eclipse for that part.
> “Setting up your environment” => create an Eclipse workspace, and follow the rest of the directions.  Configure it to use the ant created jars from the first step.
> 
> On the “all in one workspace” flow...
> 
> So I just tried doing everything from a single Eclipse workspace and it worked fine:
> - built Quarks from a git repo clone in Eclipse.  You also need to run the ant build to generate the jars that the “getting started” flow describes using.  e.g., in Eclipse select _gradle > build.xml > Run as > Ant Build.  Or run ant from the command line.
> - used the same Eclipse workspace for “Setting up your environment”.  For the new project’s setup, use “Add External Jars” to select the jars build above (e.g., from ~/git/incubator-quarks/target/java8/lib).
> 
> I didn’t try this with (a) building Quarks from a download instead of a clone (there was a recent build.xml fix for that, though it doesn’t seem like you’re encountering that problem) and/or (b) configuring the new project’s classpath to depend on the various Quarks projects in the workspace (though I can’t think of any reason why that wouldn’t work).
> 
> Hope that helps
> — Dale
> 
>> On Jun 7, 2016, at 10:38 AM, Susan Cline <ho...@pacbell.net> wrote:
>> 
>> Thanks for your response.
>> 
>> I do have a utils in my .classpath file, but it is not /utils
>> 
>> <classpathentry kind="src" path="utils”/>
>> 
>> Closing and opening the project does not fix the problem.
>> 
>> Susans-MBP-429:incubator-quarks susancline$ git status
>> On branch master
>> Your branch is up-to-date with 'origin/master'.
>> Changes not staged for commit:
>> (use "git add <file>..." to update what will be committed)
>> (use "git checkout -- <file>..." to discard changes in working directory)
>> 
>> 	modified:   connectors/.classpath
>> 	modified:   console/.classpath
>> 	modified:   providers/.classpath
>> 	modified:   providers/.project
>> 	modified:   samples/.classpath
>> 	modified:   test/.classpath
>> 	modified:   utils/.classpath
>> 
>> I don’t have a top level project, I just have individual projects.
>> 
>> What I am trying to accomplish is to perform a build in eclipse.  It seemed like something new users might want - to have all of their eclipse projects build without errors.  Following the instructions here: 
>> 
>> http://quarks.incubator.apache.org/docs/quarks-getting-started.html
>> 
>> are not clear, and I thought it would be good to clarify these instructions for new users so everything builds correctly.
>> 
>> Thanks,
>> 
>> Susan
>> 
>> 
>>> In your eclipse workspace, with Eclipse building quarks, it’s providers/.classpath that makes StreamsScopeTest.class available when DevelopmentStreamScopeTest is built.  That .classpath include a “src” entry for /utils.  And utils/streamscope/test.classes/quarks/test/streamscope/StreamScopeTest.class should be present.
>>> 
>>> I’m unclear in what you’re trying to — what sort of thing this new project constitutes.  What’s in the new project’s .classpath?
>>> 
>>> If you “close” your new project, does the workspace still have build problems?  What does “git status” report?
>>> 
>>> — Dale
>>> 
>>> 
>>>> On Jun 6, 2016, at 3:26 PM, Susan Cline <ho...@pacbell.net> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I’m trying to set up a new project in eclipse for quarks.  After adding the target/java8/lib jars to most of my projects everything seems to be building in Eclipse correctly except for DevelopmentStreamScopeTest.java.
>>>> 
>>>> It is looking for StreamScopeTest.java, which is under utils/streamscope/src/test/java/quarks/test/streamscope.
>>> 
>> 
> 


Re: DevelopmentStreamScopeTest - compile errors due to StreamScopeTest

Posted by Dale LaBossiere <dm...@gmail.com>.
Why and how are the various .classpath file modified?  That’s the first place I’d look to resolve Eclipse build problems.

At a higher level, I think http://quarks.incubator.apache.org/docs/quarks-getting-started.html <http://quarks.incubator.apache.org/docs/quarks-getting-started.html> is perhaps (implicitly) describing an environment where the building of Quarks isn’t performed in the same Eclipse workspace as the Quarks application you’re trying to create.  (though this can work. more below)

e.g.,
 “Downloading Apache Quarks” => download quarks and build via ant as described in the DEVELOPMENT.md.  Don’t even bother with Eclipse for that part.
“Setting up your environment” => create an Eclipse workspace, and follow the rest of the directions.  Configure it to use the ant created jars from the first step.

On the “all in one workspace” flow...

So I just tried doing everything from a single Eclipse workspace and it worked fine:
- built Quarks from a git repo clone in Eclipse.  You also need to run the ant build to generate the jars that the “getting started” flow describes using.  e.g., in Eclipse select _gradle > build.xml > Run as > Ant Build.  Or run ant from the command line.
- used the same Eclipse workspace for “Setting up your environment”.  For the new project’s setup, use “Add External Jars” to select the jars build above (e.g., from ~/git/incubator-quarks/target/java8/lib).

I didn’t try this with (a) building Quarks from a download instead of a clone (there was a recent build.xml fix for that, though it doesn’t seem like you’re encountering that problem) and/or (b) configuring the new project’s classpath to depend on the various Quarks projects in the workspace (though I can’t think of any reason why that wouldn’t work).

Hope that helps
— Dale

> On Jun 7, 2016, at 10:38 AM, Susan Cline <ho...@pacbell.net> wrote:
> 
> Thanks for your response.
> 
> I do have a utils in my .classpath file, but it is not /utils
> 
> <classpathentry kind="src" path="utils”/>
> 
> Closing and opening the project does not fix the problem.
> 
> Susans-MBP-429:incubator-quarks susancline$ git status
> On branch master
> Your branch is up-to-date with 'origin/master'.
> Changes not staged for commit:
>  (use "git add <file>..." to update what will be committed)
>  (use "git checkout -- <file>..." to discard changes in working directory)
> 
> 	modified:   connectors/.classpath
> 	modified:   console/.classpath
> 	modified:   providers/.classpath
> 	modified:   providers/.project
> 	modified:   samples/.classpath
> 	modified:   test/.classpath
> 	modified:   utils/.classpath
> 
> I don’t have a top level project, I just have individual projects.
> 
> What I am trying to accomplish is to perform a build in eclipse.  It seemed like something new users might want - to have all of their eclipse projects build without errors.  Following the instructions here: 
> 
> http://quarks.incubator.apache.org/docs/quarks-getting-started.html
> 
> are not clear, and I thought it would be good to clarify these instructions for new users so everything builds correctly.
> 
> Thanks,
> 
> Susan
> 
> 
>> In your eclipse workspace, with Eclipse building quarks, it’s providers/.classpath that makes StreamsScopeTest.class available when DevelopmentStreamScopeTest is built.  That .classpath include a “src” entry for /utils.  And utils/streamscope/test.classes/quarks/test/streamscope/StreamScopeTest.class should be present.
>> 
>> I’m unclear in what you’re trying to — what sort of thing this new project constitutes.  What’s in the new project’s .classpath?
>> 
>> If you “close” your new project, does the workspace still have build problems?  What does “git status” report?
>> 
>> — Dale
>> 
>> 
>>> On Jun 6, 2016, at 3:26 PM, Susan Cline <ho...@pacbell.net> wrote:
>>> 
>>> Hi,
>>> 
>>> I’m trying to set up a new project in eclipse for quarks.  After adding the target/java8/lib jars to most of my projects everything seems to be building in Eclipse correctly except for DevelopmentStreamScopeTest.java.
>>> 
>>> It is looking for StreamScopeTest.java, which is under utils/streamscope/src/test/java/quarks/test/streamscope.
>> 
> 


Re: DevelopmentStreamScopeTest - compile errors due to StreamScopeTest

Posted by Susan Cline <ho...@pacbell.net>.
Thanks for your response.

I do have a utils in my .classpath file, but it is not /utils

<classpathentry kind="src" path="utils”/>

Closing and opening the project does not fix the problem.

Susans-MBP-429:incubator-quarks susancline$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   connectors/.classpath
	modified:   console/.classpath
	modified:   providers/.classpath
	modified:   providers/.project
	modified:   samples/.classpath
	modified:   test/.classpath
	modified:   utils/.classpath

I don’t have a top level project, I just have individual projects.

What I am trying to accomplish is to perform a build in eclipse.  It seemed like something new users might want - to have all of their eclipse projects build without errors.  Following the instructions here: 

http://quarks.incubator.apache.org/docs/quarks-getting-started.html

are not clear, and I thought it would be good to clarify these instructions for new users so everything builds correctly.

Thanks,

Susan


> In your eclipse workspace, with Eclipse building quarks, it’s providers/.classpath that makes StreamsScopeTest.class available when DevelopmentStreamScopeTest is built.  That .classpath include a “src” entry for /utils.  And utils/streamscope/test.classes/quarks/test/streamscope/StreamScopeTest.class should be present.
> 
> I’m unclear in what you’re trying to — what sort of thing this new project constitutes.  What’s in the new project’s .classpath?
> 
> If you “close” your new project, does the workspace still have build problems?  What does “git status” report?
> 
> — Dale
> 
> 
>> On Jun 6, 2016, at 3:26 PM, Susan Cline <ho...@pacbell.net> wrote:
>> 
>> Hi,
>> 
>> I’m trying to set up a new project in eclipse for quarks.  After adding the target/java8/lib jars to most of my projects everything seems to be building in Eclipse correctly except for DevelopmentStreamScopeTest.java.
>> 
>> It is looking for StreamScopeTest.java, which is under utils/streamscope/src/test/java/quarks/test/streamscope.
> 


Re: DevelopmentStreamScopeTest - compile errors due to StreamScopeTest

Posted by Dale LaBossiere <dm...@gmail.com>.
Quarks build.xml doesn’t bundle the “test” classes into jars and there aren’t (shouldn’t be) dependencies from target/java8/lib/*.jar to “test” classes.
And Eclipse isn’t building anything into jars.

In your eclipse workspace, with Eclipse building quarks, it’s providers/.classpath that makes StreamsScopeTest.class available when DevelopmentStreamScopeTest is built.  That .classpath include a “src” entry for /utils.  And utils/streamscope/test.classes/quarks/test/streamscope/StreamScopeTest.class should be present.

I’m unclear in what you’re trying to — what sort of thing this new project constitutes.  What’s in the new project’s .classpath?

If you “close” your new project, does the workspace still have build problems?  What does “git status” report?

— Dale


> On Jun 6, 2016, at 3:26 PM, Susan Cline <ho...@pacbell.net> wrote:
> 
> Hi,
> 
> I’m trying to set up a new project in eclipse for quarks.  After adding the target/java8/lib jars to most of my projects everything seems to be building in Eclipse correctly except for DevelopmentStreamScopeTest.java.
> 
> It is looking for StreamScopeTest.java, which is under utils/streamscope/src/test/java/quarks/test/streamscope.
> 
> But the compiled class is not contained in target/java8/utils/streamscope/lib/quarks.utils.streamscope.jar - does anyone know how to fix this to get DevelopmentStreamScopeTest.java to build?
> 
> Thanks,
> 
> Susan