javax.jws.Oneway


#1

@pspeed (or any one else who knows)
What is the reason that javax.jws.Oneway is being checked for in com.jme3.network.service.rmi.MethodInfo ?

I am currently working on a pr for JDK11 build support, and javax.jws is no longer part of the JavaSE JDK for java 11. I just am not entirely sure what checking for Oneway is doing, as I do not believe that jws is used anywhere else in the networking system.

Thanks,
Trevor


#2

It’s an indicator that the method can be called asynchronously because no response is required.

It’s possible (though tricky) to write service code that is non-JME specific… in which case I tried to find existing annotations that could indicate async calls. Oneway was one of those.

I guess you can comment it out to see how much farther you get. Seems like JDK11 is going to require a ton of changes, maybe.


#3

So far it has required a couple small ones. I just out the use of javax.xml.bind in the glTF plugin and replaced it with java.util.Base64.
Other ones are replacing the use of javah with javap in the gradle build scripts.

EDIT: I am not going to implement modules, just get it building in JDK 11


#4

So @pspeed you might have some input on this, I am having issues getting a working replacement for javah. It is the last thing that roadblocking this build. The javac -h command will make headers, but it needs the entire source tree.

This is an example of the jme3-bullet gradle file, it would make the headers if it had access to the source tree.

if (!hasProperty('mainClass')) {
    ext.mainClass = ''
}

sourceSets {
    main {
        java {
            srcDir 'src/main/java'
            srcDir 'src/common/java'
        }
    }
}

dependencies {
    compile project(':jme3-core')
    compile project(':jme3-terrain')
}

task generateNativeHeaders(type: Exec, dependsOn: classes) {
    /*
    def classes = " \
        com.jme3.bullet.PhysicsSpace, \
        \
        com.jme3.bullet.collision.PhysicsCollisionEvent, \
        com.jme3.bullet.collision.PhysicsCollisionObject,\
        com.jme3.bullet.objects.PhysicsCharacter, \
        com.jme3.bullet.objects.PhysicsGhostObject, \
        com.jme3.bullet.objects.PhysicsRigidBody, \
        com.jme3.bullet.objects.PhysicsVehicle, \
        com.jme3.bullet.objects.VehicleWheel, \
        com.jme3.bullet.objects.infos.RigidBodyMotionState, \
        \
        com.jme3.bullet.collision.shapes.CollisionShape, \
        com.jme3.bullet.collision.shapes.BoxCollisionShape, \
        com.jme3.bullet.collision.shapes.CapsuleCollisionShape, \
        com.jme3.bullet.collision.shapes.CompoundCollisionShape, \
        com.jme3.bullet.collision.shapes.ConeCollisionShape, \
        com.jme3.bullet.collision.shapes.CylinderCollisionShape, \
        com.jme3.bullet.collision.shapes.GImpactCollisionShape, \
        com.jme3.bullet.collision.shapes.HeightfieldCollisionShape, \
        com.jme3.bullet.collision.shapes.HullCollisionShape, \
        com.jme3.bullet.collision.shapes.MeshCollisionShape, \
        com.jme3.bullet.collision.shapes.PlaneCollisionShape, \
        com.jme3.bullet.collision.shapes.SimplexCollisionShape, \
        com.jme3.bullet.collision.shapes.SphereCollisionShape, \
        \
        com.jme3.bullet.joints.PhysicsJoint, \
        com.jme3.bullet.joints.ConeJoint, \
        com.jme3.bullet.joints.HingeJoint, \
        com.jme3.bullet.joints.Point2PointJoint, \
        com.jme3.bullet.joints.SixDofJoint, \
        com.jme3.bullet.joints.SixDofSpringJoint, \
        com.jme3.bullet.joints.SliderJoint, \
        com.jme3.bullet.joints.motors.RotationalLimitMotor, \
        com.jme3.bullet.joints.motors.TranslationalLimitMotor, \
        \
        com.jme3.bullet.util.NativeMeshUtil, \
        com.jme3.bullet.util.DebugShapeFactory"
        */
       def classes = " \
        ../jme3-bullet/src/main/java/com/jme3/bullet/PhysicsSpace.java, \
        \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionEvent.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/PhysicsCollisionObject.java,\
        ../jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsCharacter.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsGhostObject.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsRigidBody.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/objects/PhysicsVehicle.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/objects/VehicleWheel.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/objects/infos//RigidBodyMotionState.java, \
        \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/BoxCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CompoundCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/ConeCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/GImpactCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HeightfieldCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/HullCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/MeshCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/PlaneCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SimplexCollisionShape.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java, \
        \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/PhysicsJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/ConeJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/HingeJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/Point2PointJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/SixDofSpringJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/SliderJoint.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/motors/RotationalLimitMotor.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/joints/motors/TranslationalLimitMotor.java, \
        \
        ../jme3-bullet/src/main/java/com/jme3/bullet/util/NativeMeshUtil.java, \
        ../jme3-bullet/src/main/java/com/jme3/bullet/util/DebugShapeFactory.java"
    def classpath = sourceSets.main.runtimeClasspath.asPath
    def nativeIncludes = new File(project(":jme3-bullet-native").projectDir, "src/native/cpp")

    executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac')
    args "-h", nativeIncludes
    //args "-classpath", classpath
    args classes.split(",").collect { it.trim() }
}

assemble.dependsOn(generateNativeHeaders)

#5

o_O

…Java just keeps getting worse and worse with each new version. Maybe they should just remove jni altogether.

Not sure how to help. I have no idea why you need to whole source tree just to generate headers.


#6

LOL, OK.

I agree, I see no reason to remove javah. The other hack I saw uses javap, but requires a batch script to work (or someone who is good at using gradle, which I am not)


#7

I remember seeing that recent versions of Gradle have support for javac -h. I don’t recall it needing the whole tree.


#8

Thanks @sgold I got javac -h working, it was not simple… (and was kinda hacky)


#9

How do I get gradle to build the android-natives? I need to test the javac -h workaround on them

EDIT: I think I have them building, not entirely clear on that though…