我的配置中有这个bean定义:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-53-6c1545864b12> in <module>()
6
7 kmeans = KMeans()
----> 8 kmeans.fit(df)
~/anaconda3/envs/pds/lib/python3.6/site-packages/dask_ml/cluster/k_means.py in fit(self, X, y)
187
188 def fit(self, X, y=None):
--> 189 X = self._check_array(X)
190 labels, centroids, inertia, n_iter = k_means(
191 X,
~/anaconda3/envs/pds/lib/python3.6/site-packages/dask_ml/utils.py in wraps(*args, **kwargs)
298 def wraps(*args, **kwargs):
299 with _timer(f.__name__, _logger=logger, level=level):
--> 300 results = f(*args, **kwargs)
301 return results
302
~/anaconda3/envs/pds/lib/python3.6/site-packages/dask_ml/cluster/k_means.py in _check_array(self, X)
159 elif isinstance(X, dd.DataFrame):
160 raise TypeError(
--> 161 "Cannot fit on dask.dataframe due to unknown " "partition lengths."
162 )
163
TypeError: Cannot fit on dask.dataframe due to unknown partition lengths.
还有我的context.xml:
public class MyAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler {
private String defaultFailureUrl;
public String getDefaultFailureUrl() {
return defaultFailureUrl;
}
public void setDefaultFailureUrl(String defaultFailureUrl) {
this.defaultFailureUrl = defaultFailureUrl;
}
@Override
public void onAuthenticationFailure (HttpServletRequest request, HttpServletResponse response,
AuthenticationException exception) throws IOException, ServletException {
// do logging and login failure counts etc...
logger.debug("Sending redirect to:"+defaultFailureUrl);
response.sendRedirect(defaultFailureUrl);
}
在日志中,我得到“发送重定向到:空”
为什么将defaultFailureUrl设置为null?我在上下文中设置属性值。我在这里做什么错了?