Problem in running spring-boot application in debug mode: Thread [main] (Suspended (exception ClassNotFoundException)) - debugging

I am using Spring Tool Suite 4-4.8.1. The program runs perfectly while running as spring boot app but when running the app in debug mode, the process suspends. It automatically opens Class.class file. The following information is shown under debug tab:
Margin_Lending_Web - MarginLendingWebApplication [Spring Boot App]
com.margin_lending.MarginLendingWebApplication at localhost:55672
Thread [main] (Suspended (exception ClassNotFoundException))
owns: RMIConnectorServer (id=29)
owns: Class<T> (sun.management.jmxremote.ConnectorBootstrap) (id=27)
Class<T>.forName0(String, boolean, ClassLoader, Class<?>) line: not available [native method]
Class<T>.forName(String, boolean, ClassLoader) line: 468
Util.createSkeleton(Remote) line: 332
UnicastServerRef.setSkeleton(Remote) line: 256
UnicastServerRef.exportObject(Remote, Object, boolean) line: 229
ConnectorBootstrap$PermanentExporter.exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory, ObjectInputFilter) line: 205
RMIJRMPServerImpl.export(Remote, ObjectInputFilter) line: 153
RMIJRMPServerImpl.export() line: 138
RMIConnectorServer.start() line: 453
ConnectorBootstrap.exportMBeanServer(MBeanServer, int, int, boolean, boolean, String, String[], String[], boolean, boolean, String, String, boolean, String, String, String) line: 840
ConnectorBootstrap.startRemoteConnectorServer(String, Properties) line: 481
Agent.startAgent(Properties) line: 447
Agent.startAgent() line: 599
D:\sts-4.8.1.RELEASE\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_15.0.0.v20201014-1246\jre\bin\javaw.exe (Jan 26, 2023, 8:42:25 PM)
I tried to clean and update the project, but the problem persists.

Related

url_title(): Argument #1 ($str) must be of type string, null given, called in C:\xamppp\htdocs\codeigniter4\app\Controllers\Komik.php on line 57

url_title(): Argument #1 ($str) must be of type string, null given, called in C:\xamppp\htdocs\codeigniter4\app\Controllers\Komik.php on line 57
url_title(): Argument #1 ($str) must be of type string, null given, called in C:\xamppp\htdocs\codeigniter4\app\Controllers\Komik.php on line 57

OperationalError: Error connecting to Elasticsearch: elasticsearch-dbapi

I am trying to connect to Elasticsearch using the elasticsearch-dbapi library. I want to be able to execute SQL queries on my Elasticsearch cluster.
However, I keep getting this error when I attempt to run a query,
---------------------------------------------------------------------------
gaierror Traceback (most recent call last)
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connection.py:174, in HTTPConnection._new_conn(self)
173 try:
--> 174 conn = connection.create_connection(
175 (self._dns_host, self.port), self.timeout, **extra_kw
176 )
178 except SocketTimeout:
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\util\connection.py:72, in create_connection(address, timeout, source_address, socket_options)
68 return six.raise_from(
69 LocationParseError(u"'%s', label empty or too long" % host), None
70 )
---> 72 for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
73 af, socktype, proto, canonname, sa = res
File ~\Anaconda3\envs\elasticsearch\lib\socket.py:955, in getaddrinfo(host, port, family, type, proto, flags)
954 addrlist = []
--> 955 for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
956 af, socktype, proto, canonname, sa = res
gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
NewConnectionError Traceback (most recent call last)
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\elasticsearch\connection\http_urllib3.py:251, in Urllib3HttpConnection.perform_request(self, method, url, params, body, timeout, ignore, headers)
249 request_headers["content-encoding"] = "gzip"
--> 251 response = self.pool.urlopen(
252 method, url, body, retries=Retry(False), headers=request_headers, **kw
253 )
254 duration = time.time() - start
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connectionpool.py:787, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
785 e = ProtocolError("Connection aborted.", e)
--> 787 retries = retries.increment(
788 method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
789 )
790 retries.sleep()
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\util\retry.py:525, in Retry.increment(self, method, url, response, error, _pool, _stacktrace)
523 if self.total is False and error:
524 # Disabled, indicate to re-raise the error.
--> 525 raise six.reraise(type(error), error, _stacktrace)
527 total = self.total
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\packages\six.py:770, in reraise(tp, value, tb)
769 raise value.with_traceback(tb)
--> 770 raise value
771 finally:
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connectionpool.py:703, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
702 # Make the request on the httplib connection object.
--> 703 httplib_response = self._make_request(
704 conn,
705 method,
706 url,
707 timeout=timeout_obj,
708 body=body,
709 headers=headers,
710 chunked=chunked,
711 )
713 # If we're going to release the connection in ``finally:``, then
714 # the response doesn't need to know about the connection. Otherwise
715 # it will also try to release it and we'll have a double-release
716 # mess.
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connectionpool.py:386, in HTTPConnectionPool._make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
385 try:
--> 386 self._validate_conn(conn)
387 except (SocketTimeout, BaseSSLError) as e:
388 # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connectionpool.py:1042, in HTTPSConnectionPool._validate_conn(self, conn)
1041 if not getattr(conn, "sock", None): # AppEngine might not have `.sock`
-> 1042 conn.connect()
1044 if not conn.is_verified:
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connection.py:358, in HTTPSConnection.connect(self)
356 def connect(self):
357 # Add certificate verification
--> 358 self.sock = conn = self._new_conn()
359 hostname = self.host
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\urllib3\connection.py:186, in HTTPConnection._new_conn(self)
185 except SocketError as e:
--> 186 raise NewConnectionError(
187 self, "Failed to establish a new connection: %s" % e
188 )
190 return conn
NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x00000236CF7A3D60>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\es\baseapi.py:318, in BaseCursor.elastic_query(self, query)
317 try:
--> 318 response = self.es.transport.perform_request("POST", path, body=payload)
319 except es_exceptions.ConnectionError:
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\elasticsearch\transport.py:413, in Transport.perform_request(self, method, url, headers, params, body)
412 if attempt == self.max_retries:
--> 413 raise e
414 else:
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\elasticsearch\transport.py:381, in Transport.perform_request(self, method, url, headers, params, body)
380 try:
--> 381 status, headers_response, data = connection.perform_request(
382 method,
383 url,
384 params,
385 body,
386 headers=headers,
387 ignore=ignore,
388 timeout=timeout,
389 )
391 except TransportError as e:
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\elasticsearch\connection\http_urllib3.py:266, in Urllib3HttpConnection.perform_request(self, method, url, params, body, timeout, ignore, headers)
265 raise ConnectionTimeout("TIMEOUT", str(e), e)
--> 266 raise ConnectionError("N/A", str(e), e)
268 # raise warnings if any from the 'Warnings' header.
ConnectionError: ConnectionError(<urllib3.connection.HTTPSConnection object at 0x00000236CF7A3D60>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed) caused by: NewConnectionError(<urllib3.connection.HTTPSConnection object at 0x00000236CF7A3D60>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed)
During handling of the above exception, another exception occurred:
OperationalError Traceback (most recent call last)
Input In [16], in <cell line: 2>()
1 curs = conn.cursor()
----> 2 curs.execute(
3 "select * from kibana_sample_data_ecommerce LIMIT 10"
4 )
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\es\baseapi.py:36, in check_closed.<locals>.wrap(self, *args, **kwargs)
32 if self.closed:
33 raise exceptions.Error(
34 "{klass} already closed".format(klass=self.__class__.__name__)
35 )
---> 36 return f(self, *args, **kwargs)
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\es\elastic\api.py:158, in Cursor.execute(self, operation, parameters)
155 return self.get_array_type_columns(re_table_name[1])
157 query = apply_parameters(operation, parameters)
--> 158 results = self.elastic_query(query)
159 # We need a list of tuples
160 rows = [tuple(row) for row in results.get("rows", [])]
File ~\Anaconda3\envs\elasticsearch\lib\site-packages\es\baseapi.py:320, in BaseCursor.elastic_query(self, query)
318 response = self.es.transport.perform_request("POST", path, body=payload)
319 except es_exceptions.ConnectionError:
--> 320 raise exceptions.OperationalError("Error connecting to Elasticsearch")
321 except es_exceptions.RequestError as ex:
322 raise exceptions.ProgrammingError(f"Error ({ex.error}): {ex.info}")
OperationalError: Error connecting to Elasticsearch
This is what my code looks like,
from es.elastic.api import connect
conn = connect(
host='https://<endpoint-alias>.es.eastus2.azure.elastic-cloud.com',
port=9200,
scheme="https",
user='elastic',
password='<password>'
)
curs = conn.cursor()
curs.execute(
"select * from kibana_sample_data_ecommerce LIMIT 10"
)
What exactly is the problem here?
Note: I am using the elasticsearch-dbapi package because although it is possible to execute SQL queries using elasticsearch, there does not seem to be an option to scan through all of the results. I want to access all the hits that are returned by a query.
However, when I tried connecting using elasticsearch, it worked without any problem. But, I used the Cloud ID to establish the connection. Is there some issue with the host that I have used?

Getting HTTPError: HTTP Error 404: Not Found error when loaded a dataset using seaborn

I have a dataset with name "haberman.csv" in my current directory and upon trying to load the dataset with below load_dataset function then it throws an error saying HTTPError: HTTP Error 404: Not Found.
But when loaded a different dataset with name "tips.csv" in the same directory it works well.
What is the reason behind this error that one dataset when loaded works and another doesn't.
import seaborn as sns
sns.set()
haberman_plot = sns.load_dataset("haberman")
Error:
<ipython-input-58-fb9fa2439b0a> in <module>()
4
5 sns.set()
----> 6 haberman_plot = sns.load_dataset("haberman")
~/.local/lib/python3.6/site-packages/seaborn/utils.py in load_dataset(name, cache, data_home, **kws)
426 os.path.basename(full_path))
427 if not os.path.exists(cache_path):
--> 428 urlretrieve(full_path, cache_path)
429 full_path = cache_path
430
~/anaconda3/lib/python3.6/urllib/request.py in urlretrieve(url, filename, reporthook, data)
246 url_type, path = splittype(url)
247
--> 248 with contextlib.closing(urlopen(url, data)) as fp:
249 headers = fp.info()
250
~/anaconda3/lib/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
221 else:
222 opener = _opener
--> 223 return opener.open(url, data, timeout)
224
225 def install_opener(opener):
~/anaconda3/lib/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
530 for processor in self.process_response.get(protocol, []):
531 meth = getattr(processor, meth_name)
--> 532 response = meth(req, response)
533
534 return response
~/anaconda3/lib/python3.6/urllib/request.py in http_response(self, request, response)
640 if not (200 <= code < 300):
641 response = self.parent.error(
--> 642 'http', request, response, code, msg, hdrs)
643
644 return response
~/anaconda3/lib/python3.6/urllib/request.py in error(self, proto, *args)
568 if http_err:
569 args = (dict, 'default', 'http_error_default') + orig_args
--> 570 return self._call_chain(*args)
571
572 # XXX probably also want an abstract factory that knows when it makes
~/anaconda3/lib/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
502 for handler in handlers:
503 func = getattr(handler, meth_name)
--> 504 result = func(*args)
505 if result is not None:
506 return result
~/anaconda3/lib/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
648 class HTTPDefaultErrorHandler(BaseHandler):
649 def http_error_default(self, req, fp, code, msg, hdrs):
--> 650 raise HTTPError(req.full_url, code, msg, hdrs, fp)
651
652 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found```

XGboost keeps failing in Latest H2O stable release

I downloaded the latest release of H2O (3.18.0.1) and XGboost keeps failing. I am not sure whether to post to the JIRA issues or here.
h2o.init()
from h2o.estimators import H2OXGBoostEstimator
is_xgboost_available = H2OXGBoostEstimator.available()
train_path = 'https://s3.amazonaws.com/h2o-public-test-data/bigdata/laptop/higgs_train_imbalance_100k.csv'
test_path = 'https://s3.amazonaws.com/h2o-public-test-data/bigdata/laptop/higgs_test_imbalance_100k.csv'
df_train = h2o.import_file(train_path)
df_test = h2o.import_file(test_path)
# Transform first feature into categorical feature
df_train[0] = df_train[0].asfactor()
df_test[0] = df_test[0].asfactor()
param = {
"ntrees" : 500
}
model = H2OXGBoostEstimator(**param)
model.train(x = list(range(1, df_train.shape[1])), y = 0, training_frame = df_train)
I can run random forest, GBM without an issue but xgboost keeps failing.
I am running on Ubuntu 16.04. Java Version: java version "1.8.0_161"; Java(TM) SE Runtime Environment (build 1.8.0_161-b12); Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode). Anaconda Python 3.6
I reinstalled Anaconda and reinstalled JRE, but am still having the same issue.
It keeps giving me the following error:
xgboost Model Build progress: |████████████████████████████████████████
---------------------------------------------------------------------------
ConnectionResetError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
600 body=body, headers=headers,
--> 601 chunked=chunked)
602
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
386 # otherwise it looks like a programming error was the cause.
--> 387 six.raise_from(e, None)
388 except (SocketTimeout, BaseSSLError, SocketError) as e:
~/anaconda3/lib/python3.6/site-packages/urllib3/packages/six.py in raise_from(value, from_value)
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
382 try:
--> 383 httplib_response = conn.getresponse()
384 except Exception as e:
~/anaconda3/lib/python3.6/http/client.py in getresponse(self)
1330 try:
-> 1331 response.begin()
1332 except ConnectionError:
~/anaconda3/lib/python3.6/http/client.py in begin(self)
296 while True:
--> 297 version, status, reason = self._read_status()
298 if status != CONTINUE:
~/anaconda3/lib/python3.6/http/client.py in _read_status(self)
257 def _read_status(self):
--> 258 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
259 if len(line) > _MAXLINE:
~/anaconda3/lib/python3.6/socket.py in readinto(self, b)
585 try:
--> 586 return self._sock.recv_into(b)
587 except timeout:
ConnectionResetError: [Errno 104] Connection reset by peer
During handling of the above exception, another exception occurred:
ProtocolError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
439 retries=self.max_retries,
--> 440 timeout=timeout
441 )
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
638 retries = retries.increment(method, url, error=e, _pool=self,
--> 639 _stacktrace=sys.exc_info()[2])
640 retries.sleep()
~/anaconda3/lib/python3.6/site-packages/urllib3/util/retry.py in increment(self, method, url, response, error, _pool, _stacktrace)
356 if read is False or not self._is_method_retryable(method):
--> 357 raise six.reraise(type(error), error, _stacktrace)
358 elif read is not None:
~/anaconda3/lib/python3.6/site-packages/urllib3/packages/six.py in reraise(tp, value, tb)
684 if value.__traceback__ is not tb:
--> 685 raise value.with_traceback(tb)
686 raise value
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
600 body=body, headers=headers,
--> 601 chunked=chunked)
602
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
386 # otherwise it looks like a programming error was the cause.
--> 387 six.raise_from(e, None)
388 except (SocketTimeout, BaseSSLError, SocketError) as e:
~/anaconda3/lib/python3.6/site-packages/urllib3/packages/six.py in raise_from(value, from_value)
~/anaconda3/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
382 try:
--> 383 httplib_response = conn.getresponse()
384 except Exception as e:
~/anaconda3/lib/python3.6/http/client.py in getresponse(self)
1330 try:
-> 1331 response.begin()
1332 except ConnectionError:
~/anaconda3/lib/python3.6/http/client.py in begin(self)
296 while True:
--> 297 version, status, reason = self._read_status()
298 if status != CONTINUE:
~/anaconda3/lib/python3.6/http/client.py in _read_status(self)
257 def _read_status(self):
--> 258 line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
259 if len(line) > _MAXLINE:
~/anaconda3/lib/python3.6/socket.py in readinto(self, b)
585 try:
--> 586 return self._sock.recv_into(b)
587 except timeout:
ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
ConnectionError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/h2o/backend/connection.py in request(self, endpoint, data, json, filename, save_to)
399 headers=headers, timeout=self._timeout, stream=stream,
--> 400 auth=self._auth, verify=self._verify_ssl_cert, proxies=self._proxies)
401 self._log_end_transaction(start_time, resp)
~/anaconda3/lib/python3.6/site-packages/requests/api.py in request(method, url, **kwargs)
57 with sessions.Session() as session:
---> 58 return session.request(method=method, url=url, **kwargs)
59
~/anaconda3/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
507 send_kwargs.update(settings)
--> 508 resp = self.send(prep, **send_kwargs)
509
~/anaconda3/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
617 # Send the request
--> 618 r = adapter.send(request, **kwargs)
619
~/anaconda3/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
489 except (ProtocolError, socket.error) as err:
--> 490 raise ConnectionError(err, request=request)
491
ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
During handling of the above exception, another exception occurred:
H2OConnectionError Traceback (most recent call last)
<ipython-input-22-37b26d4dfbfd> in <module>()
1 start = time.time()
----> 2 model.train(x = list(range(1, df_train.shape[1])), y = 0, training_frame = df_train)
3 end = time.time()
4 print(end - start)
~/anaconda3/lib/python3.6/site-packages/h2o/estimators/estimator_base.py in train(self, x, y, training_frame, offset_column, fold_column, weights_column, validation_frame, max_runtime_secs, ignored_columns, model_id, verbose)
229 return
230
--> 231 model.poll(verbose_model_scoring_history=verbose)
232 model_json = h2o.api("GET /%d/Models/%s" % (rest_ver, model.dest_key))["models"][0]
233 self._resolve_model(model.dest_key, model_json)
~/anaconda3/lib/python3.6/site-packages/h2o/job.py in poll(self, verbose_model_scoring_history)
56 pb.execute(self._refresh_job_status, print_verbose_info=lambda x: self._print_verbose_info() if int(x * 10) % 5 == 0 else " ")
57 else:
---> 58 pb.execute(self._refresh_job_status)
59 except StopIteration as e:
60 if str(e) == "cancelled":
~/anaconda3/lib/python3.6/site-packages/h2o/utils/progressbar.py in execute(self, progress_fn, print_verbose_info)
167 # Query the progress level, but only if it's time already
168 if self._next_poll_time <= now:
--> 169 res = progress_fn() # may raise StopIteration
170 assert_is_type(res, (numeric, numeric), numeric)
171 if not isinstance(res, tuple):
~/anaconda3/lib/python3.6/site-packages/h2o/job.py in _refresh_job_status(self)
91 def _refresh_job_status(self):
92 if self._poll_count <= 0: raise StopIteration("")
---> 93 jobs = h2o.api("GET /3/Jobs/%s" % self.job_key)
94 self.job = jobs["jobs"][0] if "jobs" in jobs else jobs["job"][0]
95 self.status = self.job["status"]
~/anaconda3/lib/python3.6/site-packages/h2o/h2o.py in api(endpoint, data, json, filename, save_to)
101 # type checks are performed in H2OConnection class
102 _check_connection()
--> 103 return h2oconn.request(endpoint, data=data, json=json, filename=filename, save_to=save_to)
104
105
~/anaconda3/lib/python3.6/site-packages/h2o/backend/connection.py in request(self, endpoint, data, json, filename, save_to)
408 else:
409 self._log_end_exception(e)
--> 410 raise H2OConnectionError("Unexpected HTTP error: %s" % e)
411 except requests.exceptions.Timeout as e:
412 self._log_end_exception(e)
H2OConnectionError: Unexpected HTTP error: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Trying build a note app, Xcode 8, get this error

I've been following a tutorial (outdated as it says) and I'm trying to build my first note app. Unfortunately it is terminated before it even runs. Any help would be much appreciated. This is the code and at the end the crash-report. Cheers !
import UIKit
import CoreData
#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
// Saves changes in the application's managed object context before the application terminates.
self.saveContext()
}
// MARK: - Core Data stack
lazy var persistentContainer: NSPersistentContainer = {
/*
The persistent container for the application. This implementation
creates and returns a container, having loaded the store for the
application to it. This property is optional since there are legitimate
error conditions that could cause the creation of the store to fail.
*/
let container = NSPersistentContainer(name: "ToDo")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
/*
Typical reasons for an error here include:
* The parent directory does not exist, cannot be created, or disallows writing.
* The persistent store is not accessible, due to permissions or data protection when the device is locked.
* The device is out of space.
* The store could not be migrated to the current model version.
Check the error message to determine what the actual problem was.
*/
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
// MARK: - Core Data Saving support
func saveContext () {
let context = persistentContainer.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
let nserror = error as NSError
fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
}
}
}
}
This is the crash report I get
2017-05-14 21:04:58.079 ToDo[17123:3603269] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'must pass a class of kind UITableViewCell'
*** First throw call stack:
(
0 CoreFoundation 0x000000010fcbdb0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010cb39141 objc_exception_throw + 48
2 CoreFoundation 0x000000010fd26625 +[NSException raise:format:] + 197
3 UIKit 0x000000010d57fdde -[UITableView registerClass:forCellReuseIdentifier:] + 284
4 ToDo 0x000000010c5597db _TFC4ToDo14ViewController11viewDidLoadfT_T_ + 571
5 ToDo 0x000000010c5598e2 _TToFC4ToDo14ViewController11viewDidLoadfT_T_ + 34
6 UIKit 0x000000010d5c2cca -[UIViewController loadViewIfRequired] + 1235
7 UIKit 0x000000010d601b1c -[UINavigationController _layoutViewController:] + 56
8 UIKit 0x000000010d6023fa -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 466
9 UIKit 0x000000010d60256b -[UINavigationController _startTransition:fromViewController:toViewController:] + 127
10 UIKit 0x000000010d6036b3 -[UINavigationController _startDeferredTransitionIfNeeded:] + 843
11 UIKit 0x000000010d6047f1 -[UINavigationController __viewWillLayoutSubviews] + 58
12 UIKit 0x000000010d7f62bc -[UILayoutContainerView layoutSubviews] + 231
13 UIKit 0x000000010d4e320b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1268
14 QuartzCore 0x0000000112aa5904 -[CALayer layoutSublayers] + 146
15 QuartzCore 0x0000000112a99526 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 370
16 QuartzCore 0x0000000112a993a0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
17 QuartzCore 0x0000000112a28e92 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
18 QuartzCore 0x0000000112a55130 _ZN2CA11Transaction6commitEv + 468
19 QuartzCore 0x0000000112a55b37 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 115
20 CoreFoundation 0x000000010fc63717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
21 CoreFoundation 0x000000010fc63687 __CFRunLoopDoObservers + 391
22 CoreFoundation 0x000000010fc48038 CFRunLoopRunSpecific + 440
23 UIKit 0x000000010d41a02f -[UIApplication _run] + 468
24 UIKit 0x000000010d4200d4 UIApplicationMain + 159
25 ToDo 0x000000010c55d077 main + 55
26 libdyld.dylib 0x0000000110c5d65d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Resources