How to set image using javafx - java

I got an error while using this code to set an image.
Also I put my image in src folder. I tried another ways but nothing worked for me.
Code:
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Clock extends Application{
public static void main(String[] args) {
launch(args);
}
#Override
public void start(Stage ps) throws Exception {
ps.setTitle("Analog Clock");
ps.show();
StackPane pane = new StackPane();
pane.setAlignment(Pos.CENTER);
ImageView image = new ImageView(new Image(getClass().getResourceAsStream("analog.png")));
pane.getChildren().add(image);
//Image img = new Image("analog.png");
// ImageView iv1 = new ImageView();
// iv1.setImage(img);
Scene scene = new Scene(pane);
below are errors Every time I run the code.
Error:
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$50/14845382.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Input stream must not be null
at javafx.scene.image.Image.validateInputStream(Unknown Source)
at javafx.scene.image.Image.<init>(Unknown Source)
at Clock.start(Clock.java:26)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$53/2934105.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/18503843.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/19884472.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/2180324.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/3326003.run(Unknown Source)
... 1 more
Exception running application Clock
Help me to solve this issue.
thanks

Your InputStream is null. you should know that if your Image file is in your source folder then you should direct it to it. right click on your image and select copy qualified name and use that for example
i have a folder in my src folder-(package) called files and my image file is default_profile_icon.png, then i will use this code
new Image("/files/default_profile_icon.png",160,160,false,true)
the first parameter is what you look at, hope you get it now.
i do not know where your image is located,hence this answer

Caused by: java.lang.NullPointerException: Input stream must not be null
...
at Clock.start(Clock.java:26)
You've got a NPE at line 26, which is the following line of code:
ImageView image = new ImageView(new Image(getClass().getResourceAsStream("analog.png")));
The culprit is likely the reference to
analog.png. The system is failing to read the file from the location you're providing and getResourceAsStream() is returning a null value.
You can further determine this by breaking the line up as:
InputStream inStream = getClass().getResourceAsStream("analog.png");
Image imageObject = new Image(inStream);
ImageView image = new ImageView(imageObject);
and confirm which line number is referenced by the new stack trace when you run Clock.
Confirm your file analog.png is accessible or correct the path / location of your image file along the path. The rules for using getResourceAsStream() properly when it is returning null are summarized in this Stack Overflow Question.

Related

How count agents from utilities collection with specific characteristic?

There are two types of agents in my Model:
AgentA - it's a parcel which must be delivered to the DeliveryPoint. This AgentA has a corresponding parameter "DeliveryPoint".
AgentB - it's a package (an agent-container) containing parcels (AgentA). This AgentB has a parameter "DeliveryPoint" too that depends on the "DeliveryPoint" of the parcel (AgentA) delivering at the moment.
I need to count agents AgentA in the agent-container AgentB which meet the given condition:
AgentA.DeliveryPoint == AgentB.DeliveryPoint
I tried this expression:
count(agentB.contents(), p -> ((AgentA)agentB.contents()).DeliveryPoint == agentB.DeliveryPoint))
Code example:
private void _movingToDeliveryPoint_onExit_xjal( final com.anylogic.libraries.processmodeling.Delay<AgentB> self, AgentB agent ) {
traceln(count(agent.contents(), p -> ((AgentA)agent.contents()).DeliveryPoint == agent.DeliveryPoint));
}
but when I run my Model, I recieve this error in the block "Delay" ("movingToDeliveryPoint") that executes this code:
java.base/java.util.Collections$UnmodifiableList cannot be cast to smm_chain.AgentA
java.lang.ClassCastException: java.base/java.util.Collections$UnmodifiableList cannot be cast to smm_chain.AgentA
at smm_chain.sc.lambda$0(sc.java:5168)
at com.anylogic.engine.UtilitiesCollection.count(Unknown Source)
at smm_chain.sc._movingToDeliveryPoint_onExit_xjal(sc.java:5168)
at smm_chain.sc.access$25(sc.java:5163)
at smm_chain.sc$17.onExit(sc.java:2319)
at smm_chain.sc$17.onExit(sc.java:1)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay.b(Unknown Source)
at com.anylogic.libraries.processmodeling.Delay$6.onExit(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBuffer.c(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBuffer.c(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBuffer$1.onExit(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.c(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$1.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.receiveImmediately(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$2.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$2.action(Unknown Source)
at com.anylogic.libraries.processmodeling.AsynchronousExecutor_xjal.executeActionOf(Unknown Source)
at com.anylogic.engine.EventTimeout.execute(Unknown Source)
at com.anylogic.engine.Engine.b(Unknown Source)
at com.anylogic.engine.Engine.nb(Unknown Source)
at com.anylogic.engine.Engine.k(Unknown Source)
at com.anylogic.engine.Engine$a.run(Unknown Source)
Could you help me?
Thanks a lot!
You cannot use agentB.contents(). Although it looks like a good method, it is not supposed to be used by modellers.
Also, do not compare objects using ==. Use the equals() method instead.
Do this, assuming you have a population or list named myAgentsA of AgentA within AgentB:
count(myAgentsA, a->a.DeliveryPoint.equals(DeliveryPoint))
This assumes you call the code from within AgentB

Issue displaying a map with java [duplicate]

This question already has answers here:
What is a NullPointerException, and how do I fix it?
(12 answers)
Closed 5 years ago.
I currently am trying to make a risk-like game and as I try to display a map (vectorial image) I have a NullPointerException that I do not understand at all how it can be solved. =/
Here's the code :
public class Test1 extends Stage {
private BorderPane root = new BorderPane();
private WebView browser = new WebView();
public Test1(){
this.setTitle("Test1");
this.setScene(new Scene(content()));
}
Parent content(){
WebEngine webEngine = browser.getEngine();
webEngine.load(this.getClass().getResource("../../resources/worldMap.html").toExternalForm());
root.setCenter(browser);
return root;
}
}
and the error :
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at hmi.Test1.content(Test1.java:23)
at hmi.Test1.<init>(Test1.java:18)
at Main.start(Main.java:13)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
... 1 more
Exception running application Main
So it seems to be caused by the link "../../resources/worldMap.html" but it really leads to the file. I also tried with a svg file or with an url (this one : https://upload.wikimedia.org/wikipedia/commons/8/80/World_map_-_low_resolution.svg )
and I still have the exact same error.
It's been a day I'm stuck on that despite my researchs on internet, so I hope you will be able to help me.
Thanks !
I can't say for certain from the pasted code, but I think I can help you debug it. You've identified webEngine.load(this.getClass().getResource("../../resources/worldMap.html").toExternalForm()); as the errant line in one of your comments.
The NPE means one of the things you are using in that line is null in an unexpected way. Are you using an IDE with a debugger? Set a break-point on that line and evaluate each subcomponent.
If not, you really should try one. I use intellij and find it makes me far more effective and efficient. In the interim, the hackiest simplest way to figure this out is with a bunch of print statements
System.out.println("webEngine" + webEngine);
System.out.println("class" + this.getClass());
System.out.println("resource" + this.getClass().getResource("../../resources/worldMap.html"));
System.out.println("loaded" + webEngine.load(this.getClass().getResource("../../resources/worldMap.html"));
One of these things will be null and the next line will throw an NPE. That way, you'll know where in the stack you have a problem. Please post back when you find it. I would guess that either using the this.getClass.getResource is wrong or the place you think the relative path starts from in your path string is wrong (usually it is relative to where your .class paths are written).
Have you tried using an absolute path instead to load your resource? It's possible where you think your code is executing from and where it's actually executing from are different.
Ok, I finally found out the answer.
My question is actually a duplicate of Class.getResource() returns null
And the answer was that the image had to be in the same directory as the package where the class on which I apply the "getclass" is, while it was in the root of the project.
Thank you for your help though !

Unable to convert a SVG image to PNG using batik rasterizer

I am trying to convert images from SVG to PNG using the batik rasterizer (batik-transcoder 1.8) library, but even a simple conversion throws me an exception. This is a sample code which does not work:
private static void convertSVGToImage() throws TranscoderException, IOException {
String svg_URI_input = Paths.get("caution.svg").toUri().toURL().toString();
TranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);
OutputStream png_ostream = new FileOutputStream("caution.png");
TranscoderOutput output_png_image = new TranscoderOutput(png_ostream);
PNGTranscoder my_converter = new PNGTranscoder();
my_converter.transcode(input_svg_image, output_png_image);
png_ostream.flush();
png_ostream.close();
}
Where caution.svg is this file: http://dev.w3.org/SVG/tools/svgweb/samples/svg-files/caution.svg
And the stacktrace is:
org.xml.sax.SAXNotRecognizedException: unrecognized feature http://xml.org/sax/features/external-general-entities
at org.gjt.xpp.sax2.Driver.setFeature(Driver.java:178)
at org.gjt.xpp.jaxp11.SAXParserImpl.setFeatures(SAXParserImpl.java:149)
at org.gjt.xpp.jaxp11.SAXParserImpl.<init>(SAXParserImpl.java:132)
at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.newSAXParserImpl(SAXParserFactoryImpl.java:114)
at org.gjt.xpp.jaxp11.SAXParserFactoryImpl.setFeature(SAXParserFactoryImpl.java:142)
at org.apache.batik.dom.util.SAXDocumentFactory.<clinit>(Unknown Source)
at org.apache.batik.transcoder.SVGAbstractTranscoder.createDocumentFactory(Unknown Source)
at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
at br.com.supera.Main.convertSVGToImage(Main.java:45)
at br.com.supera.Main.main(Main.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Exception in thread "main" org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
not supported setting property http://xml.org/sax/properties/lexical-handler
at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
at br.com.supera.Main.convertSVGToImage(Main.java:45)
at br.com.supera.Main.main(Main.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Any help is appreciated.
I just solved it by simply using batik 1.7.1.

Setting up the JavaSci in CMD

Peace be upon you,
Based on this link, I followed the required steps for setting up the JavaSci in Windows; but I encounter this problem
c:\Backups>javac -cp "C:\Program Files\scilab-5.5.0\modules\javasci\jar\org.scilab.modules.javasci.jar;C:\Program Files\scilab-5.5.0\modules\types\jar\org.scilab.modules.types.jar";. TestSciLab.java
c:\Backups>set PATH=%PATH%;"C:\Program Files\scilab-5.5.0\bin"
c:\Backups>java -cp "C:\Program Files\scilab-5.5.0\modules\javasci\jar\org.scilab.modules.javasci.jar;C:\Program Files\scilab-5.5.0\modules\types\jar\org.scilab.modules.types.jar";. TestSciLab
The native library javasci does not exist or cannot be found.
java.lang.UnsatisfiedLinkError: no javasci in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at org.scilab.modules.javasci.Call_ScilabJNI.<clinit>(Unknown Source)
at org.scilab.modules.javasci.Call_Scilab.SetFromJavaToON(Unknown Source)
at org.scilab.modules.javasci.Scilab.initScilab(Unknown Source)
at org.scilab.modules.javasci.Scilab.<init>(Unknown Source)
at org.scilab.modules.javasci.Scilab.<init>(Unknown Source)
at TestSciLab.main(TestSciLab.java:7)
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.scilab.modules.javasci.Call_ScilabJNI.SetFromJavaToON()V
at org.scilab.modules.javasci.Call_ScilabJNI.SetFromJavaToON(Native Method)
at org.scilab.modules.javasci.Call_Scilab.SetFromJavaToON(Unknown Source)
at org.scilab.modules.javasci.Scilab.initScilab(Unknown Source)
at org.scilab.modules.javasci.Scilab.<init>(Unknown Source)
at org.scilab.modules.javasci.Scilab.<init>(Unknown Source)
at TestSciLab.main(TestSciLab.java:7)
c:\Backups>
The only difference that you see in the above screen and the guides in the link is the place of %path% that I moved it to the beginning. But do not doubt! even I checked it with the reverse order and I got the error.
My code is as simple as
import org.scilab.modules.javasci.JavasciException.InitializationException;
import org.scilab.modules.javasci.Scilab;
public class TestSciLab {
public static void main(String[] args) throws InitializationException {
Scilab sci = new Scilab();
}
}
Any lighting up points?
On Windows, you just need to add Scilab's bin folder to %PATH%.

creating XSD using jaxb schemagen

i am learning JAXb 2.0 and is new to it.
i am trying to generate XSD based on y POJO classes using schemagen and for simple classes it working fine but when my class contains refrence to other classes
schemagen is giving me error below is the error trace for the same
Problem encountered during annotation processing;
see stacktrace below for more information.
java.lang.NullPointerException
at com.sun.tools.jxc.model.nav.APTNavigator$2.onDeclaredType(APTNavigator.java:436)
at com.sun.tools.jxc.model.nav.APTNavigator$2.onClassType(APTNavigator.java:410)
at com.sun.tools.jxc.model.nav.APTNavigator$2.onClassType(APTNavigator.java:464)
at com.sun.istack.tools.APTTypeVisitor.apply(APTTypeVisitor.java:27)
at com.sun.tools.jxc.model.nav.APTNavigator.getBaseClass(APTNavigator.java:113)
at com.sun.tools.jxc.model.nav.APTNavigator.getBaseClass(APTNavigator.java:89)
at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.getIndividualType(PropertyInfoImpl.java:195)
at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.<init>(PropertyInfoImpl.java:137)
at com.sun.xml.bind.v2.model.impl.MapPropertyInfoImpl.<init>(MapPropertyInfoImpl.java:71)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.createMapProperty(ClassInfoImpl.java:928)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.addProperty(ClassInfoImpl.java:885)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findGetterSetterProperties(ClassInfoImpl.java:1004)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:314)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:247)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:213)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:319)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:334)
at com.sun.tools.xjc.api.impl.j2s.JavaCompilerImpl.bind(JavaCompilerImpl.java:94)
at com.sun.tools.jxc.apt.SchemaGenerator$1.process(SchemaGenerator.java:119)
at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
at com.sun.tools.apt.main.Main.compile(Main.java:1102)
at com.sun.tools.apt.main.Main.compile(Main.java:964)
at com.sun.tools.apt.Main.processing(Main.java:95)
at com.sun.tools.apt.Main.process(Main.java:85)
at com.sun.tools.apt.Main.process(Main.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.jxc.SchemaGenerator$Runner.main(SchemaGenerator.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:177)
at com.sun.tools.jxc.SchemaGenerator.run(SchemaGenerator.java:81)
at com.sun.tools.jxc.SchemaGenerator.main(SchemaGenerator.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.tools.jxc.SchemaGeneratorFacade.main(SchemaGeneratorFacade.java:60)
C:\Users\Desktop\jaxb\jaxb-ri-20101119\bin\src\com\tr\model\destination\Destination.java:9: package com.tr.model.address does not exist
import com.tr.model.address.BasicAddress;[code]
below is the detail of my folder structure
schemagen is located at the following location
C:\Users\Desktop\jaxb\jaxb-ri-20101119\bin
My Java class based on which i am trying to generate xsd is at the following location
C:\Users\Desktop\jaxb\jaxb-ri-20101119\bin\src\com\tr\model\destination
Destination.java
while all other classes being refrenced from Destination as well as the class itself are inside the following structure
C:\Users\Raisonne\Desktop\jaxb\jaxb-ri-20101119\bin\src\com\raisonne\tr\model
i know the problem is with the setting of classpath but i am unable to figure it out ho to set correct classpath for this case
i tried to set system's CLASSPATH variable to the value of
C:\Users\Raisonne\Desktop\jaxb\jaxb-ri-20101119\bin\src\com\raisonne\tr\model as well other 2 mentioned in my post but nothing worked out.
can any one help me in setting classpath for the schemagen.
thanks in advance
Umesh
it seems you have set package declaration of your class to
com.tr.model.address
where it should be from your dir structure
com.tr.model.destination

Categories

Resources