WSDL Endpoint example throwing errors in Mule - wsdl

Posting here is always my last resort, but I'm going crazy here. I'm a Mule ESB beginner. I've been trying to do some simple examples to get me on the right track.
But I've encountered a problem with one of the examples I've seen on the mule website...
http://www.mulesoft.org/documentation/display/current/WSDL+Connectors
I'm trying to set up a generic WSDL endpoint, which invokes a web service without generating a client.
The WSDL I'm trying to access...
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL&method=ConversionRate
The problem is, I keep getting the following error
[ERROR] IOException during exec() of compiler "javac". Check your path environment variable.
ERROR 2013-04-19 09:27:07,920 [[soap].soapFlow1.stage1.02] org.apache.cxf.endpoint.dynamic.DynamicClientFactory: Could not compile java files for http://www.webservicex.net/CurrencyConvertor.asmx?WSDL&method=ConversionRate?wsdl.
ERROR 2013-04-19 09:27:07,934 [[soap].soapFlow1.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Unable to create JAXBContext for generated packages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (java.lang.IllegalStateException)
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (javax.xml.bind.JAXBException)
com.sun.xml.bind.v2.ContextFactory:183 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/bind/JAXBException.html)
2. Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (javax.xml.bind.JAXBException)
javax.xml.bind.ContextFinder:-1 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/xml/bind/JAXBException.html)
3. Unable to create JAXBContext for generated packages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (java.lang.IllegalStateException)
org.apache.cxf.endpoint.dynamic.DynamicClientFactory:363 (null)
4. Unable to create JAXBContext for generated packages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index (java.lang.IllegalStateException) (org.mule.api.DefaultMuleException)
org.mule.module.cxf.builder.AbstractOutboundMessageProcessorBuilder:96 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/DefaultMuleException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
javax.xml.bind.JAXBException: "net.webservicex" doesnt contain ObjectFactory.class or jaxb.index
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
And yes, I've hunted around the internet for hours looking for a solution.
Things I've done to try fix the problem.
Make sure the javac path is set in the environment variables.
(%JAVA_HOME%\bin)
Make sure that mule studio has the correct path to JRE
I know it's a simple problem, but I need to figure it out to tackle a larger project that I have in mind.
If anyone could shed some light on a solution this problem, then I'd be extremely grateful.
Thanks :)
Other info:
Using Java 1.7
Using MuleStudio 3.4

Ok, after trying and failing at many different solutions, I've figured it out.
I've seen a lot of people asking the same question as me, with very few solutions.
Here is mine...
The JRE was incorrect.
My java directory consisted of..
And Mule studio was using the folder jre7
So I changed it to use the JRE in the directory jdk1.7.0_17/jre
Ran it again and.. OMG it worked!!
Here is how to do it in mule studio/eclipse...Right Click on your Project --> Properties --> Java Build Path --> Libraries Tab --> Click JRE System Library --> Press Edit --> Click Alternate JRE --> Click Installed JREs.. --> Then Add the JRE from the correct directory like I stated above.
Hope this helps anyone with the same problem! :)

Related

Liquigraph schema files missing?

We have a service in our site that uses neo4j for the database. Today when I tried to load up the service for development the project bombs out. I'm getting errors like this:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquigraph' defined in class path resource [org/liquigraph/spring/starter/LiquigraphAutoConfiguration$LiquigraphConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException:
cvc-elt.1: Cannot find the declaration of element 'changelog'.
and this:
2021-08-02 14:43:41.516 WARN 9650 --- [ restartedMain] o.l.core.io.xml.ChangelogParser : XSD validation warning : schema_reference.4: Failed to read schema document 'http://www.liquigraph.org/schema/1.0/liquigraph.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
in my terminal.
I went to the site listed in the error and it doesn't work. There is also this one which is pretty similar but gives a 404.
our pom.xml file lists this for liquigraph:
<!-- https://mvnrepository.com/artifact/org.liquigraph/liquigraph-spring-boot-starter -->
<dependency>
<groupId>org.liquigraph</groupId>
<artifactId>liquigraph-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
In researching the project I saw something about running it "offline" or something. How can I get the project to load with the XSD files missing?
This should be fixed now.
I just deployed a new version of the website and misconfigured a couple of things (wrong CNAME file location, wrong schema files location).
https://www.liquigraph.org/schema/1.0/liquigraph.xsd and http://www.liquigraph.org/schema/1.0/liquigraph.xsd should work fine now.
More recent releases of Liquigraph also support schema location redirects such as the latest 3.x and 4.x. Make sure to upgrade!

SQLDelight - java.lang.UnsatisfiedLinkError: couldn't find "libsqlitejdbc.so"

Runtime Environment
SQLDelight version: 1.4.3
Application OS: Android
Bug Description
I'm trying to create SQLDelight in library level as kotlin multiplatform library and deploy it as android library...
Then when I added it as dependencies in my Android apps (separated project, because I want to treat it as client who used my library later), I got a Runtime issue with the following stacktrace :
2020-12-01 10:02:40.827 3642-3642/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.socketdummy, PID: 3642
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.socketdummy-iBZCoVo2j0qCEXnpJ23JAg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.socketdummy-iBZCoVo2j0qCEXnpJ23JAg==/lib/x86, /system/lib, /system/product/lib]]] couldn't find "libsqlitejdbc.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at org.sqlite.core.NativeDB.<clinit>(NativeDB.java:38)
at org.sqlite.core.NativeDB.load(NativeDB.java:53)
at org.sqlite.core.CoreConnection.open(CoreConnection.java:211)
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:25)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:24)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at org.sqlite.JDBC.connect(JDBC.java:88)
at java.sql.DriverManager.getConnection(DriverManager.java:580)
at java.sql.DriverManager.getConnection(DriverManager.java:190)
at com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver.<init>(JdbcSqliteDriver.kt:25)
at com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver.<init>(JdbcSqliteDriver.kt:14)
at bca.lib.data.local.driver.DatabaseDriverFactory.createDriver(DatabaseDriverFactory.kt:21)
at bca.lib.data.local.driver.DatabaseDriverFactoryKt.getSQLDriver(DatabaseDriverFactory.kt:29)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$6.invoke(KodeinInjector.kt:22)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$6.invoke(Unknown Source:2)
at org.kodein.di.bindings.Singleton$getFactory$1$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Reference$Local$Companion.invoke$kodein_di(references.kt:16)
at org.kodein.di.bindings.Strong$Companion.make(references.kt:31)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:96)
at org.kodein.di.bindings.StandardScopeRegistry.getOrCreate(scopes.kt:64)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:96)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$5.invoke(KodeinInjector.kt:25)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$5.invoke(Unknown Source:2)
at org.kodein.di.bindings.Singleton$getFactory$1$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Reference$Local$Companion.invoke$kodein_di(references.kt:16)
at org.kodein.di.bindings.Strong$Companion.make(references.kt:31)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:96)
at org.kodein.di.bindings.StandardScopeRegistry.getOrCreate(scopes.kt:64)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:96)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$4.invoke(KodeinInjector.kt:25)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$4.invoke(Unknown Source:2)
at org.kodein.di.bindings.Singleton$getFactory$1$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Reference$Local$Companion.invoke$kodein_di(references.kt:16)
2020-12-01 10:02:40.829 3642-3642/? E/AndroidRuntime: at org.kodein.di.bindings.Strong$Companion.make(references.kt:31)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1$1.invoke(standardBindings.kt:96)
at org.kodein.di.bindings.StandardScopeRegistry.getOrCreate(scopes.kt:64)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:127)
at org.kodein.di.bindings.Singleton$getFactory$1.invoke(standardBindings.kt:96)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$2.invoke(KodeinInjector.kt:25)
at bca.lib.di.KodeinInjectorKt$kodeinInjector$1$2.invoke(Unknown Source:2)
at org.kodein.di.bindings.Provider$getFactory$1.invoke(standardBindings.kt:86)
at org.kodein.di.bindings.Provider$getFactory$1.invoke(standardBindings.kt:80)
at org.kodein.di.internal.DIContainerImpl$factory$1.invoke(DIContainerImpl.kt:160)
at org.kodein.di.DIContainer$provider$$inlined$toProvider$1.invoke(curry.kt:14)
at org.kodein.di.internal.DirectDIBaseImpl.Instance(DirectDIImpl.kt:30)
at bca.lib.ConnectionManager$connect$provisionUseCase$2.invoke(ConnectionManager.kt:28)
at bca.lib.ConnectionManager$connect$provisionUseCase$2.invoke(ConnectionManager.kt:10)
at org.kodein.di.DIAwareKt$newInstance$1.invoke(DIAware.kt:268)
at org.kodein.di.DIAwareKt$newInstance$1.invoke(Unknown Source:4)
at org.kodein.di.DIProperty$provideDelegate$1.invoke(properties.kt:46)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at bca.lib.ConnectionManager.connect(ConnectionManager.kt:16)
at com.example.socketdummy.MainActivity.lambda$onCreate$0(MainActivity.java:31)
at com.example.socketdummy.-$$Lambda$MainActivity$GO0OJj7ZT4UkfvPtudR0IznuTHw.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7125)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:992)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
it said no "libsqlitejdbc.so" was found..., did I make a mistake? and how to solve this problem?
according to the documentation I understand, I just addded this following dependencies in my Android apps :
implementation 'com.squareup.sqldelight:android-driver:1.4.3'
I need solution for this issue with the following conditions:
the SQLDelight definition is on Library layer (including .sq, driver actual definition) and can be deployed as android lib or iOS framework
it can be implemented as dependencies in the client apps later (ex: Android / iOS)
Thank you
Somehow you have included the jdbc driver. See lines in the stack trace related to com.squareup.sqldelight.sqlite.driver.JdbcSqliteDriver. I would guess this either crept in because you intended them to run tests in the JVM that way, or you are also making this library available for server side and the config is not set up properly. Seeing the gradle config might help.

Facing issues when upgrading Struts from version 2.0.11.2 to 2.3.28.1

I have an application which is using Struts 2.0.11.2.The application is flagged as vulnerable due to the old version of struts.I am facing issues while upgrading the struts to version 2.3.28.1(this is the latest allowed version in our organization).
After a lot of research on google i understood that the Dojo classes are deprecated in the new struts version. However our project uses a lot of dojo tags.
I am aware of the alternative plugins such as Struts Jquery. But use of alternative plugins will involve a lot of code change and testing which is not feasible in the current time frame we have got.
Is there some way out to use the dojo tags with the struts to version 2.3.28.1?.
Can we somehow incorporate the struts2-dojo-plugin with the Struts version 2.3.28.1?.
i tried it myself but am getting stuck(details mentioned below)
What i tried:
1) I replaced the Struts core jar with struts2-core-2.3.28.1 jar.
2) Updated all the dependency jars as mentioned in the Maven repository.
3) Added struts2-dojo-plugin-2.3.20.1
4) Included in JSP-s
<%# taglib prefix="sx" uri="/struts-dojo-tags"%>
<head><sx:head /></head>
The issue i am facing:
When i hit the JSP below is the error i get. Any help is highly appreciated.Let me know if you need any more details or information from my side.
FreeMarker template error (HTML_DEBUG mode; use RETHROW in production!)
The following has evaluated to null or missing:
==> parameters.pushId [in template "template/ajax/submit.ftl" at line 103, column 6]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: #if parameters.pushId [in template "template/ajax/submit.ftl" at line 103, column 1]
----
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:116)
at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:60)
at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:40)
at freemarker.core.NonBooleanException.<init>(NonBooleanException.java:44)
at freemarker.core.Expression.modelToBoolean(Expression.java:136)
at freemarker.core.Expression.evalToBoolean(Expression.java:119)
at freemarker.core.Expression.evalToBoolean(Expression.java:110)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:46)
at freemarker.core.Environment.visit(Environment.java:312)
at freemarker.core.MixedContent.accept(MixedContent.java:62)
at freemarker.core.Environment.visit(Environment.java:312)
at freemarker.core.Environment.process(Environment.java:290)
at freemarker.template.Template.process(Template.java:312)
at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:158)
at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:584)
at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:57)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:54)
at jsp_servlet._demotool.__fileupload._jsp__tag2(__fileupload.java:332)
at jsp_servlet._demotool.__fileupload._jspService(__fileupload.java:236)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:432)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
at jsp_servlet._demotool.__ctmmessage._jspService(__ctmmessage.java:132)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:502)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:432)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
at jsp_servlet._demotool.__home._jspService(__home.java:255)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:90)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:91)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Rejecting re-init on previously failed class error when loading a Class with dalvikvm

I am trying to use Terminal IDE on Lollipop 5.1.1. Using a Samsung E7 device, a mod version of Terminal IDE is provided by someone on XDA
here:
http://forum.xda-developers.com/showthread.php?t=1340852&page=7
I tried to use javac script in that mod but it gave an unsatisfied link error, saying that:
$ javac
java.lang.UnsatisfiedLinkError: org.apache.harmony.security.fortress.Services
at org.apache.harmony.security.fortress.Engine.getServices(Engine.java:158)
at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:137)
at java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:90)
at
org.apache.harmony.security.utils.JarUtils.verifySignature(JarUtils.java:83)
at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:294)
at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:268)
at java.util.jar.JarFile.getInputStream(JarFile.java:380)
at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
at java.net.URL.openStream(URL.java:470)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:515)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.handleGetBundle(ResourceBundle.java:542)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:228)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:139)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:112)
at com.sun.tools.javac.main.JavaCompiler.version(JavaCompiler.java:97)
at com.sun.tools.javac.main.Main.bugMessage(Main.java:434)
at com.sun.tools.javac.main.Main.compile(Main.java:421)
at com.sun.tools.javac.main.Main.compile(Main.java:308)
at com.sun.tools.javac.main.Main.compile(Main.java:299)
at com.sun.tools.javac.Main.compile(Main.java:82)
at com.spartacusrex.spartacuside.external.javac.main(javac.java:13)
$
It is strange that there is a UnsatisfiedLinkError , because it doesn't say that VM cannot find xyz.so library or cannot find xyz method.
I tried using logcat command right after using Terminal IDE's javac script on Device, the odd thing I found from there is :
I/art ( 6558) : rejecting re-init on previously-failed class java.lang.Class<org.apache.harmony.security.fortress.Services>
I couldn't understand why this happened,
The javac script uses android's dalvikvm command to load
com.spartacusrex.spartacuside.external.javac
class. People have faced this rejecting re-init issue on sdk version 20+ but it's not clear to me why this info message uccurs and how to solve it.
I copied /system/lib/libjavacrypto.so to Terminal IDE's ~/system/lib folder and now javac and dx tools are working.
It seems like Google messed up with things in /system/lib which resulted in errors.
Answering so someone else might find it useful.

JSF 2 OpenJPA 2 Glassfish 3.1 WEB9031 Error

I got this error which according to Apache Support is an issue relating with Glassfish rather than OpenJPA:
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.openjpa.util.LongId], because it has not yet been started, or was already stopped
The stacktrace is:
Caused by: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.openjpa.util.LongId], because it has not yet been started, or was already stopped
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1410)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1368)
at com.ckd.model.BookModel.pcNewObjectIdInstance(BookModel.java)
at org.apache.openjpa.enhance.PCRegistry.newObjectId(PCRegistry.java:138)
at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClass(MetaDataRepository.java:1693)
at org.apache.openjpa.meta.MetaDataRepository.processRegisteredClasses(MetaDataRepository.java:1643)
... 112 more
Has anyone come across this before and how to resolve it? I have been stuck on this issue for the last several days.
Another of my post related to this issue can be found here: JSF 2: h:link and getrowdata.
The above error relates to a problem with the OpenJPA enhancer. When you execute Sun's JDK the OpenJPA's dynamic enhancer starts by default. This action, in turn, stuffs up Glassfish's classloader class - hence, the WEB9031 error.
For those who experience this same issue, a simple workaround is to do the enhancement at build time - which I did in ANT with org.apache.openjpa.ant.PCEnhancerTask - and add this property to your persistence.xml to shut off the dynamic enhancer: <property name="openjpa.DynamicEnhancementAgent" value="false"/>.
Also, it wouldn't hurt to throw this in your persistence.xml as well <property name="openjpa.RuntimeUnenhancedClasses" value="unsupported" />.

Resources