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

ARTEMIS-565 Replace json.org with javax.json #640

Closed
wants to merge 1 commit into from

Conversation

johnament
Copy link
Contributor

Javax.json is a newer JSR, but has an ASF compliant version, is pretty close to the original JSON.org API and will support a standard annotation based JSON-B solution at some point soon.

This is for discussion purposes only at this point.

@mtaylor
Copy link
Contributor

mtaylor commented Jul 19, 2016

@johnament +1 on this. TBH I don't really mind which library we use as long as it's Apache compliant and doesn't have silly phrases in the license :P. This looks good to me.

@puntogil
Copy link

hi
thanks for your work
is possible remove from LICENSE file the json.org (license) referencies
regards

@johnament
Copy link
Contributor Author

@puntogil yep, that's why i'm not saying this is ready.

@mtaylor Ok, I'll clean it up.

Thanks for looking at this guys!

@johnament johnament force-pushed the ARTEMIS-565 branch 2 times, most recently from 4439d23 to c655298 Compare July 21, 2016 21:11
@johnament
Copy link
Contributor Author

Ok, the changes should be good. I manually ran the integration tests that were touched, and fixed a bunch of issues identified there.

I'm going to create a ticket to create more lower level json tests. They're a good way to verify contracts in a situation like this. If I were starting this over, I would have added the contracts first.

@johnament
Copy link
Contributor Author

I'm not sure why Jenkins didn't write the result back, but the build did pass in Jenkins.

@clebertsuconic
Copy link
Contributor

@johnament this looks good to me. Are you done here? Can I merge it.

@clebertsuconic
Copy link
Contributor

you can't run a server. There is some changes needed on the release packaging:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/json/JsonValue
    at org.apache.activemq.artemis.uri.schema.connector.TCPTransportConfigurationSchema.getTransportConfigurations(TCPTransportConfigurationSchema.java:68)
    at org.apache.activemq.artemis.uri.schema.serverLocator.TCPServerLocatorSchema.internalNewObject(TCPServerLocatorSchema.java:43)
    at org.apache.activemq.artemis.uri.schema.serverLocator.TCPServerLocatorSchema.internalNewObject(TCPServerLocatorSchema.java:33)
    at org.apache.activemq.artemis.utils.uri.URISchema.newObject(URISchema.java:87)
    at org.apache.activemq.artemis.utils.uri.URISchema.newObject(URISchema.java:30)
    at org.apache.activemq.artemis.utils.uri.URIFactory.newObject(URIFactory.java:59)
    at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.newLocator(ServerLocatorImpl.java:413)
    at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.<init>(ActiveMQConnectionFactory.java:179)
    at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.<init>(ActiveMQConnectionFactory.java:199)
    at org.apache.activemq.artemis.cli.commands.Producer.execute(Producer.java:52)
    at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:110)
    at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:72)
    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 org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:122)
    at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:45)
Caused by: java.lang.ClassNotFoundException: javax.json.JsonValue

@johnament
Copy link
Contributor Author

Ah good catch. I can fix that, probably some assembly issues. I'm assuming shipping johnzon as the default is fine?

@clebertsuconic
Copy link
Contributor

Looks fine to me.

I reversed engineered the code and I'm not sure how you specify the JSON provider. it seems you need something on the CLASSINFO?

Also, I just realized the main pom doesn't specify the licenses. a small thing but since you're changing it, can you also do it? will comment at the pom to make it easier to find it.

<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-json_1.0_spec</artifactId>
<version>${json-p.spec.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind mentioning Apache license here, just to keep up the list?

@clebertsuconic
Copy link
Contributor

@johnament how users doing embedded will use json? anything special they have to do? or just the maven dependencies would catch it?

@johnament
Copy link
Contributor Author

@clebertsuconic yes, once i fix the distribution the johnzon one will ship by default.

@clebertsuconic
Copy link
Contributor

@johnament I was thinking about embedded cases (using the library direct), like wildfly.

We can fix whatever needs on wildfly for next versions.. so I was really thinking about other cases.. I will look through the examples.

Maybe you could also check it by running artemis-distribution/src/test/scripts/run-examples.sh after building the server.

@johnament
Copy link
Contributor Author

@clebertsuconic oh, for wildfly, you'll need to add dependencies on javax.json.api and org.glassfish.javax.json modules.

As far as plain library usage, the dependency tree should come in. If you want to plugin your own, just exclude.

@clebertsuconic
Copy link
Contributor

@johnament cool.. thanks a lot.
And sorry for my delay on this. was in vacations last week. :)

Javax.json is a newer JSR, but has an ASF compliant version, is pretty close to the original JSON.org API and will support a standard annotation based JSON-B solution at some point soon.
Updated integration tests and removed JSON.org from license.
@johnament
Copy link
Contributor Author

No problems @clebertsuconic hope it went well.

I pushed up fixes, one oddity is that when starting the broker I get this on the console...

20:50:26,422 INFO  [org.apache.activemq.artemis.core.server] Checking...
20:50:28,425 INFO  [org.apache.activemq.artemis.core.server] Checking...
20:50:30,428 INFO  [org.apache.activemq.artemis.core.server] Checking...

Not sure if its related to my changes, or something else.

@johnament
Copy link
Contributor Author

I just checked. its happening with my changes. I can't find this log message anywhere though.

@jbertram
Copy link
Contributor

You need to rebase. That issue was resolved last week I believe.

@clebertsuconic
Copy link
Contributor

I checked your commit and it was ok.

(I always use this script to merge PRs which will always rebase them, that's probably why it was ok)...
https://github.com/apache/activemq-artemis/blob/master/scripts/merge-PR.sh

no need to rebase on that case

@asfgit asfgit closed this in 110158b Jul 26, 2016
@clebertsuconic
Copy link
Contributor

I included 2 lines change features.xml towards the OSGI bundle and I squashed into your commit. I hope you won't mind. It was easier this way.

@clebertsuconic
Copy link
Contributor

@johnament can you assign this JIRA to yourself? I couldn't find you (don't know why):

https://issues.apache.org/jira/browse/ARTEMIS-565

@johnament
Copy link
Contributor Author

I pinged the PMC to add me as contributor. That will allow JIRA assignment.

I must have had something cached, as this was after I rebased.

@johnament johnament deleted the ARTEMIS-565 branch July 26, 2016 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants