-
Notifications
You must be signed in to change notification settings - Fork 345
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
"cannot find symbol" issue in camel-k releases v1.4.0 #2317
Comments
This support has been removed a while ago, see apache/camel-k-runtime#480. Each java file is compiled in its own compilation unit and loaded by a dedicated classloader so there's no visibility between them. |
@lburgazzoli The problem of this change is to reduce code reusability. For example in our Camel-k integration, we have 3-10 routes sharing same group of constants and static methods/functions. With this change, we have to copy all those definitions to each Java file. It makes the Java file much longer, difficult to read and more error-pone with inconsistency issues. |
I understand but camel-k is not designed to be a generic build tool and when you start adding such inter-dependecies between classes, a lot of issues may happen i.e. camel-k does not have any clue about dependencies so you may end up with the same issue if the code is compiled in a different order. A CR is also not the best place where to store source code. There is another issue related to this issue so we may introduce some sort of support for this in the future but I'd really recommend to avoid it and publish support code as an artifact. |
Thanks @lburgazzoli to mention #1821 . |
Can you give more info about why |
@lburgazzoli It is information (constants and utility functions) just for our own app. Our own app is under development with new requests every day. It means those constants and utility functions are changing frequently. I do not expect to post the utility into public maven because of security issues, license issue, and frequent changing. It also adds more complexity to install and update a private Maven repo in customer's environments, and we will have more resource cost. |
If you are using this constants and utilities in multiple customer deployments, any change not centralized will cost updating the classes everywhere. I don't see so much differences into releasing a maven artifacts and update a version everywhere. It's more secure, more reliable and it will need to pass through a workflow. This won't happen with modification on classes. |
@oscerd |
What you're saying is that you want to deploy snapshot code. We are discussing two different entities. |
A released artifact on private or public nexus needs to deal with a sequence of steps and verification. Using snapshot code is a different story. |
@oscerd Yes the utility can be snapshot code. I cannot imagine if you upgrade utility class with Maven but do not upgrade the Camel code at the same time. So we have to have many versions of the utility class to be compatible with the Camel code. Note, Camel-k is for micro services instead of some products with long time of well modeling. If you restrict us to use public Maven to post the utility class, we just lose the capability of Changing fast which is one of the most important factors for us to choose Camel-k. |
There is jitpack support for snapshot code eventually. |
There is no restrictions. You can use multiple ways of depending of snapshot code. There are different approaches to this. But in my opinion if they are dependencies of the main camel code they should be provided as a separated artifact/package/tag etc. |
@oscerd I am sorry for late response. Yes it is a solution but not very convincing to me. It is not convenient. We can also use our own maven repository. While this changes a lot of the programming practice to build all your Java code other than those Camel DSL into separate Maven artifacts. I still expect if you can enable supporting POJO again maybe with some limits. |
This issue has been automatically marked as stale due to 90 days of inactivity. |
Our Camel integration code cannot run on new camel-k releases v1.4.0. There are a number of Java files in our camel integration app. So, we are using some Java files to share some public symbols for example constants and static methods. The Java Integrations are working very well on previous camel-k releases v1.3.x. While with the new camel-k releases v1.4.0, it is failed because symbols from different Java files are isolated.
For example, we have two Java files: Test1.java and Test2.java.
//Test1.java
Test2.java
When you run the Camel integration with following command:
kamel run --dev --name mytest Test1.java Test2.java
You can find following error messages:
The text was updated successfully, but these errors were encountered: