I'm working in Windows, I want to start sphinx search service. I tried firts to start by command line then in the list of Services panel but I have this error
windows could not start SphinxSearch service on local computer Error:
1067 The process terminated unexpectedly.
I've searched and tried solution in another post i ve found and nothing work
this is my config files C:\Sphinx\bin\sphinx.conf
searchd
{
listen= 127.0.0.1:9306:mysql41
log = C:\Sphinx\log\searchd.log
query_log = C:\Sphinx\log\query.log
pid_file = C:\Sphinx\log\searchd.pid
}
index news
{
source = news
path =C:\Sphinx\data\news
}
indexer
{
mem_limit = 32M
}
source news
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass =
sql_db = newssdz
sql_query_pre = SET NAMES utf8
sql_query = SELECT id\
, categorie\
, titre\
, contenu FROM news
sql_attr_uint = categorie
sql_query_info = SELECT titre FROM news WHERE id=$id
}
My error log files is empty so i can't find what is wrong.
I have already change my write permission for all folder.
Please help me to solve this.
Related
I write below code for uploading image in my app.I set path for uploading image. below code is full correctly in my system and company's server. but when i publish customer site . in host can't find this path and produce HTTP ERROR 404.0 -NOT Found.
`string pic = System.IO.Path.GetFileNameWithoutExtension(model.ImageUpload.FileName) + Guid.NewGuid() + System.IO.Path.GetExtension(model.ImageUpload.FileName);
string path = System.IO.Path.Combine(
Server.MapPath("~"), "Areas/Administrator/uploads/", pic);
string PicPath = System.IO.Path.Combine("/Areas/Administrator/uploads", pic);
PicPath = PicPath.Replace("\\", "/");
model.ImageUpload.SaveAs(path);
bImageUpload.Inser(new Shared.Entities.SMP.ImageUpload
{
Title = model.Titel,
Lang = CultureHelper.GetLangFromCulture(),
ImageUrl = PicPath
});`
Does your folder exist?
Simulate the error:
Bring the image out of the folder into project files like this:
Server.MapPath("~/image.jpg"))
then run your project as a test.
I am not sure why I am getting the error below, but I suppose it's something that I am doing wrong.
First, you can grab my dataset by downloading the file dataset.r from this link and loading it into your session with dget("dataset.r").
In my case, I would do dat = dget("dataset.r").
The code below is what I am using to load data into the Neo4j.
library(RNeo4j)
graph = startGraph("http://localhost:7474/db/data/")
graph$version
# sure that the graph is clean -- you should backup first!!!
clear(graph, input = FALSE)
## ensure the constraints
addConstraint(graph, "School", "unitid")
addConstraint(graph, "Topic", "topic_id")
## create the query
## BE CAREFUL OF WHITESPACE between KEY:VALUE pairs for parameters!!!
query = "
MERGE (s:School {unitid:{unitid},
instnm:{instnm},
obereg:{obereg},
carnegie:{carnegie},
applefeeu:{applfeeu},
enrlft:{enrlft},
applcn:{applcn},
admssn:{admssn},
admit_rate:{admit_rate},
ape:{ape},
sat25:{sat25},
sat75:{sat75} })
MERGE (t:Topic {topic_id:{topic_id},
topic:{topic} })
MERGE (s)-[:HAS_TOPIC {score:{score} }]->(t)
"
for (i in 1:nrow(dat)) {
## status
cat("starting row ", i, "\n")
## run the query
cypher(graph,
query,
unitid = dat$unitid[i],
instnm = dat$instnm[i],
obereg = dat$obereg[i],
carnegie = dat$carnegie[i],
applfeeu = dat$applfeeu[i],
enrlft = dat$enrlt[i],
applcn = dat$applcn[i],
admssn = dat$admssn[i],
admit_rate = dat$admit_rate[i],
ape = dat$apps_per_enroll[i],
sat25 = dat$sat25[i],
sat75 = dat$sat75[i],
topic_id = dat$topic_id[i],
topic = dat$topic[i],
score = dat$score[i] )
} #endfor
I can successfully load the first 49 records of my dataframe dat, but errors out on the 50th row.
This is the error that I recieve:
starting row 50
Show Traceback
Rerun with Debug
Error: 400 Bad Request
{"message":"Node 1477 already exists with label School and property \"unitid\"=[110680]","exception":"CypherExecutionException","fullname":"org.neo4j.cypher.CypherExecutionException","stacktrace":["org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext.org$neo4j$cypher$internal$compiler$v2_1$spi$ExceptionTranslatingQueryContext$$translateException(ExceptionTranslatingQueryContext.scala:154)","org.neo4j.cypher.internal.compiler.v2_1.spi.ExceptionTranslatingQueryContext$ExceptionTranslatingOperations.setProperty(ExceptionTranslatingQueryContext.scala:121)","org.neo4j.cypher.internal.compiler.v2_1.spi.UpdateCountingQueryContext$CountingOps.setProperty(UpdateCountingQueryContext.scala:130)","org.neo4j.cypher.internal.compiler.v2_1.mutation.PropertySetAction.exec(PropertySetAction.scala:51)","org.neo4j.cypher.internal.compiler.v2_1.mutation.MergeNodeAction$$anonfun$exec$1.apply(MergeNodeAction.scala:80)","org.neo4j.cypher.internal.compiler.v2_1
Here is my session info:
> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RNeo4j_1.2.0
loaded via a namespace (and not attached):
[1] RCurl_1.95-4.1 RJSONIO_1.2-0.2 tools_3.1.0
And it's worth noting that I am using Neo4j 2.1.3.
Thanks for any help in advance.
This is an issue with how MERGE works. By setting the score property within the MERGE clause itself here...
MERGE (s)-[:HAS_TOPIC {score:{score} }]->(t)
...MERGE tries to create the entire pattern, and thus your uniqueness constraint is violated. Instead, do this:
MERGE (s)-[r:HAS_TOPIC]->(t)
SET r.score = {score}
I was able to import all of your data after making this change.
I need to find or do an inquiry for getting the access point using JUDDI from an already published service. I followed the procedure told in Apache jUDDI: Finding Templates. But it didn't work out and i get the following error from the Tomcat server:
Sep 01, 2012 11:29:58 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
INFO: Application {urn:uddi-org:v3_service}UDDIInquiryService#{urn:uddi-org:v3_service}find_service has thrown exception, unwinding now: org.apache.juddi.v3.error.FatalErrorException: At least one name, categoryBag, find_tModel or tModelBag or name must be supplied
And also the same error is indicated in Netbeans IDE as:
javax.xml.ws.soap.SOAPFaultException: At least one name, categoryBag, find_tModel or tModelBag or name must be supplied
My code snippet is as follows:
FindService fs = new FindService();
fs.setAuthInfo(rootAuthToken.getAuthInfo());
fs.setBusinessKey("uddi:juddi.apache.org:e7180bfb-3c36-451e-86aa-f7605a96587c");
ServiceList sl = inquiry.findService(fs);
ServiceInfos si = sl.getServiceInfos();
GetServiceDetail gsd = new GetServiceDetail();
ServiceDetail sd = inquiry.getServiceDetail(gsd);
BusinessService bs = (BusinessService) sd.getBusinessService();
BindingTemplates bts = bs.getBindingTemplates();
BindingTemplate bt = (BindingTemplate) bts.getBindingTemplate();
AccessPoint ap = bt.getAccessPoint();
wsdlTA.setText(ap.getValue());
Never mind, I got it solved through the Apache JUDDI's project mailing list. Thanks to 秦玉珠 for the help. The code can be as follows:
ServiceList list1=inquiryService.findService(findservice);
GetServiceDetail gsd=new GetServiceDetail();
for(ServiceInfo serviceInfo :list1.getServiceInfos().getServiceInfo()){
gsd.getServiceKey().add(serviceInfo.getServiceKey());
System.out.println(serviceInfo.getServiceKey());
String servicekey=serviceInfo.getServiceKey();
GetServiceDetail getServiceDetail=new GetServiceDetail();
getServiceDetail.setAuthInfo(authinfo);
getServiceDetail.getServiceKey().add(servicekey);
ServiceDetail serviceDetail=inquiryService.getServiceDetail(getServiceDetail);
BusinessService businessservice=serviceDetail.getBusinessService().get(0);
System.out.println("fetched service name:"+businessservice.getName().get(0).getValue());
String bindingkey = businessservice.getBindingTemplates().getBindingTemplate().get(0).getBindingKey();
System.out.println(bindingkey);
GetBindingDetail gbd = new GetBindingDetail();
gbd.setAuthInfo(authinfo);
gbd.getBindingKey().add(bindingkey);
BindingDetail bindingdetail=inquiryService.getBindingDetail(gbd);
BindingTemplate bindingtemplate=bindingdetail.getBindingTemplate().get(0);
String accesspoint=bindingtemplate.getAccessPoint().getValue();
System.out.println(accesspoint);
}
I have a view which looks like this
{{img src="/Scenario/Status/id" alt="status" /}}
(replace <> these {} above )
and this is the code in action of the controller
public ActionResult Status(int? id)
{
// Calculate the status
int no = new Random().Next(0, 2);
string file = "green.jpg";
if (no == 0)
{
file = "red.jpg";
}
else if (no == 1)
{
file = "yellow.jpg";
}
else if (no == 2)
{
file = "green.jpg";
}
var path = Server.MapPath("/Content/images/");
var filePath = path + file;
return new FileContentResult(System.IO.File.ReadAllBytes(filePath), "image/jpeg");
}
This works just fine when i run on visualstudio. But when i deploy it to local IIS, I dont see these images.
I checked that the "StaticContent" option is checked in Windows Features under IIS and also that the MIME type is enabled on IIS. I also checked that the *.jpg files are present under "inetpub" folder of my app after I publish from visual studio. Since i'm using virtual path for images and not hardcofing the filenames , it should work...
I just tried this
{{img src="../Content/Images/Green.jpg" alt="status" /}} and that works too.. :(
What else could be wrong?
A quick way to gain more insight into the problem would be to set a breakpoint in the Application_Error method of the global.asax, and see what exception is being raised when the request for the image comes in.
If you've deployed under a virtual directory in IIS, You'll need to use Server.MapPath("~/Content/images/")
Where Asp.Net will replace ~ with the application root.
Found the solution for displaying images in an app hosted in a sub folder unde root site on IIS
This worked..
img src = "<%= Url.Content("~/Home/GetRainfallChart") %>" alt="chart"
It is deployed to a virtual directory C:\inetpub\wwwroot\testsite....
Is that th eproblrm
I'm trying to map a drive using WNetAddCOnnection2 but there's something not quite right. The code that I am using from pinvoke.net and seems to work at first. If I am stepping through the code I get a 0 for a response and I am able to use System.IO.Directory.GetFiles() to inspect the new mapped drive which leads me to believe that credentials are fine.
The problem is that the drive is not available outside of the application. When I type net use from a command prompt I see the drive listed like this:
Unavailable L: \\<server>\<share> Microsoft Windows Network
When I try to access the drive I get either:
The system cannot find the drive specified.
or
The system cannot find the path specified.
Any help would be greatly appreciated.
Here's the nutshell of the code in question:
NETRESOURCE res = new NETRESOURCE();
res.iScope = RESOURCE_GLOBALNET;
res.iType = RESOURCETYPE_DISK;
res.iDisplayType = RESOURCEDISPLAYTYPE_SHARE;
res.iUsage = RESOURCEUSAGE_CONNECTABLE;
res.sRemoteName = share;
res.sLocalName = drive;
res.sProvider = null;
int iFlags = 0;
iFlags = CONNECT_UPDATE_PROFILE;
int iResult = WNetAddConnection2( ref res, psPassword, psUsername, iFlags );
The iResult always ends up equaling 0.
MSDN articles that may assist:
* WNetAddConnection2 - [http://msdn.microsoft.com/en-us/library/aa385413%28VS.85%29.aspx][1]
* NETRESOURCE - [http://msdn.microsoft.com/en-us/library/aa385353%28VS.85%29.aspx][2]
I reckon your problem is the display type where "res.iDisplayType = RESOURCEDISPLAYTYPE_SHARE". Perhaps try changing to a value of "0" (RESOURCEDISPLAYTYPE_GENERIC). So for example, what I generally use to map drives appears:
With Res
.dwScope = RES_SCOPE_GLOBALNET 'value 2
.dwType = RES_TYPE_DISK 'value of 1
.dwUsage = RES_USE_CONNECT 'value of 1
.localName = "x:" 'leave blank for no drive
.RemoteName = "\\\"
End With
lRes = WNetAddConnection2(Res, sPassword, sDomain & "\" & sPassword, RES_CNN_UPDATE_PROFILE)
If lRes = 0 Then
'Success
Else
'Error
End If
Always check your connections before & after calls from command prompt:
1a) From system making connection, list current connections:
net use
1b) From system connected too, list current sessions:
net session
To disconnect session, use API 'WNetCancelConnection2', my code following from above:
sServer = "\\\"
lRes = WNetCancelConnection2(sServer, RES_CNN_UPDATE_PROFILE, True)
If lRes `> 0 Then
'Success
Else
'Error
End If
Alternatively, simply making connections using 'net' command:
1) To map a drive letter:
net use `: \\`\` /user:`\` `
2) To map an IPC connection:
net use \\`\` /user:`\` `
Disconnecting using 'net' command:
1) Disconnecting mapped drive:
net use `: /delete
2) Disconnecting server share:
net use \\`\` /delete