I am trying to compile and run this on my ubuntu-24-04-01 VM running on VirtualBox.
The first time I fired:
sudo docker-compose up chirpstack-api-java-current-user
it gave a warning:
WARNING: The CURRENT_UID variable is not set. Defaulting to a blank string.
WARNING: The CURRENT_HOME variable is not set. Defaulting to a blank string.
and ran until:
ERROR: for chirpstack-api_chirpstack-api-java-current-user_1 Cannot start service chirpstack-api-java-current-user: error while creating mount source path â/.m2â: mkdir /.m2: read-only file system
ERROR: for chirpstack-api-java-current-user Cannot start service chirpstack-api-java-current-user: error while creating mount source path â/.m2â: mkdir /.m2: read-only file system
I changed the line in docker-compose.yml from :
- ${CURRENT_HOME}/.m2:/var/maven/.m2
to
- ${HOME}/.m2:/var/maven/.m2
and removed the line:
- ${CURRENT_HOME}/.m2:/var/maven/.m2
That allowed the build image to be successfully built. There is a build directory created under java/build with the build/target/chirpstack-api-3.12.4.jar and the rest of the artifacts all there
Towards the end of the log of the build we have:
chirpstack-api-java-current-user_1 | [INFO] Installing /chirpstack-api/java/build/target/chirpstack-api-3.12.4.jar to /var/maven/.m2/repository/io/chirpstack/chirpstack-api/3.12.4/chirpstack-api-3.12.4.jar
but neither on the image nor on my local VM I can find the /var/maven, let alone /var/maven/.m2. Is the log lying and the build install was not actually successful or this is by design? Since I notice on github Chirpstack-api java page it refers to the jar artifact to be installed to local maven repository $HOME/.m2 for the code snippet published there to be built. Has my changes to the environment variables in the playbook caused this or thereâs something else which is the problem.
Also is there another docker-compose which needs to be fired up for building the code snippet in the link above? Or that is meant to be built directly on the VM using the jar generated (and somehow installed) by the original docker-compose. Looking at the above link I was not very sure how to build the snippet published there. (ie need to generate the maven source structure using mvn archetype:generate and mvn package on my VM or thereâs another docker-compose for these?)
The first part of the question was solved. It was somehow careless of me not checking out the top level Makefile as it had the java-current-user target defined which is where all those undefined env vars were defined. so instead of running docker-compose directly, it was run through make and it worked.
Also since I was running it with sudo the maven home was actually under root not under my own home, so that explains why I couldnât find it.
Now trying to figure out how to build and run the service wrapper stubâŚ
Hello:
I am a java developer.
I run the command of docker-compose for java succeed.
Bud when I use the chirpstack-api-3.12.4.jar something went wrong,details as following :
My codes:
//get jwt
ManagedChannel channel = ManagedChannelBuilder.forAddress(âXXXXâ, 8080).usePlaintext().build();
InternalServiceGrpc.InternalServiceBlockingStub stub = InternalServiceGrpc.newBlockingStub(channel);
final LoginRequest loginRequest = LoginRequest.newBuilder().setEmail(âXXXâ).setPassword(âXXXâ).build();
LoginResponse loginResponse = stub.login(loginRequest);
Metadata metadata = new Metadata();
metadata.put(Metadata.Key.of(âauthorizationâ, Metadata.ASCII_STRING_MARSHALLER), "Bearer " + loginResponse.getJwt());
Channel headChannel = ClientInterceptors.intercept(channel, MetadataUtils.newAttachHeadersInterceptor(metadata));
//get application list
ApplicationServiceGrpc.ApplicationServiceBlockingStub appStub = ApplicationServiceGrpc.newBlockingStub(headChannel);
ListApplicationRequest.newBuilder().setOrganizationId(1).build();
final ListApplicationResponse list = appStub.list(ListApplicationRequest.newBuilder().setOrganizationId(1).build());
Result log:
INTERNAL: failed to decode Protobuf message: ListApplicationsRequest.search: invalid wire type: Varint (expected LengthDelimited)
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271)
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252)
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:165)
at io.chirpstack.api.as.external.api.ApplicationServiceGrpc$ApplicationServiceBlockingStub.list(ApplicationServiceGrpc.java:2698)
My question:
the request I defined is :ListApplicationRequest(It is in chirpstack-api-3.12.4.jar) but error trace is :ListApplicationsRequest(It is not in chirpstack-api-3.12.4.jar) .
That is why? I looking forward to your reply.