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

JAXPExtensionsProvider / Java 7 / Secure Processing #1070

Closed
thoughtchad opened this issue Mar 31, 2014 · 3 comments
Closed

JAXPExtensionsProvider / Java 7 / Secure Processing #1070

thoughtchad opened this issue Mar 31, 2014 · 3 comments

Comments

@thoughtchad
Copy link

Related to:
'Resolves Java extension compilation problem on OSX'
SHA: d60cf83

@yokolet Wish I had more details for you on this. Mainly a heads up. I built a local gem off of v1.6.2.beta.2., jruby 1.7.11, jdk 7.025, linux. Pretty much worked great except in one unique use case where the context of the executing code had a slightly different environment. Possibly related to different proxy settings in each environment, but only breaks with this beta version of noko on the JAXPExtentsionProvider call...

Pretty sure this has something to do with:

AXPExtensionsProvider jep = new JAXPExtensionsProvider(functionResolver);

vs.

AXPExtensionsProvider jep = new JAXPExtensionsProvider(functionResolver, false);

Very similar issue here: restlet/restlet-framework-java/#785
Stack Overflow: http://stackoverflow.com/questions/14705003/restlet-client-on-java-1-7-xml-parse-error-feature-secure-processing-cannot-se
Java 7 FEATURE_SECURE_PROCESSING: http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#FEATURE_SECURE_PROCESSING

My failure was in the context of parsing a wsdl via savon & httpclient. Here is the error message:
'com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider'
(that's it)

And the last bit of a very long stack trace:
"org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)",
"org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:110)",
"org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)",
"org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)",
"org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)",
"nokogiri.XmlXpathContext$INVOKER$s$1$0$rbNew.call(XmlXpathContext$INVOKER$s$1$0$rbNew.gen)",
"nokogiri.XmlXpathContext.rbNew(XmlXpathContext.java:125)",
"nokogiri.XmlXpathContext.setNode(XmlXpathContext.java:99)"

Another strange aspect is that in the working use cases... via debug code... just prior to failing call the code below works:
ruby require 'java' java_import 'com.sun.org.apache.xpath.internal.jaxp.JAXPExtensionsProvider'
In the failing case it would fail on the java_import above... if I removed the above debug code... it would fail on the original savon wsdl parse call.

@yokolet
Copy link
Member

yokolet commented Apr 16, 2014

Hi,
I just pushed the branch, issue-1070. Can you try your code with that branch?

  1. use JRuby
  2. clone nokogiri repo and checkout the branch, issue-1070
  3. bundle install
  4. bundle exec rake (compiles Java code and runs test)
    or bundle exec rake compile (just compiles Java code)
  5. bundle exec rake gem (creates nokogiri gem)
  6. gem install pkg/nokogiri-1.6.2.rc2-java.gem
  7. run your code.

@thoughtchad
Copy link
Author

@yokolet - thx for instructs. Looks good. The wsdl xml parsing the was failing is now working with rc2. thank you :-)

@yokolet
Copy link
Member

yokolet commented Apr 17, 2014

Sounds good.
The issue-1070 branch has been merged to master. Next version of Nokgoiri release will have this fix.

@yokolet yokolet closed this as completed Apr 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants