Fatal Exception: java.lang.RuntimeException : unable to start Activity - android-fragments

Hey guys i m new in Android studio help me to out following. i use ActionBarSherlock Library and it hold Reference of current Fragment instance when user pause application.
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maruticourier.android/com.myapplication.activity.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by java.lang.NullPointerException**
at com.myapplication.fragment.PendingTask.checksyncdata(PendingTask.java:378)
at com.myapplication.fragment.PendingTask.onCreateView(PendingTask.java:182)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:947)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:548)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5143)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2316)
at android.app.ActivityThread.access$600(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1298)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:5225)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:741)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(NativeStart.java)

you must initialize Activity Object ActionBarSherlock project file

Related

error when running cucumber feature file : Error creating bean with name 'myService'

`Wrote cucumber tests for my project, getting following error when running cucumber feature file. The value for field policyDays is given in my application.yml file In the service class it is defined as follows : #Value("${company.client.policyDays }")
private Integer policyDays;
Am creating an object of MyService.java (myService) in StepDefinitions.java file.
Error log : SEVERE: Exception while executing pickle java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Failed to load ApplicationContext at java.util.concurrent.FutureTask.report(FutureTask.java:122) at java.util.concurrent.FutureTask.get(FutureTask.java:192) at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:117) at io.cucumber.core.runtime.Runtime.lambda$run$0(Runtime.java:82) at io.cucumber.core.runtime.Runtime.execute(Runtime.java:94) at io.cucumber.core.runtime.Runtime.run(Runtime.java:80) at io.cucumber.core.cli.Main.run(Main.java:87) at io.cucumber.core.cli.Main.main(Main.java:30)
Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at io.cucumber.spring.TestContextAdaptor.<init>(TestContextAdaptor.java:32)
at io.cucumber.spring.SpringFactory.start(SpringFactory.java:152)
at io.cucumber.core.runner.Runner.buildBackendWorlds(Runner.java:134)
at io.cucumber.core.runner.Runner.runPickle(Runner.java:70)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$6(Runtime.java:128)
at io.cucumber.core.runtime.CucumberExecutionContext.lambda$runTestCase$5(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.RethrowingThrowableCollector.executeAndThrow(RethrowingThrowableCollector.java:23)
at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:129)
at io.cucumber.core.runtime.Runtime.lambda$executePickle$7(Runtime.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:249)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at io.cucumber.core.runtime.Runtime.lambda$runFeatures$3(Runtime.java:110)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.cucumber.core.runtime.Runtime.runFeatures(Runtime.java:111)
... 5 more
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myService': Unsatisfied dependency expressed through field 'policyDays'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:639)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1431)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:619)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:127)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:276)
at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:244)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)
... 31 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:79)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1339)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:656)
... 50 more
Caused by: java.lang.NumberFormatException: For input string: "${company.client.policyDays}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.valueOf(Integer.java:766)
at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:211)
at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:115)
Tried #Value("#{company.client.policyDays }") instead of #Value("${company.client.policyDays }"), didn't worked

Sharing file create by an app in MODE_PRIVATE

So I have an app which writes sensor data to a csv file via FileOutputStream in MODE_PRIVATE
FileOutputStream fos = null;
try {
fos = context.openFileOutput(FILE_NAME,Context.MODE_PRIVATE);
for(int i = 0; i< signalList.size(); i++){
Signal s = signalList.get(i);
fos.write(s.toString().getBytes());
}
Log.d("WRITESTATUS","Success");
}
Now I wanted to share this file with other apps (whatsapp,email etc.). To achieve that, I am using the code below to share the intent. I was trying to use MODE_WORLD..something but that didn't work because it was deprecated so I learned through the other stackoverflow questions that we need to use FileProvider to make that happen but that didn't work either.
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("*/*");
File file = getFileStreamPath(FILE_NAME);
Uri uri = FileProvider.getUriForFile(this,"com.example.writefile",file);
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(sharingIntent, "Share SENSOR Data"));
<provider
android:authorities="com.example.writefile"
android:name="androidx.core.content.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_path"/>
</provider>
ERROR LOG
2020-06-22 16:27:34.047 6578-6578/? E/ample.writefil: Unknown bits set in runtime_flags: 0x8000
2020-06-22 16:27:34.147 6578-6578/com.example.writefile E/libc: Access denied finding property "vendor.iop.enable_uxe"
2020-06-22 16:27:36.043 6578-6578/com.example.writefile E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.writefile, PID: 6578
java.lang.IllegalStateException: Could not execute method for android:onClick
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:402)
at android.view.View.performClick(View.java:7158)
at android.view.View.performClickInternal(View.java:7135)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27373)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:235)
at android.app.ActivityThread.main(ActivityThread.java:7441)
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:935)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397)
at android.view.View.performClick(View.java:7158) 
at android.view.View.performClickInternal(View.java:7135) 
at android.view.View.access$3500(View.java:801) 
at android.view.View$PerformClick.run(View.java:27373) 
at android.os.Handler.handleCallback(Handler.java:883) 
at android.os.Handler.dispatchMessage(Handler.java:100) 
at android.os.Looper.loop(Looper.java:235) 
at android.app.ActivityThread.main(ActivityThread.java:7441) 
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:935) 
Caused by: java.lang.IllegalArgumentException: Failed to find configured root that contains /data/data/com.example.writefile/files/sensor.csv
at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:744)
at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:418)
at com.example.writefile.MainActivity.Clicked(MainActivity.java:266)
at java.lang.reflect.Method.invoke(Native Method) 
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397) 
at android.view.View.performClick(View.java:7158) 
at android.view.View.performClickInternal(View.java:7135) 
at android.view.View.access$3500(View.java:801) 
at android.view.View$PerformClick.run(View.java:27373) 
at android.os.Handler.handleCallback(Handler.java:883) 
at android.os.Handler.dispatchMessage(Handler.java:100) 
at android.os.Looper.loop(Looper.java:235) 
at android.app.ActivityThread.main(ActivityThread.java:7441) 
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:935) 
Change this and it will work- I have taken hint from here and tried different configuration and this works, I don't know why.
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path
name="sensor"
path="."/>
</paths>

Which jar to use for SQLite latest version 3.13.0

I have downloaded latest SQLite version 3.13.0 from SQLite download page at https://www.sqlite.org/download.html. As per release history, this version is dated 18.05.2016
I am developing an application which uses Java to connect to SQLite database. I have downloaded latest available jar "sqlite-jdbc-3.8.11.2.jar" at https://bitbucket.org/xerial/sqlite-jdbc/downloads. This jar is dated 03-10-2015
My DAO class is as follows :
import java.sql.*;
public class AccountDao {
private Connection conn=null;
public AccountDao() throws SQLException {
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
conn = DriverManager.getConnection("jdbc:sqlite:C:\\Users\\sony\\Documents\\rough.db");
}
I am getting the following error :
type Exception report
message javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:sqlite:C:\Users\sony\Documents\rough.db
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:sqlite:C:\Users\sony\Documents\rough.db
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:462)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:sqlite:C:\Users\sony\Documents\rough.db
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.account_jsp._jspService(account_jsp.java:333)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.sql.SQLException: No suitable driver found for jdbc:sqlite:C:\Users\sony\Documents\rough.db
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)
classpackage.AccountDao.(AccountDao.java:19)
org.apache.jsp.account_jsp._jspService(account_jsp.java:130)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
I have added he jar to build path and it is reflected in Eclipse's Referenced Libraries.
Is the above error a problem with using the wrong jar?

Naming Context not found exception

I am deploying a EAR from RAD .The EAR pacakges a WAR and EJB module. I am getting the following error after the application in invoked..
javax.naming.NameNotFoundException: Context: C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1, name: ejb/org/ifc/dots/business/services/DOTSStartupServiceHome: First component in name DOTSStartupServiceHome not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapNotFoundException(CNContextImpl.java:4360)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1793)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1748)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1499)
How do I verify the naming context entries in the websphere server... ?
Actually the error occurred because the ejb was not part of the EAR deployment descriptor..I added ejb module in the deployment descriptor and now the error is gone..
I am now getting the following error..
[2/6/14 18:16:37:808 IST] 00000023 FfdcProvider I com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files\IBM\SDP\runtimes\base_v7\profiles\was70profile1\logs\ffdc\server1_295f295f_14.02.06_18.16.37.59110970.txt com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt 1507
[2/6/14 18:16:37:810 IST] 00000023 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl
Context method: lookupExt
Context name: C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1
Target name: ejb/org/ifc/dots/business/services/DOTSStartupServiceHome
Other data: ""
Exception stack trace: com.ibm.ws.naming.util.InvalidObjectException: Some object reference in the name "ejb/org/ifc/dots/business/services/DOTSStartupServiceHome" relative to the context "C7M91P-L93883NNode01Cell/nodes/C7M91P-L93883NNode01/servers/server1" is invalid. Some possible causes include a context binding in the name which refers to a destroyed context, or an object binding which contains an invalid EJBHome reference. [Root exception is org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No]
at com.ibm.ws.naming.jndicos.CNContextImpl.mapINV_OBJREF(CNContextImpl.java:4391)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1807)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1748)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1499)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:636)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.ifc.dots.business.locator.ServiceLocator.getServiceHome(ServiceLocator.java:228)
at org.ifc.dots.business.delegation.DotsBusinessServiceDelegate.invokeService(DotsBusinessServiceDelegate.java:96)
at org.ifc.dots.web.aggregation.DOTSXMLHelper.getXML(DOTSXMLHelper.java:468)
at org.ifc.dots.web.servlet.DOTSWebServlet.getXMLElement(DOTSWebServlet.java:126)
at org.ifc.framework.web.servlet.BaseWebServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1449)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:790)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:1995)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolve_binding(WsnOptimizedNamingImpl.java:1675)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:580)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2163)
at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:538)
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2792)
at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2788)
at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:762)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:2786)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1789)
... 34 more
Caused by: org.omg.CORBA.OBJECT_NOT_EXIST: SERVANT_NOT_FOUND (4) for key 0x49454a50020033e2132d077365727665723103454a420000005cacac0002000100290000005f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d6573235f5f686f6d654f66486f6d657308444f5453494923444f54534949456a622e6a617223444f54535374617274757053657276696365 vmcid: IBM minor code: C14 completed: No
at com.ibm.rmi.corba.ObjectManager.lookupServant(ObjectManager.java:110)
at com.ibm.CORBA.iiop.ServerDelegate.getServant(ServerDelegate.java:311)
at com.ibm.rmi.iiop.ORB.lookupLocalObject(ORB.java:592)
at com.ibm.CORBA.iiop.ORB.lookupLocalObject(ORB.java:1465)
at com.ibm.rmi.iiop.CDRReader.newObjRef(CDRReader.java:1290)
at com.ibm.rmi.iiop.CDRReader.read_Object(CDRReader.java:1130)
at com.ibm.rmi.iiop.CDRReader.read_Object(CDRReader.java:1094)
at com.ibm.rmi.corba.IorURL.iorbytesToObjref(IorURL.java:105)
at com.ibm.rmi.corba.IorURL.resolve(IorURL.java:93)
at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3718)
at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3256)
at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3619)
at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.resolveUnresolvedBinding(WsnOptimizedNamingImpl.java:1921)
... 43 more

errors deploying an EAR with EJBs 2.1 into JBoss AS5

I'm porting an application with EJBs 2.1 from Weblogic9 to JBoss AS5. I have made some of the changes like adding jboss.xml descriptors to EJBs and fixing application.xml of the EAR, but there are still problems when deploying the EAR. Here is a summary of the the latest error I'm getting when the first EJB is being deployed by JBoss (I will add the full stack trace at the end of the message):
14:15:48,124 ERROR [AbstractKernelController] Error installing to Parse: name=vf
sfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/ state
=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for v
fsfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/admin
-ejb.jar/
....
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed
to parse schema for nsURI=, baseURI=null, schemaLocation=http://www.jboss.org/j2ee/dtd/jboss_2_4.dtd
....
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 94:3 The markup in the document preceding the root element must be well-formed.
Is this a problem with parsing the jboss_2_4.dtd itself? or is it something worng with my descriptors for the EJB?
When I try to validate the jboss_2_4.dtd in an XML editor it does complain about a syntax error at line 94:1 , which is the beginning of the first declaration, although it looks fine. Any ideas?
Thanks!
Marina
Full error stack trace:
14:15:48,124 ERROR [AbstractKernelController] Error installing to Parse: name=vf
sfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/ state
=Not Installed mode=Manual requiredState=Parse
org.jboss.deployers.spi.DeploymentException: Error creating managed object for v
fsfile:/C:/Marina/Tools/jboss-5.1.0.GA/server/default/deploy/contracts.ear/admin
-ejb.jar/
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentExcept
ion(DeploymentException.java:49)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:362)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:322)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:294)
at org.jboss.deployment.JBossEjbParsingDeployer.createMetaData(JBossEjbP
arsingDeployer.java:95)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.deploy(AbstractParsingDeployerWithOutput.java:234)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deployer
Wrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deployer
sImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFi
rst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deployers
Impl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deployers
Impl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeploye
rImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter
.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction
.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileActi
on.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileServ
ice.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:553)
at org.jboss.system.server.profileservice.repository.AbstractProfileServ
ice.activateProfile(AbstractProfileService.java:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(
ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:
461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed
to parse schema for nsURI=, baseURI=null, schemaLocation=http://www.jboss.org/j
2ee/dtd/jboss_2_4.dtd
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBPars
er.java:203)
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java
:168)
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:189)
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(Sch
emaResolverDeployer.java:137)
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(Sch
emaResolverDeployer.java:121)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
AndInit(AbstractVFSParsingDeployer.java:256)
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse
(AbstractVFSParsingDeployer.java:188)
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithO
utput.createMetaData(AbstractParsingDeployerWithOutput.java:348)
... 35 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to parse schema
for nsURI=, baseURI=null, schemaLocation=http://www.jboss.org/j2ee/dtd/jboss_2_4
.dtd
at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(A
bstractMutableSchemaResolver.java:293)
at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startE
lement(SundayContentHandler.java:274)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHan
dler.startElement(SaxJBossXBParser.java:401)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Sour
ce)
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Sourc
e)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Sourc
e)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkn
own Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.s
canRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Sour
ce)
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBPars
er.java:199)
... 43 more
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 94:3 The markup i
n the document preceding the root element must be well-formed.
at org.jboss.xb.binding.sunday.unmarshalling.XsdBinderTerminatingErrorHa
ndler.handleError(XsdBinderTerminatingErrorHandler.java:40)
at org.apache.xerces.impl.xs.XMLSchemaLoader.reportDOMFatalError(Unknown
Source)
at org.apache.xerces.impl.xs.XSLoaderImpl.load(Unknown Source)
at org.jboss.xb.binding.Util.loadSchema(Util.java:395)
at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.ja
va:176)
at org.jboss.xb.binding.sunday.unmarshalling.XsdBinder.bind(XsdBinder.ja
va:147)
at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(A
bstractMutableSchemaResolver.java:285)
... 58 more
I'd like to see your jboss.xml but I really wonder why you're using this very dusty jboss_2_4.dtd (the "JBoss 2.4 EJB deploymentDescriptor"). Since you're using JBoss AS 5.1, I'd recommend using the moderner jboss_5_1.xsd schema instead (see JBossDTDs for reference). Below an empty sample:
<jboss xmlns="http://www.jboss.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss_5_1.xsd"
version="3.0">
</jboss>

Resources