Giter VIP home page Giter VIP logo

navajo's Introduction

Navajo Service-oriented Applications

See the Navajo, Tipi, and Enterprise wikis for more information.

Build status: CircleCI

navajo's People

Contributors

aphilip avatar aschoneveld avatar billgemist avatar carloatdexels avatar dexelsbutler avatar flyaruu avatar jposthumus avatar jrtaal avatar kharybdys avatar mbergman avatar michiatdexels avatar ramydexels avatar rfrankhuizen avatar roelofkemp avatar ruben021 avatar stefanict avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

navajo's Issues

OSGi console has no pom.xml file.

Furthermore, even though it is actually an OSGi console plugin, it is Equinox specific, so not all that useful now. The Felix GOGO shell is more popular and will (?) get to be the official specified way to make OSGi console plugins.

navajo DTAP variable

DTAP variable

I would like to see a new variable introduced in Navajo. DTAP:
Development
Testing
Acceptance
Production

Replace included binaries with proper Maven dependencies

The Navajo runtime project com.dexels.navajo.runtime.dependencies includes some binaries;

com.oracle.jdbc.driver_11.2.33.jar
org.apache.felix.bundlerepository-1.6.6.jar
org.apache.felix.eventadmin-1.2.14.jar
org.apache.felix.gogo.command_0.12.0.jar
org.apache.felix.gogo.runtime_0.10.0.jar
org.apache.felix.gogo.shell_0.10.0.jar
org.apache.felix.http.api-2.2.0.jar
org.apache.felix.http.base-2.2.0.jar
org.apache.felix.http.bridge-2.2.0.jar
org.apache.felix.http.bundle-2.2.0.jar
org.apache.felix.http.whiteboard-2.2.0.jar
org.apache.felix.log-1.0.1.jar
org.apache.felix.metatype-1.0.4.jar
org.apache.felix.prefs-1.0.4.jar
org.apache.felix.scr-1.6.0.jar
org.apache.felix.scr.annotations-1.6.0.jar
org.apache.felix.scr.generator-1.1.4.jar
org.apache.felix.webconsole-3.1.8.jar
org.mozilla.javascript_1.7.2.v201005080400.jar
osgi.enterprise.jar

Most are felix dependencies, I need to add them and suppress additional unwanted dependencies by supplying 'provided' scope dependencies.

Two reasons:

  • Licence issues (esp. the oracle driver, maybe just move that one to enterprise, for less visibility?)
  • It grows the repo too much.

Remove all split packages

Navajo used to rely a lot on split packages (for the record, a split package is a package that exists in multiple jars / bundles)

Split packages can cause a few problems:

OSGi does not like them, as you will (should actually) define dependencies by referencing required packages. OSGi will then look for any bundle that exports that package, and wire the dependency to this package. This is not what you want, as you get a more or less 'random' implementation, instead of a concatenation of all of those packages.

Second: Java classloaders will refuse loading classes from the same package from different jars if the signing information is different. I want to use the same jars throughout (webstart, Eclipse plugins, servlets) so the only way to do that is by signing all bundles.

To fix this:
Actually renaming the packages isn't that tricky any more since we've moved away from CVS, but for functions and adapters it might still break a lot.

  • Functions are only a problem in TSL. In navascript they are simply identified by name, and resolved by the function manifest. TSL demands that they are in com.dexels.navajo.functions, I think.
  • Adapters Mostly problematic in TSL, as there they are referenced with their fully qualified name, so changing a package will break all scripts using it.

Ugly shutdown errors in Tomcat

When shutting down a Felix/Navajo instance, Tomcat will show a lot of errors.

Tomcat indicates that it isn't a big deal, and shouldn't be a problem, but it is ugly nonetheless.

I think that the problem is that Tomcat shuts down the webapp classloader before the OSGi runtime has completely stopped

All bundles in the adapters folder get re-installed at startup

As the bundle state is persistant, it shouldn't be necessary to always do that.

Not doing that should speed up server startup times, secondly, it will reduce the annoying 'State change in progress errors'

Example

org.osgi.framework.BundleException: State change in progress for bundle       "file:/Users/frank/git/demo/navajo/example/com.dexels.navajo.example/adapters/com.dexels.navajo.example.listener_1.0.0.201206261639.jar" by thread "fileinstall-/Users/frank/git/demo/navajo/example/com.dexels.navajo.example/adapters".
at org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1087)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.suspendBundle(PackageAdminImpl.java:329)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.processDelta(PackageAdminImpl.java:466)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:251)
at org.eclipse.osgi.framework.internal.core.PackageAdminImpl$1.run(PackageAdminImpl.java:173)
at java.lang.Thread.run(Thread.java:680)

Oracle OJDBC6.jar problem

Dit ter info voor later.
Na wat spontane problemen met opstarten van de clubapp, blijkt dat de combinatie jdk.1_6_30 met ojdbc6 niet goed werkt.
Eigenlijk zelfs nog wat vreemder, want het heeft de hele tijd wel gewerkt, maar ineens niet meer. Update van iets????
Probleem zit 'm in het uitlezen van een BLOB field uit de database. getString op zo'n veld met de waarde null levert een SQLException op.
Om te voorkomen al te ver de diepte in te gaan, heb ik de boel nu weer werkend met de combinatie jdk.1_6_29 en ojdbc14.
Is dus wel iets waar we wat mee moeten in de toekomst.

Make all dependencies on JUnit optional

Now, even for small light-weight solutions, we need to supply junit and hamcrest, otherwise it refuses to budge.

Makes no sense for a production environment.

Ideally, we should split off the testing code altogether

  • Separate bundles?
  • Fragments
  • Refactor them as pure 'build code'

Javascript Performance

Heb performance van Javascript compiler bekeken. De 'hotspot' (99.9% van de tijd) zit hier:

cx.evaluateReader(globalScope, includeCompiledReader, "includeCompiled.js", 1, null);
cx.evaluateReader(globalScope, includeReader, "include.js", 1, null);
cx.evaluateReader(globalScope, fileReader, a.getRpcName()+ ".js", 1, null);

Met name evalueren van includeCompiled.js kost altijd zo'n 30-40ms... ook voor kleine scriptjes... Volgens mij wordt include.js niet gebruikt.
Is het op een of andere manier niet mogelijk om de includeCompiled.js evaluatie te 'sharen'??

Wat betreft het re-used van includeCompiled.js. Dat is volgens mij mogelijk, ongeveer zoals hieronder.
Dan is het echter wel handig dat de RhinoRunner wordt ge-reused...

Reader includeCompiledReader = getIncludeReader("includeCompiled.js");
Context cx = Context.enter();
includedScope = cx.initStandardObjects();
cx.evaluateReader(includedScope, includeCompiledReader, "includeCompiled.js", 1, null);

    ScriptableObject scope = (ScriptableObject) cx.initStandardObjects(includedScope);

Hier staan ook nog wat performance improvement tips:

http://code.google.com/p/wro4j/wiki/RhinoPerformanceImprovement

Port all OSGi commands to Gogo

Shell commands were never part of the OSGi specification, hence Felix and Equinox built vastly different versions. The version of Apache Felix (called 'gogo') is superior and is now the official standard api for OSGi consoles. From Equinox 3.8 on, Equinox will also support this shell.

We've made a few (3 or 4 I think) OSGi commands for Equinox, we need to port them to Gogo, so they'll work both under Felix and Equinox.

Oracle Exception with latest SPMap and null valued Binary parameters

When a Oracle SP is passed a null valued Binary parameter, the call fails.
I think the problem is here (in SPMap.java):

if ( (param == null) || (param instanceof NavajoType && ((NavajoType) param).isEmpty() ) ) {
callStatement.setNull(i + 1, Types.VARCHAR );
}

For Binary it should just perform the setBlob() method, even if its empty.

JOGL 3d accelerated Tipi libraries don't build well

The build would work, but I've removed them from the total build because I can't get the target platform 'right' for all different platforms.

If I export the jogamp packages on a Mac, the build will work on a Mac, but not on others. I could export it on Linux so the CI works, but that would not help us much. For now, I still hope Nexus will finish it's p2 support so all these problems just go away.

<break/> in Javascript compiled Navascript

break binnen map geeft wat verwarrende melding....

440525 [KNVBOntwikkelArjen/1337180848720-81] INFO ROOT - Debug: BEFORE BREAK....
440527 [KNVBOntwikkelArjen/1337180848720-81] ERROR com.dexels.navajo.rhino.RhinoRunner - ScriptStack:
at includeCompiled.js:21 (callMap)
at vla/relation/entity/oracle/UpdateOrganizationMember.js:267
at includeCompiled.js:305 (addField)
at vla/relation/entity/ProcessUpdateOrganizationMember.js:297 (anonymous)
at includeCompiled.js:12 (callMap)
at vla/relation/entity/ProcessUpdateOrganizationMember.js:295
at includeCompiled.js:305 (addField)
at vla/syncunion/tounion/ProcessDeleteMemberFunction.js:312 (anonymous)
at includeCompiled.js:12 (callMap)
at vla/syncunion/tounion/ProcessDeleteMemberFunction.js:299 (anonymous)
at includeCompiled.js:222 (forEachMessage)
at vla/syncunion/tounion/ProcessDeleteMemberFunction.js:298

o: org.mozilla.javascript.Undefined@18fd54ec
440527 [KNVBOntwikkelArjen/1337180848720-81] ERROR com.dexels.navajo.rhino.RhinoRunner - Other exception:
org.mozilla.javascript.JavaScriptException: undefined (includeCompiled.js#21)
at org.mozilla.javascript.gen.includeCompiled_js_259._c_callMap_1(includeCompiled.js:21)
at org.mozilla.javascript.gen.includeCompiled_js_259.call(includeCompiled.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.vla_relation_entity_oracle_UpdateOrganizationMember_js_261._c_script_0(vla/relation/entity/oracle/UpdateOrganizationMember.js:267)
at org.mozilla.javascript.gen.vla_relation_entity_oracle_UpdateOrganizationMember_js_261.call(vla/relation/entity/oracle/UpdateOrganizationMember.js)
at org.mozilla.javascript.gen.vla_relation_entity_oracle_UpdateOrganizationMember_js_261.exec(vla/relation/entity/oracle/UpdateOrganizationMember.js)
at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
at com.dexels.navajo.rhino.RhinoRunner.runScript(RhinoRunner.java:241)
at com.dexels.navajo.rhino.RhinoRunner.run(RhinoRunner.java:368)
at com.dexels.navajo.rhino.RhinoCompiledScript.execute(RhinoCompiledScript.java:38)
at com.dexels.navajo.mapping.CompiledScript.run(CompiledScript.java:282)
at com.dexels.navajo.rhino.RhinoHandler.doService(RhinoHandler.java:38)
at com.dexels.navajo.server.ServiceHandler.construct(ServiceHandler.java:63)
at com.dexels.navajo.persistence.impl.PersistenceManagerImpl.get(PersistenceManagerImpl.java:150)
at com.dexels.navajo.server.Dispatcher.dispatch(Dispatcher.java:445)
at com.dexels.navajo.server.Dispatcher.processNavajo(Dispatcher.java:1054)

Create separate plugin com.dexels.navajo.client.jabber

We only use package imports anyway (of those select few bundles), so we should be able to do this transparently.
This will release us of the strict dependency com.dexels.navajo.client has on the jabber libraries (smack and smackx)

Prevent infinite loop in navajomap to same web service

Implement a run-time mechanism to detect infinite loops in navajomap calls to the same webservice...
Could be subtle because a call to same webservice might be valid if a different branch of the script is followed...
Somehow Navajo Runtime should be able to detect loops...

Create Maven Build for Tipi App Store

Once the Navajo Maven / OSGi build is up and running, create a similar (but much simpler) build for the Tipi app store.

First, the java code needs to be in its own project, after that a regular JSP based webapp.

Use OSGi to manage java based bundles

Java based scripts can be made to work in an OSGi setting. Problem is, due to the type of code generated by the Tsl>Java compiler, that it needs class access to the adapters it uses.

This means that, just like it is without OSGi, that every script needs its own class loader. The logical way to do this in OSGi would be to generate a separate bundle for every script. At first I thought that would be ridiculous, but I'm starting to change my mind.

The things we do (classloader for each script) and the things we want to do (proactive dependency management) just covers that area. We made our own custom classloader which has worked fine, so why wouldn't it work in OSGi?

Advantages:

  • We can use declarative services to manage our dependencies
  • We have a very clean interface to create multi lingual scripts (A 'script', at runtime level, is a bundle that can import whatever it wants, and provides a service of type CompiledScript)
  • It pretty agnostic of languages, it will work equally well with any OSGi-capable JVM language.
  • It simplifies the tasks of the dispatcher
  • We can use the versioning capabilities of OSGi (by allowing multiple versions of the same bundle), the present '_beta' suffix.

Challenges:

  • The number of bundles is going to be really large, 5000 bundles, with 5000 services and who knows how many dependencies, I fear for memory usage.
  • OSGi tools like the webconsole or regular console commands might not be suited for this number of bundles.
  • I don't know how fast the dependency management is at this scale.
  • Getting the java compiler to work might be tricky
  • It will only work in OSGi

Add certificate as binary to SOAPMap

Allow the script to supply a binary certificate to use in the HTTPs connection.

I think the biggest challenge is to setup a test environment.

ResourceChecker issue in Navajo 3.0/Javascript

Wat te doen met de ResourceChecker klasse. Deze heeft dependency naar GenericHandler en dus naar TslCompiler. Hierin worden de 'dependencies'
van een script bepaald, zoals includes, navajomaps, adapters etc..
Op dit moment worden dus een .js een .java en een .class file gegenereerd bij script compile.

Fix Unit Tests

The unit tests are run with the old Ant-based build scripts, but they haven't been included yet in the Maven build

Equinox Bug sometimes kills webconsole

Looking like:

HTTP ERROR 500

Problem accessing /system/console/components. Reason:

INTERNAL_SERVER_ERROR

Caused by:

java.lang.NullPointerException
at org.eclipse.equinox.internal.ds.impl.ReadOnlyDictionary.get(ReadOnlyDictionary.java:86)

The eclipse bug is here:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=350935

It's already fixed in the latest maintenance release 3.7.2, I am using 3.7.0, which still has this bug

Remove all lazy activation policies

In the Navajo scheme of things, lazy activation is pretty much always a bad idea, and result in unexpected behaviour. So remove it in all bundles, also internal and enterprise.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.