Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build SpringCloudEventsApplication #64

Open
danieloh30 opened this issue Feb 20, 2021 · 9 comments
Open

Failed to build SpringCloudEventsApplication #64

danieloh30 opened this issue Feb 20, 2021 · 9 comments

Comments

@danieloh30
Copy link

danieloh30 commented Feb 20, 2021

Once SpringCloudEventsApplication is created via kn func create -l springboot -t events, this app can't be built with the following errors:

The template doesn't seem to be generated properly. For example, there is no definition about "HTTP_ATTR_PREFIX" in code.

ERROR] /workspace/src/main/java/functions/SpringCloudEventsApplication.java:[15,53] cannot find symbol
[ERROR] symbol: class CloudEventAttributesP[builder] rovider
[ERROR] location: package org.springframework.cloud.function.cloudeve[builder] nt
[ERROR] /workspace/src/main/java/functions/SpringCloudEventsApplication.java:[33,7] [builder] cannot find symbol
[ERROR] symbol: class CloudEventAttributesProvider
[ERROR] location: [builder] class functions.SpringCloudEventsApplication
[ERROR] /workspace/src/main/java/functions/SpringCloudEventsApplication.java[builder] :[59,10] cannot find symbol
[ERROR] symbol: class CloudEventAttributesProvider
[ERROR[builder] ] location: class functions.SpringCloudEventsApplication
[ERROR] /workspace/src/main/java/functions/SpringCloudEventsApplication.java:[3,1] cannot find symbol
[ERROR] symbol: static [builder] HTTP_ATTR_PREFIX
[ERROR] location: class org.springframework.cloud.function.cloud[builder] event.CloudEventMessageUtils
[ERROR] /workspace/src/main/j[builder] ava/functions/SpringCloudEventsApplication.java:[39,11] cannot find symbol
[ERROR] symbol: variable HTTP_ATTR_PREFIX
[ERROR] location: class functions.Spring[builder] CloudEventsApplication
[ERROR] /workspace/src/main/java/functions/SpringCloudEventsApplication.java:[41,32] cannot find symbol
[ERROR] symbol:[builder] variable HTTP_ATTR_PREFIX
[ERROR] [builder] location: class functions.SpringCloudEventsApplication
[ERROR] /workspace/src/main/java/functions/SpringCloudEventsApplication.java[builder] :[43,32] cannot find symbol
[ERROR] symbol: variable HTTP_ATTR_PREFIX
[ERROR] location: class functions.SpringCloudEventsApplication
[ERROR] /[builder] workspace/src/main/java/functions/SpringCloudEventsApplication.java:[45,32] cannot find symbol
[ERROR] symbol: variable HTTP_ATTR_PREFIX
[ERROR] location: class functions.S[builder] pringCloudEventsApplication
[ERROR] /works[builder] pace/src/main/java/functions/SpringCloudEventsApplication.java:[51,47] cannot find symbol
[ERROR] symbol: variable HTT[builder] P_ATTR_PREFIX
[ERROR] location: class fu[builder] nctions.SpringCloudEventsApplication
[ERROR] -> [Help 1]
[ERROR]
[builder] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[builder] [ERROR] Re-run Maven using the -X switch to enable ful[builder] l debug logging.
[ERROR]
[ERROR] For more info[builder] rmation about the errors and possible solutions, please read the following articles:
[builder] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN[builder] /MojoFailureException
[builder] ERROR: failed to build: exit status 1

@lance
Copy link
Member

lance commented Mar 3, 2021

@danieloh30 can this be closed now with knative/func#265 having landed?

@danieloh30
Copy link
Author

@lance I just recreated a new spring boot project via kn func create spring-func-events -l springboot -t events but I still have the same error.

@lance
Copy link
Member

lance commented Mar 3, 2021

@danieloh30 sorry! I should have been more explicit. Did you use the latest build from that PR? You can download it here https://github.com/boson-project/func/actions/runs/612739644

@danieloh30
Copy link
Author

danieloh30 commented Mar 3, 2021

@lance I think I have the latest. The link shows func tool but I'm most likely using 'kn func'

Here is what I'm using:

kn version
Version: v0.19.1
Build Date: 2021-01-27 23:01:29
Git Revision: f513c321
Supported APIs:

  • Serving
    • serving.knative.dev/v1 (knative-serving v0.19.0)
  • Eventing
    • sources.knative.dev/v1alpha2 (knative-eventing v0.19.0)
    • eventing.knative.dev/v1beta1 (knative-eventing v0.19.0)

@lance
Copy link
Member

lance commented Mar 3, 2021

@danieloh30 kn func is the standard kn CLI augmented with the func binary as a plugin. The version you have does not have the most recent changes. To test those, you'd download the func binary and just invoke it as func create... etc. But no worries. It's easy enough for me to do that and test on my computer.

@danieloh30
Copy link
Author

danieloh30 commented Mar 3, 2021

Still a bit confused. What is our position to create, build, and deploy functions? kn or func?

When will you merge this fix to kn cli?

Also, I see this version. Is this correct?

./func_darwin_amd64 version
v0.0.0

@lance
Copy link
Member

lance commented Mar 8, 2021

Sorry for the confusion, @danieloh30. You can think of func as the upstream for kn func. When we ship kn in OpenShift Serverless, func is included in the kn binary as a plugin. You can see where we are doing that here: https://github.com/boson-project/func/blob/8143ea1056626b238c40010fb0ede3bdc5fb5065/plugin/plugin.go#L8. So, when we are testing out pre-release versions, we typically just use the func CLI rather than going to the trouble of building kn with the func plugin. When you are using the func CLI, it's no different than when using kn func. That's why sometimes you see commands written either way.

We will ship the next kn build in 1.14. In the meantime, if you want to use the latest and greatest, you can just download func and use it.

The version problem was a known issue that should be resolved now. knative/func#204

@danieloh30
Copy link
Author

Good to know. Here are further questions:

  1. As you said, func allows me to deploy spring boot with cloudevent to openshift so when I can do the same thing in kn func cli?
  2. I downloaded func binary last week but it still shows v0.0.0. According to Release builds are versioned incorrectly knative/func#204, should it already be fixed it?

@lance
Copy link
Member

lance commented Mar 9, 2021

As you said, func allows me to deploy spring boot with cloudevent to openshift so when I can do the same thing in kn func cli?

The next Serverless release (1.14) should have this. It will be available in the next couple of weeks.

I downloaded func binary last week but it still shows v0.0.0. According to knative/func#204, should it already be fixed it?

Hmm - I will follow up on this in the func repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants