Redirecting to Site whenever any AfterThrowing Aspect is called - aop

i am written one aspect i want whenever this is called or any exception occurs , we redirect this to http://google.com
#AfterThrowing(pointcut = "execution(* com.ts.templateService.*.*(..))", throwing = "e")
public void LocalAfterThrowing(JoinPoint joinPoint, Throwable e) {
Signature signature = joinPoint.getSignature();
String methodName = signature.getName();
String stuff = signature.toString();
String arguments = Arrays.toString(joinPoint.getArgs());
System.out.println("Got Exception in the Method: "
+ methodName + " with arguments "
+ arguments + "\nand the full toString: " + stuff + "\nthe exception is: "
+ e.getMessage());
}

Related

Passing Variables into Dapper are query parameters... "A request to send or receive data was disallowed because the socket is not connected

Ok , I"m doing what looks like a simple Dapper query
but if I pass in my studId parameter, it blows up with this low level networking exception:
{"A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied."}
if I comment out the line of sql that uses it, fix the where clause, ,and comment out the line where it's added the the parameters object. It retrieves rows as expected.
I've spent the last 2.5 days trying everything I could think of, changing the names to match common naming patterns, changing type to a string (just gave a error converting string to number), yadda yadda yadda..
I'm at a complete loss as to why it doesn't like that parameter, I look at other code that works and they pass Id's just fine...
At this point I figure it has to be an ID-10-t that's staring me in the face and I'm just assuming my way right past it with out seeing it.
Any help is appreciated
public List<StudDistLearnSchedRawResponse> GetStudDistanceLearningScheduleRaw( StudDistLearnSchedQueryParam inputs )
{
var aseSqlConnectionString = Configuration.GetConnectionString( "SybaseDBDapper" );
string mainSql = " SELECT " +
" enrollment.stud_id, " +
" sched_start_dt, " +
" sched_end_dt, " +
" code.code_desc, " +
" student_schedule_dl.enrtype_id, " +
" student_schedule_dl.stud_sched_dl_id, " +
" dl_correspond_cd, " +
" course.course_name, " +
" stud_course_sched_dl.sched_hours, " +
" actual_hours, " +
" course_comments as staff_remarks, " + // note this column rename - EWB
" stud_course_sched_dl.sched_item_id , " +
" stud_course_sched_dl.stud_course_sched_dl_id " +
" from stud_course_sched_dl " +
" join student_schedule_dl on student_schedule_dl.stud_sched_dl_id = stud_course_sched_dl.stud_sched_dl_id " +
" join course on stud_course_sched_dl.sched_item_id = course.sched_item_id " +
" left join code on student_schedule_dl.dl_correspond_cd = code.code_id " +
" join enrollment_type on student_schedule_dl.enrtype_id = enrollment_type.enrtype_id " +
" join enrollment on enrollment_type.enr_id = enrollment.enr_id " +
" where enrollment.stud_id = #studId " +
" and sched_start_dt >= #startOfWeek" +
" and sched_end_dt <= #startOfNextWeek";
DapperTools.DapperCustomMapping<StudDistLearnSchedRawResponse>();
//string sql = query.ToString();
DateTime? startOfWeek = StartOfWeek( inputs.weekStartDateTime, DayOfWeek.Monday );
DateTime? startOfNextWeek = StartOfWeek( inputs.weekStartDateTime.Value.AddDays( 7 ) , DayOfWeek.Monday );
try
{
using ( IDbConnection db = new AseConnection( aseSqlConnectionString ) )
{
db.Open();
var arguments = new
{
studId = inputs.StudId, // it chokes and gives a low level networking error - EWB
startOfWeek = startOfWeek.Value.ToShortDateString(),
startOfNextWeek = startOfNextWeek.Value.ToShortDateString(),
};
List<StudDistLearnSchedRawResponse> list = new List<StudDistLearnSchedRawResponse>();
list = db.Query<StudDistLearnSchedRawResponse>( mainSql, arguments ).ToList();
return list;
}
}
catch (Exception ex)
{
Trace.WriteLine(ex.ToString());
return null;
}
}
Here is the input object
public class StudDistLearnSchedQueryParam
{
public Int64 StudId;
public DateTime? weekStartDateTime;
}
Here is the dapper tools object which just abstracts some ugly code to look nicer.
namespace EricSandboxVue.Utilities
{
public interface IDapperTools
{
string ASEConnectionString { get; }
AseConnection _aseconnection { get; }
void ReportSqlError( ILogger DalLog, string sql, Exception errorFound );
void DapperCustomMapping< T >( );
}
public class DapperTools : IDapperTools
{
public readonly string _aseconnectionString;
public string ASEConnectionString => _aseconnectionString;
public AseConnection _aseconnection
{
get
{
return new AseConnection( _aseconnectionString );
}
}
public DapperTools( )
{
_aseconnectionString = Environment.GetEnvironmentVariable( "EIS_ASESQL_CONNECTIONSTRING" );
}
public void ReportSqlError( ILogger DalLog, string sql, Exception errorFound )
{
DalLog.LogError( "Error in Sql" );
DalLog.LogError( errorFound.Message );
//if (env.IsDevelopment())
//{
DalLog.LogError( sql );
//}
throw errorFound;
}
public void DapperCustomMapping< T >( )
{
// custom mapping
var map = new CustomPropertyTypeMap(
typeof( T ),
( type, columnName ) => type.GetProperties( ).FirstOrDefault( prop => GetDescriptionFromAttribute( prop ) == columnName )
);
SqlMapper.SetTypeMap( typeof( T ), map );
}
private string GetDescriptionFromAttribute( System.Reflection.MemberInfo member )
{
if ( member == null ) return null;
var attrib = (Dapper.ColumnAttribute) Attribute.GetCustomAttribute( member, typeof(Dapper.ColumnAttribute), false );
return attrib == null ? null : attrib.Name;
}
}
}
If I change the SQL string building to this(below), but leave everything else the same(Including StudId in the args struct)... it doesn't crash and retrieves rows, so it's clearly about the substitution of #studId...
// " where enrollment.stud_id = #studId " +
" where sched_start_dt >= #startOfWeek" +
" and sched_end_dt <= #startOfNextWeek";
You name your data members wrong. I had no idea starting a variable name with # was possible.
The problem is here:
var arguments = new
{
#studId = inputs.StudId, // it chokes and gives a low level networking error - EWB
#startOfWeek = startOfWeek.Value.ToShortDateString(),
#startOfNextWeek = startOfNextWeek.Value.ToShortDateString(),
};
It should have been:
var arguments = new
{
studId = inputs.StudId, // it chokes and gives a low level networking error - EWB
startOfWeek = startOfWeek.Value.ToShortDateString(),
startOfNextWeek = startOfNextWeek.Value.ToShortDateString(),
};
The # is just a hint to Dapper, that it should replace with a corresponding member name.
## has special meaning in some SQL dialects, that's probably what makes the trouble.
So here's what I Found out.
The Sybase implementation has a hard time with Arguments.
It especially has a hard time with arguments of type int64 (this existed way pre .NetCore)
So If you change the type of the passed in argument from int64 to int32, everything works fine.
You can cast it, or just change the type of the method parameter

Coded UI c# - how to click a table htmlcell

I have tried numerous things to access a cell in a table. I have actually found the row that I need based on an innertext search, but then when I change the columnindex to the column for the found row, I cannot get mouse.click(cell); to do anything. Please see my code below. It has been modified many times! I have also used record to capture information about the cell.
The Method:
` public string SelectExistingCustomer(UITestControl parent, TestContext TestContext, string sLastName)
{
Controls control = new Controls(this.parent);
EditControl econtrol = new EditControl(this.parent);
HtmlTable tCustomerSearch = new HtmlTable(this.parent);
//HtmlTable tCustomerSearch1 = tCustomerSearch;
HtmlCell cell = new HtmlCell(tCustomerSearch);
//HtmlCell cell = GetCell;
string sFullName = "";
string sRowIndex = "";
if (sLastName != "")
{
try
{
// CodedUI scrolls items into view before it can click them
bool notfound = true;
int NumberOfpages = 0;
while (notfound)
{
tCustomerSearch.SearchProperties.Add(HtmlTable.PropertyNames.TagName, "TABLE");
Trace.WriteLine("####tCustomerSearch??? : " + tCustomerSearch + " : TABLE.");
tCustomerSearch.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
int rowcount = tCustomerSearch.RowCount;
Trace.WriteLine("Row###: " + rowcount + ".");
HtmlRow lastRow = (HtmlRow)tCustomerSearch.Rows[rowcount - 1];
//lastRow.EnsureClickable();
NumberOfpages++;
cell.SearchProperties.Add(HtmlCell.PropertyNames.InnerText, sLastName, PropertyExpressionOperator.Contains);
cell.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch);
if (cell.TryFind())
{
notfound = false;
sFullName = cell.GetProperty(HtmlCell.PropertyNames.InnerText).ToString();
sRowIndex = cell.GetProperty(HtmlCell.PropertyNames.RowIndex).ToString();
Trace.WriteLine(string.Format("found name at page {0}", NumberOfpages));
Trace.WriteLine(string.Format("Table row nr: {0}", cell.RowIndex));
Trace.WriteLine("cell####: " + cell + ".");
}
else Trace.WriteLine("NOT FOUND: CELL###:" + cell + ". And sFullName: " + sFullName + ".");
}
Trace.WriteLine("CELL###:" + cell + ". And sFullName: " + sFullName + ". And sRowIndex: " + sRowIndex + ".");
cell.SearchProperties.Add(HtmlCell.PropertyNames.RowIndex, sRowIndex);
cell.SearchProperties.Add(HtmlCell.PropertyNames.ColumnIndex, "0");
cell.SearchProperties[HtmlCell.PropertyNames.InnerText] = "Get";
cell.SetFocus();
//HtmlInputButton stry = new HtmlInputButton(cell);
Mouse.Click(cell);
//Mouse.Click(stry);
Assert.IsTrue(!notfound);
}
catch (Exception ex)
{
Trace.WriteLine("Failed to Search and find. Exception: " + ex + ".");
return "Failed";
}
}
//else - For the Future
return sFullName;
}
Table and cell - I modified this from the recording, not really sure what this does but I did something similar when I was having difficulty selecting from a combox:
public class tCustomerSearch : HtmlTable
{
public tCustomerSearch(UITestControl searchLimitContainer) :
base(searchLimitContainer)
{
#region Search Criteria
this.FilterProperties[HtmlTable.PropertyNames.ControlDefinition] = "class=\"table table-striped\"";
this.FilterProperties[HtmlTable.PropertyNames.Class] = "table table-striped";
this.FilterProperties[HtmlTable.PropertyNames.TagInstance] = "1";
#endregion
}
#region Properties
public HtmlCell GetCell
{
get
{
if ((this.mGetCell == null))
{
this.mGetCell = new HtmlCell(this);
#region Search Criteria
this.mGetCell.SearchProperties[HtmlCell.PropertyNames.InnerText] = "Get";
//this.GetCell.SearchProperties[HtmlCell.PropertyNames.MaxDepth] = "3";
Trace.WriteLine("###sLastName: " + sLastName + ". And mGetCell: " + mGetCell + ".");
#endregion
}
return this.mGetCell;
}
}
#endregion
// public string ctrlPropertyValue { get; private set; }
public string sLastName { get; }
#region Fields
private HtmlCell mGetCell;
#endregion
}
`
So, I found my own answer - even though this is not the best - it works!
` Keyboard.SendKeys("{TAB}");
Keyboard.SendKeys("{ENTER}");
'
I use this in place of mouse.click(cell);
The TAB highlights the button in the cell, and Enter triggers the event.

Restar Loader can't update gridview

I've got two SQL tables inner join with content provider query builder. My loader shows the first in a gridview like a charm. The second table has been created to show a favorite list and so it has primary key, foreign key and another column. By the way when I try to retrieve value from this one I get null. Some suggestions, please!
I have this in content provider:
static {
sMovieByFavoriteQueryBuilder = new SQLiteQueryBuilder();
sMovieByFavoriteQueryBuilder.setTables(
MoviesContract.FavoriteEntry.TABLE_NAME + " INNER JOIN " +
MoviesContract.MovieEntry.TABLE_NAME +
" ON " + MoviesContract.FavoriteEntry.TABLE_NAME +
"." + MoviesContract.FavoriteEntry.COLUMN_FAVORITE_KEY +
" = " + MoviesContract.MovieEntry.TABLE_NAME +
"." + MoviesContract.MovieEntry._ID);
}
private static final String sFavoriteSelection =
MoviesContract.FavoriteEntry.TABLE_NAME +
"." + MoviesContract.FavoriteEntry.COLUMN_MOVIE_ID + " = ? AND " +
MoviesContract.FavoriteEntry.COLUMN_MOVIE_POSTER + " = ? AND " +
MoviesContract.MovieEntry.COLUMN_RELEASE_DATE + " = ? AND " +
MoviesContract.MovieEntry.COLUMN_MOVIE_POSTER + " = ? AND " +
MoviesContract.MovieEntry.COLUMN_ORIGINAL_TITLE + " = ? AND " +
MoviesContract.MovieEntry.COLUMN_SYNOSIS + " = ? AND " +
MoviesContract.MovieEntry.COLUMN_USER_RATING + " = ? ";
I call this method by uri from fragment:
#Override
public void onActivityCreated(Bundle savedInstanceState) {
getLoaderManager().initLoader(MOVIES_LOADER, null, this);
getLoaderManager().initLoader(FAVORITE_LOADER, null, this);
super.onActivityCreated(savedInstanceState);
}
void onSortChanged() {
System.out.println("onSortChanged: true");
updateMovies();
getLoaderManager().restartLoader(MOVIES_LOADER, null, this);
System.out.println("LoaderManager: " + getLoaderManager().restartLoader(MOVIES_LOADER, null, this));
}
void onFavorite() {
getLoaderManager().restartLoader(FAVORITE_LOADER, null, this);
mMoviesAdapter.setSelectedIndex(mPosition);
mMoviesAdapter.notifyDataSetChanged();
}
private void updateMovies() {
PopularMoviesSyncAdapter.syncImmediately(getActivity());
}
#Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
if (MainActivity.mFavorite == true) {
String sortOrder = MoviesContract.FavoriteEntry.COLUMN_FAVORITE_KEY;
String sortSetting = Utility.getPreferredSort(getActivity());
Uri movieFavoriteUri = MoviesContract.MovieEntry.buildMovieWithSortDate(sortSetting, System.currentTimeMillis());
System.out.println("movieFavoriteUri: " + movieFavoriteUri);
cursorFav = new CursorLoader(getActivity(),
movieFavoriteUri,
FAVORITE_COLUMNS,
null,
null,
sortOrder);
return cursorFav;
} else {
String sortOrder = MoviesContract.MovieEntry.COLUMN_DATE;
String sortSetting = Utility.getPreferredSort(getActivity());
System.out.println("sortSetting: " + sortSetting);
Uri movieForSortUri = MoviesContract.MovieEntry.buildMovieSort(sortSetting);
System.out.println("movieForSortUri: " + movieForSortUri);
cursorMov = new CursorLoader(getActivity(),
movieForSortUri,
MOVIES_COLUMNS,
null,
null,
sortOrder);
return cursorMov;
}
}
#Override
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
mMoviesAdapter.swapCursor(data);
if (mPosition != GridView.INVALID_POSITION) {
// If we don't need to restart the loader, and there's a desired position to restore
// to, do so now.
mGridView.smoothScrollToPosition(mPosition);
}
}
#Override
public void onLoaderReset(Loader<Cursor> loader) {
mMoviesAdapter.swapCursor(null);
}
Instead of:
sMovieByFavoriteQueryBuilder.setTables(
MoviesContract.FavoriteEntry.TABLE_NAME + " INNER JOIN " +
MoviesContract.MovieEntry.TABLE_NAME +
" ON " + MoviesContract.FavoriteEntry.TABLE_NAME +
"." + MoviesContract.FavoriteEntry.COLUMN_FAVORITE_KEY +
" = " + MoviesContract.MovieEntry.TABLE_NAME +
"." + MoviesContract.MovieEntry._ID);
Create a string so you can debug it easy.
strTables = MoviesContract.FavoriteEntry.TABLE_NAME + " INNER JOIN " +
MoviesContract.MovieEntry.TABLE_NAME +
" ON " + MoviesContract.FavoriteEntry.TABLE_NAME +
"." + MoviesContract.FavoriteEntry.COLUMN_FAVORITE_KEY +
" = " + MoviesContract.MovieEntry.TABLE_NAME +
"." + MoviesContract.MovieEntry._ID);
sMovieByFavoriteQueryBuilder.setTables(strTables);
Then try to run that join direct on db. My guess is the query have some issues.
I checked and the query works good. But my method can't return anything
private Cursor getMovieByFavorite(Uri uri, String[] projection, String movieId) {
String sortSetting = MoviesContract.MovieEntry.getFavoriteFromUri(uri);
long date = MoviesContract.MovieEntry.getDateFromUri(uri);
String[] selectionArgs;
String selection;
selection = sFavoriteSelection;
selectionArgs = new String[]{sortSetting};
return sMovieByFavoriteQueryBuilder.query(mOpenHelper.getReadableDatabase(),
projection,
selection,
null,
null,
null,
movieId
);
}

Failed to parse resource-request java.net.URISyntaxException: Expected scheme name at index 0: ://

I try to make yarn application master and runs application on hadoop 2. These are sources
=== Client.java
public class MyClient {
Configuration conf = new YarnConfiguration();
public void run(String[] args) throws Exception {
final int n = 1;
final Path jarPath = new Path("./");
YarnConfiguration conf = new YarnConfiguration();
YarnClient yarnClient = YarnClient.createYarnClient();
yarnClient.init(conf);
yarnClient.start();
YarnClientApplication app = yarnClient.createApplication();
ContainerLaunchContext amContainer = Records.newRecord(ContainerLaunchContext.class);
amContainer.setCommands(
Collections.singletonList(
"$JAVA_HOME/bin/java" + " -Xmx256M" + " com.aaa.yarn.MyApplicationMaster" + " " + jarPath +
" " + String.valueOf(n) +
" 1>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout" +
" 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stderr"
)
);
LocalResource appMasterJar = Records.newRecord(LocalResource.class);
setupAppMasterJar(jarPath, appMasterJar);
amContainer.setLocalResources(Collections.singletonMap("YarnHelloWorld.jar", appMasterJar));
Map<String, String> appMasterEnv = new HashMap<String, String>();
setupAppMasterEnv(appMasterEnv);
amContainer.setEnvironment(appMasterEnv);
Resource capability = Records.newRecord(Resource.class);
capability.setMemory(256);
capability.setVirtualCores(1);
ApplicationSubmissionContext appContext = app.getApplicationSubmissionContext();
appContext.setApplicationName("Yarn_Hello_World"); // application name
appContext.setAMContainerSpec(amContainer);
appContext.setResource(capability);
appContext.setQueue("default"); // queue
ApplicationId appId = appContext.getApplicationId();
System.out.println("Submitting application " + appId);
yarnClient.submitApplication(appContext);
ApplicationReport appReport = yarnClient.getApplicationReport(appId);
YarnApplicationState appState = appReport.getYarnApplicationState();
while (appState != YarnApplicationState.FINISHED && appState != YarnApplicationState.KILLED &&
appState != YarnApplicationState.FAILED) {
Thread.sleep(100);
appReport = yarnClient.getApplicationReport(appId);
appState = appReport.getYarnApplicationState();
}
System.out.println("Application " + appId + " finished with" + " state " + appState + " at " + appReport.getFinishTime());
}
private void setupAppMasterJar(Path jarPath, LocalResource appMasterJar) throws IOException {
FileStatus jarStat = FileSystem.get(conf).getFileStatus(jarPath);
appMasterJar.setResource(ConverterUtils.getYarnUrlFromPath(jarPath));
appMasterJar.setSize(jarStat.getLen());
appMasterJar.setTimestamp(jarStat.getModificationTime());
appMasterJar.setType(LocalResourceType.FILE);
appMasterJar.setVisibility(LocalResourceVisibility.PUBLIC);
}
private void setupAppMasterEnv(Map<String, String> appMasterEnv) {
StringBuilder classPathEnv = new StringBuilder(Environment.CLASSPATH.$$())
.append(ApplicationConstants.CLASS_PATH_SEPARATOR).append("./*");
for (String c : conf.getStrings(YarnConfiguration.YARN_APPLICATION_CLASSPATH,
YarnConfiguration.DEFAULT_YARN_CROSS_PLATFORM_APPLICATION_CLASSPATH)) {
classPathEnv.append(ApplicationConstants.CLASS_PATH_SEPARATOR);
classPathEnv.append(c.trim());
}
appMasterEnv.put("CLASSPATH", classPathEnv.toString());
}
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
MyClient c = new MyClient();
c.run(args);
}
}
=== My Application Master
public class MyApplicationMaster {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
final int n = 1;
Configuration conf = new YarnConfiguration();
AMRMClient<ContainerRequest> rmClient = AMRMClient.createAMRMClient();
rmClient.init(conf);
rmClient.start();
NMClient nmClient = NMClient.createNMClient();
nmClient.init(conf);
nmClient.start();
System.out.println("registerApplicationMaster 0");
rmClient.registerApplicationMaster("", 0, "");
System.out.println("registerApplicationMaster 1");
Priority priority = Records.newRecord(Priority.class);
priority.setPriority(0);
Resource capability = Records.newRecord(Resource.class);
capability.setMemory(128);
capability.setVirtualCores(1);
for (int i = 0; i < n; ++i) {
ContainerRequest containerAsk = new ContainerRequest(capability, null, null, priority);
System.out.println("Making res-req " + i);
rmClient.addContainerRequest(containerAsk);
}
int responseId = 0;
int completedContainers = 0;
while (completedContainers < n) {
AllocateResponse response = rmClient.allocate(responseId++);
for (Container container : response.getAllocatedContainers()) {
ContainerLaunchContext ctx = Records.newRecord(ContainerLaunchContext.class);
ctx.setCommands(
Collections.singletonList(
"$JAVA_HOME/bin/java" + " -Xmx256M" + " com.aaa.yarn.YarnHelloWorld" +
" 1>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout" +
" 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stderr"
));
System.out.println("Launching container " + container.getId());
nmClient.startContainer(container, ctx);
}
for (ContainerStatus status : response.getCompletedContainersStatuses()) {
++completedContainers;
System.out.println("Completed container " + status.getContainerId());
}
Thread.sleep(100);
}
rmClient.unregisterApplicationMaster(
FinalApplicationStatus.SUCCEEDED, "", "");
}
}
But deployment is failed. In nodemanager log the following exception is thrown
WARN org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container: Failed to parse resource-request
java.net.URISyntaxException: Expected scheme name at index 0: ://
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.failExpecting(URI.java:2854)
at java.net.URI$Parser.parse(URI.java:3046)
at java.net.URI.<init>(URI.java:746)
at org.apache.hadoop.yarn.util.ConverterUtils.getPathFromYarnURL(ConverterUtils.java:80)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest.<init>(LocalResourceRequest.java:46)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl$RequestResourcesTransition.transition(ContainerImpl.java:632)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl$RequestResourcesTransition.transition(ContainerImpl.java:590)
at org.apache.hadoop.yarn.state.StateMachineFactory$MultipleInternalArc.doTransition(StateMachineFactory.java:385)
at org.apache.hadoop.yarn.state.StateMachineFactory.doTransition(StateMachineFactory.java:302)
at org.apache.hadoop.yarn.state.StateMachineFactory.access$300(StateMachineFactory.java:46)
at org.apache.hadoop.yarn.state.StateMachineFactory$InternalStateMachine.doTransition(StateMachineFactory.java:448)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl.handle(ContainerImpl.java:992)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerImpl.handle(ContainerImpl.java:76)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl$ContainerEventDispatcher.handle(ContainerManagerImpl.java:1065)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl$ContainerEventDispatcher.handle(ContainerManagerImpl.java:1058)
at org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:173)
at org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:106)
at java.lang.Thread.run(Thread.java:745)
I think there is some problem on this line
amContainer.setCommands(
Collections.singletonList(
"Environment.JAVA_HOME.$$()" + "/bin/java" + " -Xmx256M" + " com.aaa.yarn.MyApplicationMaster" + " " + jarPath +
" " + String.valueOf(n) +
" 1>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout" +
" 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stderr"
)
);
But I have no idea.

EclipseLink doesnt accept DateString?

I got the following em Query and Exceptions:
public List<Service> findServicesFromHelperBetween(long idPerson, String from, String to) throws DAOException {
List<Service> servicesFromHelperBetween = new ArrayList<Service>();
try {
em.getTransaction().begin();
servicesFromHelperBetween = em.createQuery("SELECT S FROM Service S WHERE S.helper.idPerson = " + idPerson + " AND S.date BETWEEN " + from
+ " AND " + to).getResultList();
em.getTransaction().commit();
}
catch (Exception e) {
em.getTransaction().rollback();
throw ExceptionBuilder.findServiceFailedInDAO(e, Service.class);
}
return servicesFromHelperBetween;
}
Exception:
Exception Description: Syntax error parsing [SELECT S FROM Service S WHERE S.helper.idPerson = 8 AND S.date BETWEEN 01.11.2014 AND 30.11.2014].
[71, 73] The identification variable '01' is not following the rules for a Java identifier.
[86, 88] The identification variable '30' is not following the rules for a Java identifier.
Try putting the parameters between single quotes
em.createQuery("SELECT S FROM Service S WHERE S.helper.idPerson = " + idPerson + " AND S.date BETWEEN '" + from
+ "' AND '" + to + "'").getResultList();