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

default package breaks @Scheduled #13540

Closed
maxandersen opened this issue Nov 29, 2020 · 7 comments
Closed

default package breaks @Scheduled #13540

maxandersen opened this issue Nov 29, 2020 · 7 comments
Labels
area/jbang Issues related to when using jbang.dev with Quarkus area/scheduler kind/bug Something isn't working

Comments

@maxandersen
Copy link
Member

Describe the bug
when having code class with out a package used with @Scheduled errors.

//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus:quarkus-scheduler:1.9.2.Final
//JAVA_OPTIONS -Dquarkus.http.port=8082
//JAVA_OPTIONS -Djava.util.logging.manager=org.jboss.logmanager.LogManager

//package com.att.sapmp.services.events;

import java.util.logging.Logger;

import javax.enterprise.context.ApplicationScoped;

import io.quarkus.scheduler.Scheduled;

import io.quarkus.runtime.Quarkus;

/**
 * A bean producing random prices every 5 seconds. The prices are written to a
 * Kafka topic (prices). The Kafka configuration is specified in the application
 * configuration.
 */
@ApplicationScoped
public class Jbang_Quarkus_Scheduler {
    static final Logger LOGGER = Logger.getLogger("Jbang_Quarkus_Scheduler");

 @Scheduled(every="10s")     
    void scheduledLog() {
        LOGGER.info("10s Tick");
    }

}

gives errors like:

Caused by: java.nio.file.FileSystemException: /Jbang_Quarkus_Scheduler_ScheduledInvoker_scheduledLog_4592414c73f13a2e41bdf89dccc9abe064eef0d7.class: Read-only file system
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
at java.base/java.nio.file.Files.newOutputStream(Files.java:224)
at dev.jbang.IntegrationManager.runIntegration(IntegrationManager.java:118)
... 14 more

notice how it is trying to write to root filesystem indicating bad assumption about there always being a package.

Expected behavior
should not fail due to default package.

@maxandersen maxandersen added the kind/bug Something isn't working label Nov 29, 2020
@ghost ghost added area/jbang Issues related to when using jbang.dev with Quarkus area/scheduler labels Nov 29, 2020
@ghost
Copy link

ghost commented Nov 29, 2020

/cc @mkouba, @quarkusio/devtools

@maxandersen
Copy link
Member Author

repoted originally in jbang at jbangdev/jbang#561

@mkouba
Copy link
Contributor

mkouba commented Nov 30, 2020

Although it's legal to use the default package in any Java app I don't believe there is any valid use case other than jbang ;-).

maxandersen added a commit to maxandersen/quarkus that referenced this issue Nov 30, 2020
@maxandersen
Copy link
Member Author

Although it's legal to use the default package in any Java app I don't believe there is any valid use case other than jbang ;-).

@gsmet
Copy link
Member

gsmet commented Dec 15, 2020

Why is it closed? I see the PR here is still open: #13541 ?

@maxandersen maxandersen reopened this Dec 15, 2020
@maxandersen
Copy link
Member Author

Good question. For some reason I thought this was merged :/

maxandersen added a commit to maxandersen/quarkus that referenced this issue Dec 16, 2020
@mkouba
Copy link
Contributor

mkouba commented Mar 25, 2021

This should be fixed by #14839.

@mkouba mkouba closed this as completed Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jbang Issues related to when using jbang.dev with Quarkus area/scheduler kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants