I am accessing a webservice exposed by some other guy as a client using axis2 and I have made a wrapper method for abcStub .java (Stub java file made by running some batch) and tried to instantiate the Stub file inside the wrapper java file. But i get following errors:
INFO: ERROR org.apache.struts.actions.DispatchAction - Dispatch[/remittanceTransaction] to method 'remTransApprove' returned an exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
Caused by: java.lang.NoSuchMethodError: org.apache.neethi.PolicyEngine.getPolicy(Ljava/lang/Object;)Lorg/apache/neethi/Policy;
at org.tempuri.MIRSRemittanceServicesStub.getPolicy(MIRSRemittanceServicesStub.java:3558)
at org.tempuri.MIRSRemittanceServicesStub.populateAxisService(MIRSRemittanceServicesStub.java:57)
at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:268)
at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:257)
at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:305)
INFO: g.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:297)
at com.mtmrs.webservice.MIRSRemittanceTransactionManagerImpl.getAppDeclWrapper(MIRSRemittanceTransactionManagerImpl.java:201)
at com.mtmrs.business.backoffice.impl.RemittanceTransactionManagerImpl.remTransApprove(RemittanceTransactionManagerImpl.java:1417)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.mtmrs.application.backoffice.action.RemittanceTransactionAction.remTransApprove(RemittanceTransactionAction.java:1409)
... 78 more
INFO: WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class javax.servlet.ServletException
WARNING: StandardWrapperValve[action]: PWC1406: Servlet.service() for servlet action threw exception
java.lang.NoSuchMethodError: org.apache.neethi.PolicyEngine.getPolicy(Ljava/lang/Object;)Lorg/apache/neethi/Policy;
at org.tempuri.MIRSRemittanceServicesStub.getPolicy(MIRSRemittanceServicesStub.java:3558)
at org.tempuri.MIRSRemittanceServicesStub.populateAxisService(MIRSRemittanceServicesStub.java:57)
at org.tempuri.MIRSRemittanceServicesStub.(MIRSRemittanceServicesStub.java:268)
I think there must be problem with this
org.apache.neethi.PolicyEngine.getPolicy(Ljava/lang/Object;)Lorg/apache/neethi/Policy;
or may be im wrong. Either way, dunno how to fix. Would be of much help if anyone knew of faced/solved this before.
I got this while making following call:
public String getAppDeclWrapper(String session, String parentAgent, String mirsTxnNo, String strReason, String isApprove, String modifiedBY){
String returnString = null;
try {
mtmrsLogger.info("Entering into Approve Decline procedure, Starting to send Status to MIRS");
MIRSRemittanceServicesStub stub = new MIRSRemittanceServicesStub(); //Error occurs at this line
ApproveDecline approvedEcline = new ApproveDecline();
ApproveDeclineResponse approveResponse = new ApproveDeclineResponse();
approvedEcline.setCParentAgent(parentAgent);
approvedEcline.setMirsSession(session);
approvedEcline.setModifiedBy(modifiedBY);
approvedEcline.setRefNo(mirsTxnNo);
approvedEcline.setStrReason(strReason);
approvedEcline.setIsApprove(isApprove);
My guess is you have multiple versions (or invalid version) of PolicyEngine on your classpath. I think you are running inside a servlet engine. Try following code to determine where this version is stored and fix it:
org.apache.neethi.PolicyEngine.class.getProtectionDomain().getCodeSource().getLocation()
Related
I have recently started getting following exception, only when junits are being run. In normal flow, the method runs fine. (In fact even the jUnits used to work fine till some time back)
java.lang.NoSuchMethodException:
io.jsonwebtoken.impl.crypto.MacProvider.generateKey(io.jsonwebtoken.SignatureAlgorithm)
Following is the method:
public static String generateDummyJWT(String userName)
{
return Jwts.builder().claim("user_name", StringUtils.defaultString(userName)).setAudience("client1").signWith(Keys.secretKeyFor(SignatureAlgorithm.HS384)).compact();
}
And jjwt versions:
Following is the complete stack trace:
Caused by: java.lang.IllegalStateException: Unable to invoke class
method io.jsonwebtoken.impl.crypto.MacProvider#generateKey. Ensure
the necessary implementation is in the runtime classpath. at
io.jsonwebtoken.lang.Classes.invokeStatic(Classes.java:202) at
io.jsonwebtoken.security.Keys.secretKeyFor(Keys.java:121) at
com.random.util.ServiceSpecificUtil.generateDummyJWT(ServiceSpecificUtil.java:143)
at
com.random.util.ServiceConstants.(ServiceConstants.java:203)
at com.random.MyClass.isUserBranch(MyClass.java:67) at
com.random.MyClass.validName(MyClass.java:93) at
com.random.MyClass.preConditionCheck(MyClass.java:82) at
com.random.MyClass.get(MyClass.java:46) at
com.random.MyClass2.evaluateExpression(MyClass2.java:218) 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:498) at
org.powermock.api.mockito.internal.invocation.MockitoMethodInvocationControl$1.invoke(MockitoMethodInvocationControl.java:243)
at
org.mockito.internal.invocation.realmethod.CleanTraceRealMethod.invoke(CleanTraceRealMethod.java:30)
at
org.mockito.internal.invocation.InvocationImpl.callRealMethod(InvocationImpl.java:112)
at
org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:41)
at
org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:93)
at
org.powermock.api.mockito.internal.invocation.MockitoMethodInvocationControl.performIntercept(MockitoMethodInvocationControl.java:266)
at
org.powermock.api.mockito.internal.invocation.MockitoMethodInvocationControl.invoke(MockitoMethodInvocationControl.java:192)
at org.powermock.core.MockGateway.doMethodCall(MockGateway.java:132)
at org.powermock.core.MockGateway.methodCall(MockGateway.java:63) at
com.random.MyClass2.evaluateExpression(MyClass2.java) at
com.random.MyClass2.isPermitted(MyClass2.java:107) 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:498) at
org.powermock.api.mockito.internal.invocation.MockitoMethodInvocationControl$1.invoke(MockitoMethodInvocationControl.java:243)
at
org.mockito.internal.invocation.realmethod.CleanTraceRealMethod.invoke(CleanTraceRealMethod.java:30)
at
org.mockito.internal.invocation.InvocationImpl.callRealMethod(InvocationImpl.java:112)
at
org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:41)
at
org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:93)
at
org.powermock.api.mockito.internal.invocation.MockitoMethodInvocationControl.performIntercept(MockitoMethodInvocationControl.java:266)
at
org.powermock.api.mockito.internal.invocation.MockitoMethodInvocationControl.invoke(MockitoMethodInvocationControl.java:192)
... 32 more Caused by: java.lang.reflect.InvocationTargetException
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:498) at
io.jsonwebtoken.lang.Classes.invokeStatic(Classes.java:198) ... 66
more Caused by: java.lang.IllegalStateException: The HmacSHA384
algorithm is not available. This should never happen on JDK 7 or
later - please report this to the JJWT developers. at
io.jsonwebtoken.impl.crypto.MacProvider.generateKey(MacProvider.java:94)
at
io.jsonwebtoken.impl.crypto.MacProvider.generateKey(MacProvider.java:63)
... 71 more Caused by: java.security.NoSuchAlgorithmException:
HmacSHA384 KeyGenerator not available at
javax.crypto.KeyGenerator.(KeyGenerator.java:169) at
javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:223) at
io.jsonwebtoken.impl.crypto.MacProvider.generateKey(MacProvider.java:92)
... 72 more
I was able to resolve my problem.
Someone in the team had added the call to above function while initializing a static final variable like this:
public static String TOKEN_GUEST = ServiceSpecificUtil.generateDummyJWT(USERNAME);
Now, it seems that access to the java.security packges generally does not work well with PowerMock due to heavy use of reflections & byte code manipulations:
Although I had referred this SO post and tried the suggested solution of using
#PowerMockIgnore like:
#PowerMockIgnore({"org.apache.http.conn.ssl.*", "javax.net.ssl.*" , "javax.crypto.*"})
and that might be helpful in preventing errors when above function was called from another function. But it was not preventing errors in static variable initialization.
public static String TOKEN_GUEST = ServiceSpecificUtil.generateDummyJWT(USERNAME);
I will update this post when I dig deeper as to why the error was coming only in case of static variable initialization and not when ServiceSpecificUtil.generateDummyJWT(USERNAME) was being called from another function.
I am trying to attach an agent for a process using bytebuddy .I found that we can use ByteBuddyAgent.attach(file,"18467"); for this. But when i am trying to do this following errors occurring.
This is agent i used
File file = (new File("Agent.jar"));
Error
java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound#e26db604
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:378)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:227)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:202)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:189)
at common.netty.echo.EchoHttpServer.main(EchoHttpServer.java:95)
Caused by: java.lang.reflect.InvocationTargetException
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:498)
at net.bytebuddy.agent.Attacher.install(Attacher.java:77)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:373)
... 4 more
Caused by: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:106)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 10 more
Any idea for this ? and When i try to use this attachment from another agent as follows
public class Agent {
public static void premain(String args, Instrumentation instrumentation) {
System.out.println("Premain");
File file ;
try {
file = (new File("Agent.jar"));
ByteBuddyAgent.attach(file,"18467");
}
catch (Exception e)
{
e.printStackTrace();
}
}
I am getting this error
Error
java.lang.IllegalStateException: Error during attachment using: net.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound#423f0955
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:378)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:227)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:202)
at net.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:189)
at common.netty.echo.Agent.premain(Agent.java:111)
at common.netty.echo.EchoHttpServer.<clinit>(EchoHttpServer.java:56)
Caused by: java.lang.reflect.InvocationTargetException
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:498)
at net.bytebuddy.agent.Attacher.install(Attacher.java:77)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:373)
... 5 more
Caused by: java.lang.UnsatisfiedLinkError: Native Library /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libattach.so already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1907)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at sun.tools.attach.LinuxVirtualMachine.<clinit>(LinuxVirtualMachine.java:342)
at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
... 11 more
Any suggestion on this!!
As for the first error message: does the target VM run the attachment listener? You can try to force starting the thread by setting -XX:+StartAttachListener which should be set by default. What JVM version are you running?
The other error message indicates that the attachment library was already loaded by another class loader. See this answer for further details: java.lang.UnsatisfiedLinkError: Native Library XXX.so already loaded in another classloader
I am trying to get a node.js+node-java app that calls an API from a commercial product, and have gotten it to the point it almost runs, but now, when I run it, it is giving me a "java.lang.NoClassDefFoundError".
Here's the ending of the output when it gets this error:
THIS IS CONSOLE.LOG!!
Finished STARTING TO DO MyFactoryImplClass.getPepRequestFactory()...
About to do pepReqF1.newPepRequest()...
/apps/Oracle/OESCLIENT/oes_sm_instances/smtest8-java-PULL-NODEJS/testOES.js:97
var pepReq1 = pepReqF1.newPepRequestSync("Administrators", "GET" , "test/foo2/fooresource" );
^
Error: Error running instance method
java.lang.NoClassDefFoundError: javax/security/jacc/PolicyContext
at oracle.security.jps.runtime.AppSecurityContext$2.run(AppSecurityContext.java:223)
at oracle.security.jps.runtime.AppSecurityContext$2.run(AppSecurityContext.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.runtime.AppSecurityContext.getApplicationID(AppSecurityContext.java:221)
at oracle.security.jps.internal.api.runtime.AppSecurityContext.getApplicationID(AppSecurityContext.java:66)
at oracle.security.jps.openaz.pep.SubjectObjMapper$2.run(SubjectObjMapper.java:234)
at oracle.security.jps.openaz.pep.SubjectObjMapper$2.run(SubjectObjMapper.java:231)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.openaz.pep.SubjectObjMapper.mapStringSubject(SubjectObjMapper.java:231)
at oracle.security.jps.openaz.pep.SubjectObjMapper.mapToJpsObject(SubjectObjMapper.java:173)
at oracle.security.jps.openaz.pep.PepRequestImpl.setAccessSubject(PepRequestImpl.java:429)
at oracle.security.jps.openaz.pep.PepRequestFactoryImpl.newPepRequest(PepRequestFactoryImpl.java:202)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Error (native)
at Object.<anonymous> (/apps/Oracle/OESCLIENT/oes_sm_instances/smtest8-java-PULL-NODEJS/testOES.js:97:24)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
[root#nodejs smtest8-java-PULL-NODEJS]#
I found that PolicyContext class is in jacc-api.jar, so I put a copy of jacc-api.jar in my directory and then added:
enter code herejava.classpath.push("/apps/node-v6.6.0-linux-x64/code/jacc-api.jsr");
However, even after doing that, I am still getting the same error when I run my node.js+node-java app.
I am guessing that when I call out to the commercial product's API, that THAT is looking for this PolicyContext class, so I tried exporting CLASSPATH set to the path that the jacc-api.jar file, but even then I get the same error.
Where can I add that JAR to the CLASSPATH so that I can eliminate this error?
Thanks,
Jim
When shutting down the noo4j DB I receive this error:
[org.neo4j]: Exception when stopping org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#45673f68 java.nio.DirectByteBuffer[pos=16 lim=1048576 cap=1048576], 1586985
java.lang.IllegalArgumentException: java.nio.DirectByteBuffer[pos=16 lim=1048576 cap=1048576], 1586985
at org.neo4j.test.impl.EphemeralFileSystemAbstraction$DynamicByteBuffer.put(EphemeralFileSystemAbstraction.java:966)
at org.neo4j.test.impl.EphemeralFileSystemAbstraction$EphemeralFileData.write(EphemeralFileSystemAbstraction.java:680)
at org.neo4j.test.impl.EphemeralFileSystemAbstraction$EphemeralFileChannel.write(EphemeralFileSystemAbstraction.java:488)
at org.neo4j.kernel.impl.nioneo.store.StoreFileChannel.write(StoreFileChannel.java:160)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore$1.perform(CommonAbstractStore.java:579)
at org.neo4j.kernel.impl.util.FileUtils.windowsSafeIOOperation(FileUtils.java:367)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.close(CommonAbstractStore.java:572)
at org.neo4j.kernel.impl.nioneo.store.NeoStore.closeStorage(NeoStore.java:289)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.close(CommonAbstractStore.java:552)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.stop(NeoStoreXaDataSource.java:507)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.stop(LifeSupport.java:527)
at org.neo4j.kernel.lifecycle.LifeSupport.stop(LifeSupport.java:155)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.stop(XaDataSourceManager.java:185)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.stop(LifeSupport.java:527)
at org.neo4j.kernel.lifecycle.LifeSupport.stop(LifeSupport.java:155)
at org.neo4j.kernel.lifecycle.LifeSupport.shutdown(LifeSupport.java:185)
at org.neo4j.kernel.InternalAbstractGraphDatabase.shutdown(InternalAbstractGraphDatabase.java:822)
at org.neo4j.test.ImpermanentGraphDatabase.shutdown(ImpermanentGraphDatabase.java:170)
at org.springframework.data.neo4j.support.DelegatingGraphDatabase.shutdown(DelegatingGraphDatabase.java:270)
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:483)
at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:350)
at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:273)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:565)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:541)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:870)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:510)
at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:908)
at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:884)
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:804)
Caused by: java.lang.IllegalArgumentException
at java.nio.Buffer.position(Buffer.java:244)
at org.neo4j.test.impl.EphemeralFileSystemAbstraction$DynamicByteBuffer.put(EphemeralFileSystemAbstraction.java:962)
... 31 more
2014-11-20 18:31:03.775+0000 ERROR [org.neo4j]: Exception when stopping org.neo4j.kernel.impl.transaction.XaDataSourceManager#4fd91628 Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#45673f68' failed to stop. Please see attached cause exception.
org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#45673f68' failed to stop. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.stop(LifeSupport.java:532)
at org.neo4j.kernel.lifecycle.LifeSupport.stop(LifeSupport.java:155)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.stop(XaDataSourceManager.java:185)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.stop(LifeSupport.java:527)
at org.neo4j.kernel.lifecycle.LifeSupport.stop(LifeSupport.java:155)
at org.neo4j.kernel.lifecycle.LifeSupport.shutdown(LifeSupport.java:185)
at org.neo4j.kernel.InternalAbstractGraphDatabase.shutdown(InternalAbstractGraphDatabase.java:822)
I assume it is caused by a timeout, as it only appears when instantiating a large number of nodes (> 100K). However, I do not find a way to set up any timeout using the setConfig/GraphDatabaseSettings APIs (unfortunately we cannot use a property file):
public GraphDatabaseService graphDatabaseService() {
GraphDatabaseService graphDb = new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder("db/my.db")
.setConfig( GraphDatabaseSettings.nodestore_mapped_memory_size, "10M" )
.newGraphDatabase();
Do you know what is the root cause of the issue and how to circumvent it?
Thanks
F.
I am attempting to start up my hadoop application, however upon startup i am seeing this in the log files, does anyone have a clue as to what the problem is?
Creating filesystem for hdfs://10.170.4.141:9000
java.io.IOException: config()
at org.apache.hadoop.conf.Configuration.(Configuration.java:229)
at org.apache.hadoop.conf.Configuration.(Configuration.java:216)
at org.apache.hadoop.security.SecurityUtil.(SecurityUtil.java:60)
at org.apache.hadoop.net.NetUtils.makeSocketAddr(NetUtils.java:188)
at org.apache.hadoop.net.NetUtils.createSocketAddr(NetUtils.java:168)
at org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:198)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:88)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1413)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:68)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1431)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:256)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:125)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:240)
at org.apache.hadoop.fs.Path.getFileSystem(Path.java:187)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPath(FileInputFormat.java:372)
at org.blismedia.VolumeReportGenerateUpdates.main(VolumeReportGenerateUpdates.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:187)
I think you're running into HADOOP-2851. This "error" can safely be ignored.
Apparently, Configuration's constructor logs an exception to the debug log, despite no exception actually being thrown. Why? Your guess is as good as mine. But the issue is resolved in their project as won't fix. "It's a feature, not a bug."
public Configuration(boolean loadDefaults) {
if (LOG.isDebugEnabled()) {
LOG.debug(StringUtils.stringifyException(new IOException("config()")));
}
// ...
}