Could not bind non-serializable object to JNDI with IBM Websphere












2














I have a working J2EE application which is successfully deployed in both Tomcat and Glassfish servers. I am trying to deploy the same application in IBM WebSphere 8.5.5.10. But could not start the application due to the JNDI binding errors at context rebind statement in the below line.



InitialContext context = new InitialContext();
context.rebind(String object, Custom Java Object);



Following is the exception stack trace found in logs



[ERROR] com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. (eDynamo.handlers.instancerunner.InstanceRunnerHandler)(21 Nov 2018 11:38:06)
com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound.
at com.ibm.ws.naming.util.Helpers.processJavaObjectForBinding(Helpers.java:718) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.doRebind(CNContextImpl.java:2077) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.rebind(CNContextImpl.java:698) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:233) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:245) ~[com.ibm.ws.runtime.jar:?]



I have checked the source code of com.ibm.ws.naming.util class, enabled trace for com.ibm.ws.naming package and found that the object I am trying to bind is not serializable. As per source code only remote objects needs to be serializable and as per JNDI documentation there is no restriction on non-serializable objects.



Java version:- 1.8_64



Could someone please help me on fixing this issue?










share|improve this question






















  • I do not have access to a console right now, from memory. You have to define a resource that matches the JNDI name you are using to connect. Ex. like database, you would go Resources-JDBC in the console.
    – Nic3500
    Nov 22 '18 at 14:33










  • Hi Nic. Here I am trying to bind an object to JNDI programmatically. The objects to be bind will be decided at runtime.
    – Vinod Kumar
    Nov 26 '18 at 11:14
















2














I have a working J2EE application which is successfully deployed in both Tomcat and Glassfish servers. I am trying to deploy the same application in IBM WebSphere 8.5.5.10. But could not start the application due to the JNDI binding errors at context rebind statement in the below line.



InitialContext context = new InitialContext();
context.rebind(String object, Custom Java Object);



Following is the exception stack trace found in logs



[ERROR] com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. (eDynamo.handlers.instancerunner.InstanceRunnerHandler)(21 Nov 2018 11:38:06)
com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound.
at com.ibm.ws.naming.util.Helpers.processJavaObjectForBinding(Helpers.java:718) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.doRebind(CNContextImpl.java:2077) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.rebind(CNContextImpl.java:698) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:233) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:245) ~[com.ibm.ws.runtime.jar:?]



I have checked the source code of com.ibm.ws.naming.util class, enabled trace for com.ibm.ws.naming package and found that the object I am trying to bind is not serializable. As per source code only remote objects needs to be serializable and as per JNDI documentation there is no restriction on non-serializable objects.



Java version:- 1.8_64



Could someone please help me on fixing this issue?










share|improve this question






















  • I do not have access to a console right now, from memory. You have to define a resource that matches the JNDI name you are using to connect. Ex. like database, you would go Resources-JDBC in the console.
    – Nic3500
    Nov 22 '18 at 14:33










  • Hi Nic. Here I am trying to bind an object to JNDI programmatically. The objects to be bind will be decided at runtime.
    – Vinod Kumar
    Nov 26 '18 at 11:14














2












2








2







I have a working J2EE application which is successfully deployed in both Tomcat and Glassfish servers. I am trying to deploy the same application in IBM WebSphere 8.5.5.10. But could not start the application due to the JNDI binding errors at context rebind statement in the below line.



InitialContext context = new InitialContext();
context.rebind(String object, Custom Java Object);



Following is the exception stack trace found in logs



[ERROR] com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. (eDynamo.handlers.instancerunner.InstanceRunnerHandler)(21 Nov 2018 11:38:06)
com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound.
at com.ibm.ws.naming.util.Helpers.processJavaObjectForBinding(Helpers.java:718) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.doRebind(CNContextImpl.java:2077) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.rebind(CNContextImpl.java:698) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:233) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:245) ~[com.ibm.ws.runtime.jar:?]



I have checked the source code of com.ibm.ws.naming.util class, enabled trace for com.ibm.ws.naming package and found that the object I am trying to bind is not serializable. As per source code only remote objects needs to be serializable and as per JNDI documentation there is no restriction on non-serializable objects.



Java version:- 1.8_64



Could someone please help me on fixing this issue?










share|improve this question













I have a working J2EE application which is successfully deployed in both Tomcat and Glassfish servers. I am trying to deploy the same application in IBM WebSphere 8.5.5.10. But could not start the application due to the JNDI binding errors at context rebind statement in the below line.



InitialContext context = new InitialContext();
context.rebind(String object, Custom Java Object);



Following is the exception stack trace found in logs



[ERROR] com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. (eDynamo.handlers.instancerunner.InstanceRunnerHandler)(21 Nov 2018 11:38:06)
com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound.
at com.ibm.ws.naming.util.Helpers.processJavaObjectForBinding(Helpers.java:718) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.doRebind(CNContextImpl.java:2077) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.jndicos.CNContextImpl.rebind(CNContextImpl.java:698) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:233) ~[com.ibm.ws.runtime.jar:?]
at com.ibm.ws.naming.util.WsnInitCtx.rebind(WsnInitCtx.java:245) ~[com.ibm.ws.runtime.jar:?]



I have checked the source code of com.ibm.ws.naming.util class, enabled trace for com.ibm.ws.naming package and found that the object I am trying to bind is not serializable. As per source code only remote objects needs to be serializable and as per JNDI documentation there is no restriction on non-serializable objects.



Java version:- 1.8_64



Could someone please help me on fixing this issue?







java-ee websphere jndi






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 12:50









Vinod Kumar

507




507












  • I do not have access to a console right now, from memory. You have to define a resource that matches the JNDI name you are using to connect. Ex. like database, you would go Resources-JDBC in the console.
    – Nic3500
    Nov 22 '18 at 14:33










  • Hi Nic. Here I am trying to bind an object to JNDI programmatically. The objects to be bind will be decided at runtime.
    – Vinod Kumar
    Nov 26 '18 at 11:14


















  • I do not have access to a console right now, from memory. You have to define a resource that matches the JNDI name you are using to connect. Ex. like database, you would go Resources-JDBC in the console.
    – Nic3500
    Nov 22 '18 at 14:33










  • Hi Nic. Here I am trying to bind an object to JNDI programmatically. The objects to be bind will be decided at runtime.
    – Vinod Kumar
    Nov 26 '18 at 11:14
















I do not have access to a console right now, from memory. You have to define a resource that matches the JNDI name you are using to connect. Ex. like database, you would go Resources-JDBC in the console.
– Nic3500
Nov 22 '18 at 14:33




I do not have access to a console right now, from memory. You have to define a resource that matches the JNDI name you are using to connect. Ex. like database, you would go Resources-JDBC in the console.
– Nic3500
Nov 22 '18 at 14:33












Hi Nic. Here I am trying to bind an object to JNDI programmatically. The objects to be bind will be decided at runtime.
– Vinod Kumar
Nov 26 '18 at 11:14




Hi Nic. Here I am trying to bind an object to JNDI programmatically. The objects to be bind will be decided at runtime.
– Vinod Kumar
Nov 26 '18 at 11:14

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412420%2fcould-not-bind-non-serializable-object-to-jndi-with-ibm-websphere%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412420%2fcould-not-bind-non-serializable-object-to-jndi-with-ibm-websphere%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'