Solution of * doesnt contain ObjectFactory.class or jaxb.index

For some reason while unmarshalling something you get this error
Solution is:
Instead of

javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance("oasis.names.specification.ubl.schema.xsd.invoice_2");
or
JAXBContext context = JAXBContext.newInstance(inv.getClass().getPackage().getName());

Use a notation like this

javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(oasis.names.specification.ubl.schema.xsd.invoice_2.InvoiceType.class);

Where InvoiceType will be the thing you [...]

How to validate XML with XSD in Java

After initializing xsd with JAXB Binding on Netbeans, you can use a method like this.
Both JAXB binding and schema are same but as far as i see, JAXB unmarshalling doesn’t validate XML, it just transforms it.

package unmarshallertest;

import java.io.*;
import javax.xml.bind.*;
import javax.xml.validation.*;
import oasis.names.specification.ubl.schema.xsd.invoice_2.*;

public class Main {
public static void main(String[] args) {
[...]

JXTA

Trying to write multi-user applications, the need of a server always disturbs me
It would be good to achieve a connection between two peers without openning a port, for example in web applications, without going through server
For this reason i searched about P2P a little bit
The best solution seems to be JXTA
I thought maybe it may [...]

JavaFX and Facebook – Part 2

My first post describes how to deploy a JavaFX application to Facebook but I realized that it gives some errors on most computers, and it is not very practical
Here I will give a more clear example
My application is a Sudoku Solver, you can see it from the Pages of my site
One major problem that i [...]

JavaFX/Java Chat Program

Here is another chat program, using JavaFX for GUI and Java on the background for SQL transactions.
One thing I realized is that you can’t bind to variables from JavaFX to Java Threads.
Using timelines instead of threads are better.
Code is pretty self explanatory:
( You should add mysql-connector-java-5.1.7-bin.jar (or newer) mysql library in order to connect mysql [...]

Java/SQL Chat Program

It is probably the worst code I have written but it is the first time i use SQL.
The program just inserts messages into a table than updates the textarea by querying for all the messages.
There is an ID option in table for the use of session. If modified a program can only see the messages [...]

Using Xerxes API on Java to find the tag(s) of a given string

Homepage of Xerxes Java API
Javadoc
The task was to search for a tag including a given string

<something> stringtofind </something>

if we are searching for “stringtofind”, “something” is an answer
Here is the code:
Main.java:

package xerxes;

public class Main {

public static void main(String[] args) {
getTagname outp=new getTagname("http://kaansoral.com/deneme.xml","abidin");
[...]

Java code to generate sequence of arithmetic operations

There is no operation precedence on generated expression, number at any state can’t be

METU CENG242 Hw3 Input Output

Problem Statement
Some of the input outputs in raw form
Inputs:

a=(new 10)
b=(negate (new 10))
c=insert ((2,3),(8,9)) (new 10)
d=delete ((5,5),(5,5)) (delete ((8,1),(9,8)) (negate (new 10)))
[...]

METU CENG242 Haskell HW2

Problem Statement
The Code
Hw2_Data
The task is to implement dynamic binding for function calls.
Returning error outputs is a little bit tricky.
Other than that, fullfilling requirements is not so hard with functional programming.
When a new function call (CallFunc) comes, the scopes list is updated with that functions own declerations.
When that function call ends, our own scope list is [...]