EventType “ADD_SENSOR” with parent “EVENT” already existsHow to append text to an existing file in JavaHow do I check if a file exists in Java?JUnit test of the same objectjava swing clear the event queueStreamCorruptedException occurs during object decodingorg.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructorFull Android support for OSGi bundlesJava 1.3 music player - how to stop play interruptWhy reading byte array to an Object throws java.io.StreamCorruptedException?JavaFX custom events with OSGi

Do I need a multiple entry visa for a trip UK -> Sweden -> UK?

What't the meaning of this extra silence?

What is the intuitive meaning of having a linear relationship between the logs of two variables?

voltage of sounds of mp3files

How do I keep an essay about "feeling flat" from feeling flat?

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

apt-get update is failing in debian

Can a monster with multiattack use this ability if they are missing a limb?

What's a natural way to say that someone works somewhere (for a job)?

Curses work by shouting - How to avoid collateral damage?

Why is delta-v is the most useful quantity for planning space travel?

Short story about space worker geeks who zone out by 'listening' to radiation from stars

There is only s̶i̶x̶t̶y one place he can be

Is this Spell Mimic feat balanced?

Ways to speed up user implemented RK4

The baby cries all morning

Failed to fetch jessie backports repository

Applicability of Single Responsibility Principle

Can I Retrieve Email Addresses from BCC?

Go Pregnant or Go Home

How can I get through very long and very dry, but also very useful technical documents when learning a new tool?

What's the purpose of "true" in bash "if sudo true; then"

Is there an Impartial Brexit Deal comparison site?

Student evaluations of teaching assistants



EventType “ADD_SENSOR” with parent “EVENT” already exists


How to append text to an existing file in JavaHow do I check if a file exists in Java?JUnit test of the same objectjava swing clear the event queueStreamCorruptedException occurs during object decodingorg.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructorFull Android support for OSGi bundlesJava 1.3 music player - how to stop play interruptWhy reading byte array to an Object throws java.io.StreamCorruptedException?JavaFX custom events with OSGi













1















I am developing a JavaFX application which uses the Apache Felix OSGi framework. I have an issue with firing custom events. Whenever I try to fire a custom event, the exception java.lang.IllegalArgumentException: EventType "ADD_SENSOR" with parent "EVENT" already exists (stacktrace is shown below) is thrown.



Caused by: java.lang.IllegalArgumentException: EventType "ADD_SENSOR"with parent "EVENT" already exists
at javafx.event.EventType.register(EventType.java:186)
at javafx.event.EventType.<init>(EventType.java:128)
at swt6.componentmanager.gui.event.AddSensorEvent.<clinit>(AddSensorEvent.java:8)


The code firing the event is shown below.



private void onAddSensor(ActionEvent event) 
AddSensorEvent addSensorEvent = new AddSensorEvent(
this.typeComboBox.getValue(),
this.nameInput.getText(),
this.descriptionInput.getText()
);
this.addButton.fireEvent(addSensorEvent);

// close the window
((Stage) this.getScene().getWindow()).close();



The class AddSensorEvent, which also manages the EventType instance via a public static final field, is illustrated below, too.



public class AddSensorEvent extends Event 
public static final EventType<AddSensorEvent> ADD_SENSOR_EVENT_TYPE =
new EventType<>(EventType.ROOT, "ADD_SENSOR");

private final SensorFactory sensorFactory;
private final String sensorName;
private final String sensorDescription;

public AddSensorEvent(SensorFactory sensorFactory, String sensorName, String sensorDescription)
super(ADD_SENSOR_EVENT_TYPE);

this.sensorFactory = sensorFactory;
this.sensorName = sensorName;
this.sensorDescription = sensorDescription;


public SensorFactory getSensorFactory()
return this.sensorFactory;


public String getSensorName()
return this.sensorName;


public String getSensorDescription()
return this.sensorDescription;




The application is a port of an application using the Java module system, which was introduced in Java 9, and it works fine when using the module system.



I tried following this, this and this issues, but none of the provided solutions worked for me.



Thank you for your help!










share|improve this question






















  • You mention you're using OSGi. I may be mistaken, but that framework uses different ClassLoaders/ModuleLayers to isolate dependencies as appropriate. Check if the AddSensorEvent class is being loaded more than once by different ClassLoaders.

    – Slaw
    Mar 8 at 4:25















1















I am developing a JavaFX application which uses the Apache Felix OSGi framework. I have an issue with firing custom events. Whenever I try to fire a custom event, the exception java.lang.IllegalArgumentException: EventType "ADD_SENSOR" with parent "EVENT" already exists (stacktrace is shown below) is thrown.



Caused by: java.lang.IllegalArgumentException: EventType "ADD_SENSOR"with parent "EVENT" already exists
at javafx.event.EventType.register(EventType.java:186)
at javafx.event.EventType.<init>(EventType.java:128)
at swt6.componentmanager.gui.event.AddSensorEvent.<clinit>(AddSensorEvent.java:8)


The code firing the event is shown below.



private void onAddSensor(ActionEvent event) 
AddSensorEvent addSensorEvent = new AddSensorEvent(
this.typeComboBox.getValue(),
this.nameInput.getText(),
this.descriptionInput.getText()
);
this.addButton.fireEvent(addSensorEvent);

// close the window
((Stage) this.getScene().getWindow()).close();



The class AddSensorEvent, which also manages the EventType instance via a public static final field, is illustrated below, too.



public class AddSensorEvent extends Event 
public static final EventType<AddSensorEvent> ADD_SENSOR_EVENT_TYPE =
new EventType<>(EventType.ROOT, "ADD_SENSOR");

private final SensorFactory sensorFactory;
private final String sensorName;
private final String sensorDescription;

public AddSensorEvent(SensorFactory sensorFactory, String sensorName, String sensorDescription)
super(ADD_SENSOR_EVENT_TYPE);

this.sensorFactory = sensorFactory;
this.sensorName = sensorName;
this.sensorDescription = sensorDescription;


public SensorFactory getSensorFactory()
return this.sensorFactory;


public String getSensorName()
return this.sensorName;


public String getSensorDescription()
return this.sensorDescription;




The application is a port of an application using the Java module system, which was introduced in Java 9, and it works fine when using the module system.



I tried following this, this and this issues, but none of the provided solutions worked for me.



Thank you for your help!










share|improve this question






















  • You mention you're using OSGi. I may be mistaken, but that framework uses different ClassLoaders/ModuleLayers to isolate dependencies as appropriate. Check if the AddSensorEvent class is being loaded more than once by different ClassLoaders.

    – Slaw
    Mar 8 at 4:25













1












1








1








I am developing a JavaFX application which uses the Apache Felix OSGi framework. I have an issue with firing custom events. Whenever I try to fire a custom event, the exception java.lang.IllegalArgumentException: EventType "ADD_SENSOR" with parent "EVENT" already exists (stacktrace is shown below) is thrown.



Caused by: java.lang.IllegalArgumentException: EventType "ADD_SENSOR"with parent "EVENT" already exists
at javafx.event.EventType.register(EventType.java:186)
at javafx.event.EventType.<init>(EventType.java:128)
at swt6.componentmanager.gui.event.AddSensorEvent.<clinit>(AddSensorEvent.java:8)


The code firing the event is shown below.



private void onAddSensor(ActionEvent event) 
AddSensorEvent addSensorEvent = new AddSensorEvent(
this.typeComboBox.getValue(),
this.nameInput.getText(),
this.descriptionInput.getText()
);
this.addButton.fireEvent(addSensorEvent);

// close the window
((Stage) this.getScene().getWindow()).close();



The class AddSensorEvent, which also manages the EventType instance via a public static final field, is illustrated below, too.



public class AddSensorEvent extends Event 
public static final EventType<AddSensorEvent> ADD_SENSOR_EVENT_TYPE =
new EventType<>(EventType.ROOT, "ADD_SENSOR");

private final SensorFactory sensorFactory;
private final String sensorName;
private final String sensorDescription;

public AddSensorEvent(SensorFactory sensorFactory, String sensorName, String sensorDescription)
super(ADD_SENSOR_EVENT_TYPE);

this.sensorFactory = sensorFactory;
this.sensorName = sensorName;
this.sensorDescription = sensorDescription;


public SensorFactory getSensorFactory()
return this.sensorFactory;


public String getSensorName()
return this.sensorName;


public String getSensorDescription()
return this.sensorDescription;




The application is a port of an application using the Java module system, which was introduced in Java 9, and it works fine when using the module system.



I tried following this, this and this issues, but none of the provided solutions worked for me.



Thank you for your help!










share|improve this question














I am developing a JavaFX application which uses the Apache Felix OSGi framework. I have an issue with firing custom events. Whenever I try to fire a custom event, the exception java.lang.IllegalArgumentException: EventType "ADD_SENSOR" with parent "EVENT" already exists (stacktrace is shown below) is thrown.



Caused by: java.lang.IllegalArgumentException: EventType "ADD_SENSOR"with parent "EVENT" already exists
at javafx.event.EventType.register(EventType.java:186)
at javafx.event.EventType.<init>(EventType.java:128)
at swt6.componentmanager.gui.event.AddSensorEvent.<clinit>(AddSensorEvent.java:8)


The code firing the event is shown below.



private void onAddSensor(ActionEvent event) 
AddSensorEvent addSensorEvent = new AddSensorEvent(
this.typeComboBox.getValue(),
this.nameInput.getText(),
this.descriptionInput.getText()
);
this.addButton.fireEvent(addSensorEvent);

// close the window
((Stage) this.getScene().getWindow()).close();



The class AddSensorEvent, which also manages the EventType instance via a public static final field, is illustrated below, too.



public class AddSensorEvent extends Event 
public static final EventType<AddSensorEvent> ADD_SENSOR_EVENT_TYPE =
new EventType<>(EventType.ROOT, "ADD_SENSOR");

private final SensorFactory sensorFactory;
private final String sensorName;
private final String sensorDescription;

public AddSensorEvent(SensorFactory sensorFactory, String sensorName, String sensorDescription)
super(ADD_SENSOR_EVENT_TYPE);

this.sensorFactory = sensorFactory;
this.sensorName = sensorName;
this.sensorDescription = sensorDescription;


public SensorFactory getSensorFactory()
return this.sensorFactory;


public String getSensorName()
return this.sensorName;


public String getSensorDescription()
return this.sensorDescription;




The application is a port of an application using the Java module system, which was introduced in Java 9, and it works fine when using the module system.



I tried following this, this and this issues, but none of the provided solutions worked for me.



Thank you for your help!







java javafx osgi openjfx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 11:51









LukasLukas

568414




568414












  • You mention you're using OSGi. I may be mistaken, but that framework uses different ClassLoaders/ModuleLayers to isolate dependencies as appropriate. Check if the AddSensorEvent class is being loaded more than once by different ClassLoaders.

    – Slaw
    Mar 8 at 4:25

















  • You mention you're using OSGi. I may be mistaken, but that framework uses different ClassLoaders/ModuleLayers to isolate dependencies as appropriate. Check if the AddSensorEvent class is being loaded more than once by different ClassLoaders.

    – Slaw
    Mar 8 at 4:25
















You mention you're using OSGi. I may be mistaken, but that framework uses different ClassLoaders/ModuleLayers to isolate dependencies as appropriate. Check if the AddSensorEvent class is being loaded more than once by different ClassLoaders.

– Slaw
Mar 8 at 4:25





You mention you're using OSGi. I may be mistaken, but that framework uses different ClassLoaders/ModuleLayers to isolate dependencies as appropriate. Check if the AddSensorEvent class is being loaded more than once by different ClassLoaders.

– Slaw
Mar 8 at 4:25












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043137%2feventtype-add-sensor-with-parent-event-already-exists%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043137%2feventtype-add-sensor-with-parent-event-already-exists%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко