Tenant public API: publishsettings does not contain a certificate
Hi
I'm trying to connect to our tenant public api, but for some reason it has stopped generating a certificate within the publishsettings file.
So when I try to import it in powershell I get the following error:
Import-WAPackPublishSettingsFile : Value cannot be null.
Parameter name: s
At line:1 char:1
+ Import-WAPackPublishSettingsFile 'C:\temp\somefile.publishsettings
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Import-AzurePublishSettingsFile], ArgumentNullException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.Profile.ImportAzurePublishSettingsCommand
Any help will be appreciated.
Thomas
I haven't updated my blog post to reflect the latest changes with the API interaction from the Azure module, but here's how to get access to your subscription through the public API - assuming you have enabled and exposed that API through port 443 and associated
a certificate.
## Import the PublishSettingsFile you have downloaded from the tenant portal
Add-WAPackEnvironment -Name Nese2 -PublishSettingsFileUrl https://cloud.domain.com/publishsettings -ServiceEndpoint https://api.domain.com
import-WAPackPublishSettingsFile "C:\Users\Kristian\Documents\Azure\knwap.publishsettings" -Environment Demo
Get-WAPackSubscription -SubscriptionName "YourSubscriptionName"
Select-WAPackSubscription -SubscriptionId "ee5c4dad-9e74-46b8-88da-aa3300a43cad"
Kristian (Virtualization and some coffee: http://kristiannese.blogspot.com )
Similar Messages
-
Hi,
Need diagnosis with the following error, please:
When I perform the steps in the link below and send the text file to my internal ca (by going to submit new request and selecting the txt file), I get the following error:
http://technet.microsoft.com/en-us/library/cc732906(v=ws.10).aspxHi,
Any update about the issue?
The message indicates that there is no certificate template information in the request.
However, there is no option in the Certification Authority MMC snap-in to select a certificate template.
Note Stand-alone CAs do not use certificate templates. Therefore, this issue occurs only when you use the Certification Authority MMC snap-in to request a certificate from an enterprise CA.
Please also refer to the below links to troubleshoot this issue:
http://identitybase.blogspot.in/2010/04/request-contains-no-certificate.html
http://pdconsec.net/certificates-the-request-contains-no-certificate-template.aspx
http://support.microsoft.com/kb/910249
Regards,
Yan Li
TechNet Subscriber Support
If you are
TechNet Subscription
user and have any feedback on our support quality, please send your feedback
here.
Cataleya Li
TechNet Community Support -
We're using EWS (unmanaged) in a .NET app to access Exchange Server. After moving from 2010 to a server with Exchange 2013 and updating the web reference, I get error messages stating ConnectingSIDType does not contain a definition
for ItemElementName or PrimarySmtpAddress.
If I point the ExchangeServiceBinding object url to the new server, but do NOT update the web reference to the new server, everything still works. How do we fix this issue? The 2010 Exchange server will go away within a few days.This is the 2010 version
public partial class ConnectingSIDType {
private string itemField;
private ItemChoiceType itemElementNameField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PrimarySmtpAddress", typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("PrincipalName", typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("SID", typeof(string))]
[System.Xml.Serialization.XmlElementAttribute("SmtpAddress", typeof(string))]
[System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")]
public string Item {
get {
return this.itemField;
set {
this.itemField = value;
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public ItemChoiceType ItemElementName {
get {
return this.itemElementNameField;
set {
this.itemElementNameField = value;
2013 version
public partial class ConnectingSIDType {
private object itemField;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute("PrimarySmtpAddress", typeof(PrimarySmtpAddressType))]
[System.Xml.Serialization.XmlElementAttribute("PrincipalName", typeof(PrincipalNameType))]
[System.Xml.Serialization.XmlElementAttribute("SID", typeof(SIDType))]
[System.Xml.Serialization.XmlElementAttribute("SmtpAddress", typeof(SmtpAddressType))]
public object Item {
get {
return this.itemField;
set {
this.itemField = value;
And here is the impersonation code
ExchangeImpersonationType impersonate = new ExchangeImpersonationType();
impersonate.ConnectingSID = new ConnectingSIDType();
impersonate.ConnectingSID.Item = _email;
impersonate.ConnectingSID.ItemElementName = ItemChoiceType.PrimarySmtpAddress;
this.ExchangeService.ExchangeImpersonation = impersonate;
ConnectingSID.ItemElementName doesn't exist in the 2013 version. Is there a different way to do impersonation without going to the managed API?
-
Regular expression - find if string does NOT contain text....
I have a string that I want to tokenize. The string can contain basically anything. I want to produce tokens for each "word" found, and for each "<=" or "," found. There does not need to be whitespace around a "<=" or a "," to consider it a token. So for example:
joe schmoe<=jack, jane
should become
joe
schmoe
<=
jack
jane
As a constraint, I do not want to use StringTokenizer at all, as "its use is discouraged in new code". http://java.sun.com/j2se/1.4.2/docs/api/java/util/StringTokenizer.html
Here's the code I plan on using for this:
public String[] getWords(String input) {
Matcher matcher = WORD_PATTERN.matcher(input);
ArrayList<String> words = new ArrayList<String>();
while (matcher.find()) {
words.add(matcher.group());
return (String[]) words.toArray(new String[0]);
}The trick, though, is coming up with a working regular expression. The closest I've found yet is:
([^\s]|^(,)|^(<=))+|,|<=
but that produces the following:
joe
schmoe<=jack,
jane
I think what I need is to be able to find if a string does not contain the substring "<=" or "," using a regular expression. Anyone know how to do this, or another way to do this using regular expressions?Try:
* Tokenizer.java
* version 1.0
* 01/06/2005
package samples;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
* @author notivago
public class StrangeTokenizer {
public static void main(String[] args) {
String text = "joe schmoe<=jack, jane";
Pattern pattern = Pattern.compile( "((?:<=)|(?:,)|(?:\\w+))");
Matcher matcher = pattern.matcher(text);
while( matcher.find() ) {
System.out.println( "Item: " + matcher.group(1) );
}May the code be with you. -
Stack file that is generated does not contain any java components
We are in process of upgrading our ecc6.0 system with ehp4. The enhancement is stuck up in configuration phase for JAVA. Though we have configured Java in solution manager the stack file that is generated does not contain any java components and so the installation is stuck up. Kindly request you to advice us on this issue .
Attached is the 'Trouble Ticket Report', PREPARE_JSPM_QUEUE_CSZ_01.LOG, and SMSDXML_EA4_20100623144541.375.txt
++++
Trouble Ticket Report
Installation of enhancement package 1 for SAP NetWeaver 7.0
SID................: EA4
Hostname...........: wipro
Install directory..: e:/usr/sap/EA4
Upgrade directory..: F:\EHPI\java
Database...........: Oracle
Operating System...: NT
JDK version........: 1.6.0_07 SAP AG
SAPJup version.....: 3.4.29
Source release.....: 700
Target release.....: 700
Start release SP...: $(/J2EE/StandardSystem/SPLevel)
Target release SP..: $(/J2EE/ShadowSystem/SPLevel)
Current usages.....:
ABAP stack present.: true
The execution of PREPARE/INIT/PREPARE_JSPM_QUEUE ended in error.
The stack E:\usr\sap\trans\EPS\SMSDXML_EA4_20100625054857.968.xml contains no components for this system.
More information can be found in the log file F:\EHPI\java\log\PREPARE_JSPM_QUEUE_CSZ_02.LOG.
Use the information provided to trouble-shoot the problem. There might be an OSS note providing a solution to this problem. Search for OSS notes with the following search terms:
com.sap.sdt.j2ee.phases.PhaseTypePrepareJSPMQueue
com.sap.sdt.ucp.phases.PhaseException
The stack E:\usr\sap\trans\EPS\SMSDXML_EA4_20100625054857.968.xml contains no components for this system.
PREPARE_JSPM_QUEUE
INIT
NetWeaver Enhancement Package Installation
SAPJup
Java Enhancement Package Installation
++++++
PREPARE_JSPM_QUEUE_CSZ_01.LOG>>
<!LOGHEADER[START]/>
<!HELP[Manual modification of the header may cause parsing problem!]/>
<!LOGGINGVERSION[2.0.7.1006]/>
<!NAME[F:\EHPI\java\log\PREPARE_JSPM_QUEUE_CSZ_01.LOG]/>
<!PATTERN[PREPARE_JSPM_QUEUE_CSZ_01.LOG]/>
<!FORMATTER[com.sap.tc.logging.TraceFormatter(%d [%s]: %-100l [%t]: %m)]/>
<!ENCODING[UTF8]/>
<!LOGHEADER[END]/>
Jun 28, 2010 9:21:23 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.initialize(AbstractPhaseType.java:754) [Thread[main,5,main]]: Phase PREPARE/INIT/PREPARE_JSPM_QUEUE has been started.
Jun 28, 2010 9:21:23 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.initialize(AbstractPhaseType.java:755) [Thread[main,5,main]]: Phase type is com.sap.sdt.j2ee.phases.PhaseTypePrepareJSPMQueue.
Jun 28, 2010 9:21:23 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.logParameters(AbstractPhaseType.java:409) [Thread[main,5,main]]: Parameter inputFile=EHPComponents.xml
Jun 28, 2010 9:21:23 AM [Info]: com.sap.sdt.j2ee.phases.jspm.JSPMQueuePreparatorFactory.createJSPMQueuePreparator(JSPMQueuePreparatorFactory.java:93) [Thread[main,5,main]]: Creating JSPM SP Stack queue preparator.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.ucp.dialog.elim.DialogEliminatorContainer.canBeOmitted(DialogEliminatorContainer.java:96) [Thread[main,5,main]]: Dialog eliminator spStackDialogEliminator allows to omit dialog SPStackLocationDialog
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.util.validate.ValidationProcessor.validate(ValidationProcessor.java:97) [Thread[main,5,main]]: Validatable parameter SP/STACK/LOCATION has been validated by validator RequiredFields.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.util.validate.ValidationProcessor.validate(ValidationProcessor.java:97) [Thread[main,5,main]]: Validatable parameter SP/STACK/LOCATION has been validated by validator SPStackLocationValidator.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.j2ee.phases.jspm.JSPMSpStackQueuePreparator.createQueue(JSPMSpStackQueuePreparator.java:107) [Thread[main,5,main]]: Using SP Stack E:\usr\sap\trans\EPS\SMSDXML_EA4_20100625054857.968.xml.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.j2ee.tools.spxmlparser.SPXmlParser.parseStackTag(SPXmlParser.java:488) [Thread[main,5,main]]: STACK-SHORT-NAME tag is missing. The CAPTION of the stack will be used as stack name.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.j2ee.tools.spxmlparser.SPXmlParser.parseStackTag(SPXmlParser.java:582) [Thread[main,5,main]]: PRODUCT-PPMS-NAME tag is missing. The CAPTION of the product will be used as product PPMS name.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.j2ee.tools.spxmlparser.SPXmlParser.parseSPXml(SPXmlParser.java:424) [Thread[main,5,main]]: Parsing of stack definition file E:\usr\sap\trans\EPS\SMSDXML_EA4_20100625054857.968.xml has finished.
Jun 28, 2010 9:21:24 AM [Error]: com.sap.sdt.ucp.phases.AbstractPhaseType.doExecute(AbstractPhaseType.java:863) [Thread[main,5,main]]: Exception has occurred during the execution of the phase.
Jun 28, 2010 9:21:24 AM [Error]: com.sap.sdt.j2ee.phases.jspm.JSPMSpStackQueuePreparator.createQueue(JSPMSpStackQueuePreparator.java:136) [Thread[main,5,main]]: The stack E:\usr\sap\trans\EPS\SMSDXML_EA4_20100625054857.968.xml contains no components for this system.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:906) [Thread[main,5,main]]: Phase PREPARE/INIT/PREPARE_JSPM_QUEUE has been completed.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:907) [Thread[main,5,main]]: Start time: 2010/06/28 09:21:23.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:909) [Thread[main,5,main]]: End time: 2010/06/28 09:21:24.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:910) [Thread[main,5,main]]: Duration: 0:00:00.781.
Jun 28, 2010 9:21:24 AM [Info]: com.sap.sdt.ucp.phases.AbstractPhaseType.cleanup(AbstractPhaseType.java:911) [Thread[main,5,main]]: Phase status is error.
++++++++++++++++++++++
[stack xml data: version=1.0]
[SPAM_CVERS]
ST-PI 2005_1_7000006
LSOFE 600 0015
SAP_AP 700 0015
SAP_BASIS 701 0003
SAP_ABA 701 0003
SAP_BW 701 0003
PI_BASIS 701 0003
PLMWUI 700 0002
SAP_APPL 604 0002
EA-APPL 604 0002
SAP_BS_FND 701 0002
EA-IPPE 404 0002
WEBCUIF 700 0002
INSURANCE 604 0002
FI-CA 604 0002
ERECRUIT 604 0002
ECC-DIMP 604 0002
EA-DFPS 604 0002
IS-UT 604 0002
IS-H 604 0003
EA-RETAIL 604 0002
EA-FINSERV 604 0002
IS-OIL 604 0002
IS-PRA 604 0002
IS-M 604 0002
SEM-BW 604 0002
FINBASIS 604 0002
FI-CAX 604 0002
EA-GLTRADE 604 0002
IS-CWM 604 0002
EA-PS 604 0002
IS-PS-CA 604 0002
EA-HR 604 0005
SAP_HR 604 0005
ECC-SE 604 0002
[PRDVERS]
01200314690900000432SAP ERP ENHANCE PACKAGE EHP2 FOR SAP ERP 6.0 sap.com EHP2 FOR SAP ERP 6.0 -00000000000000
01200314690900000463SAP ERP ENHANCE PACKAGE EHP4 FOR SAP ERP 6.0 sap.com EHP4 FOR SAP ERP 6.0 -00000000000000
01200615320900001296 sap.com +00000000000000
01200615320900001469SAP ERP ENHANCE PACKAGE EHP3 FOR SAP ERP 6.0 sap.com EHP3 FOR SAP ERP 6.0 -00000000000000
01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01 +00000000000000
[SWFEATURE]
1 01200615320900001296SAP ERP 2005 sap.com SAP ERP 6.0: SAP ECC Server
19 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Discrete Ind. & Mill Products
20 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Media
21 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Utilities/Waste&Recycl./Telco
23 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Leasing/Contract A/R & A/P
24 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Retail
25 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Global Trade
26 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Financial Supply Chain Mgmt
30 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Central Applications
31 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Strategic Enterprise Mgmt
33 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Human Capital Management
37 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Oil & Gas
38 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Catch Weight Management
42 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Public Sector Accounting
43 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Insurance
44 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Hospital
45 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: SAP ECC Server VPack successor
46 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: ERecruiting
47 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Defense & Public Security
48 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Financial Services
55 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Oil & Gas with Utilities
56 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: Defense
59 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: PLM Core
69 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: EAM config control
9 01200615320900003195EHP4 FOR SAP ERP 6.0_NW701 EHP4 FOR ERP 6.0_NW701 sap.com EHP4 FOR SAP ERP 6.0 / NW7.01: SAP ESA ECC-SE
++++++++++++++++Though we have configured Java in solution manager the stack file that is generated does not contain any java components
You will probably need to update Solution Manager first with a number of corrections so you can get a correctly generated stack file. Depending on your ST400 version in Solution Manager apply collective corrections from "Note 1461849 - MOpz: Collective corrections 24" or "Note 1452118 - MOpz: Collective Corrections 23". They generally deal with these kind of stack file issues.
Nelis -
Eclipse problem selection does not contain main type
i m using eclipse3.3 and have set all the necessary paths in it
but when i run a simple java program just for displaying hello world but
the error comes
selection does not contain main typeYou must have a class with a main method.
The main method must be public, must be static, must return void, must have parameter String [], and is case sensitive (so does Java).
Put this into your class
public static void main(String args[]) {
}Let me know if it answers your question.
Best regards. -
Eclipse "selection does not contain main type" - but it does contain a main
Hi!
I'm having a strange thing happen to me when using the eclipse IDE in a macintosh envirnment.
I imported a project, complete with package, and all of my classes. and when I try to run my main class, it tells me "selection does not contain main type".
Which is entirely untrue, the class I am trying to run contains a public static void main(), does anyone know what's going on here?the class is quite large, I don't think that it is a problem with the class, because it runs fine on my windows based pc (also in eclipse)...
-
Help - Editor does not contain a main type error (Eclipse)
Hello,
I'm trying to run a Text input program out of the Eclipse program and I keep getting this Editor does not contain a main type error - can someone help me
here's the code
import java.io.File;
import java.io.FileNotFoundException;
import java.text.DecimalFormat;
import java.util.Scanner;
import uwcse.io.Input;
public class FileInputExample {
public static void main(String[] args) {
// Create a Scanner to read the input file
String fileName = new Input().readString("Input file name? ");
System.out.println();
Scanner scan;
try {
scan = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
System.out.println(fileName + " doesn't exist!");
return;
// Read the file and count the number of occurences of A, B, ...
int[] count = new int[26];
while (scan.hasNextLine()) {
String line = scan.nextLine();
line = line.toLowerCase();
for (int i = 0; i < line.length(); i++) {
char c = line.charAt(i);
if (c >= 'a' && c <= 'z') {
count[c - 'a']++;
scan.close();
int length = 0;
for (int i = 0; i < count.length; i++) {
length += count;
// Display the statistics (as an histogram)
DecimalFormat df = new DecimalFormat("0.00");
for (int i = 0; i < count.length && length > 0; i++) {
double percent = count[i] * 100.0 / length;
String display = "" + (char) ('a' + i);
display += "(" + df.format(percent) + "%):\t";
for (int j = 1; j <= Math.round(percent); j++) {
display += "X";
System.out.println(display);
}ThanksFirst, note that your program uses a non-standard class, "uwcse.io.Input" which is not available to us. Normally that is a show stopper - in this case, it's not, as I was able to eliminate its use.
Your program runs fine, so the error is an Eclipse error unrelated to Java.
You need to ask for help at an Eclipse support site, not here, as these forums are Java language forums. -
[Eclipse Problem] Selection does not contain a main type?
well i am using a GUI builder software which generates java code, i made a simple one to test and it will not compile.
import java.awt.*;
import javax.swing.*;
public class name {
@SuppressWarnings("unused")
private void initComponents() {
panel1 = new JPanel();
label1 = new JLabel();
textField1 = new JTextField();
panel1.setLayout(new FlowLayout());
label1.setText("Name:");
label1.setHorizontalAlignment(SwingConstants.LEFT);
panel1.add(label1);
textField1.setColumns(12);
textField1.setText("hi");
panel1.add(textField1);
private JPanel panel1;
private JLabel label1;
private JTextField textField1;
}it should make a basic swing GUI but it just gives me the error "Selection does not contain a main type"
I did not select in eclipse "use public static void main" i know im not supposed to because this has no main method, but how am i to compile this? =X
Edited by: -Johnny- on May 14, 2008 6:44 PM
Edited by: -Johnny- on May 14, 2008 6:44 PM-Johnny- wrote:
ya i used javac instead of eclipse then running it complains like you say
but is there any way to compile this code and it will work? I was hoping to use this GUI builder for business purposes but it seems like a waste of money so far if i can't make working java application with it =\The code is fine. You need to learn the basics. Start with the intro tutorials at the Sun type and start reading and coding.
Here is what the rest could look like:
import java.awt.*;
import javax.swing.*;
public class name
@SuppressWarnings("unused")
private void initComponents()
panel1 = new JPanel();
label1 = new JLabel();
textField1 = new JTextField();
panel1.setLayout(new FlowLayout());
label1.setText("Name:");
label1.setHorizontalAlignment(SwingConstants.LEFT);
panel1.add(label1);
textField1.setColumns(12);
textField1.setText("hi");
panel1.add(textField1);
private JPanel panel1;
private JLabel label1;
private JTextField textField1;
public name()
initComponents();
public JPanel getPanel()
return panel1;
private static void createAndShowUI()
JFrame frame = new JFrame("name");
frame.getContentPane().add(new name().getPanel());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
public static void main(String[] args)
java.awt.EventQueue.invokeLater(new Runnable()
public void run()
createAndShowUI();
}Edited by: Encephalopathic on May 14, 2008 7:10 PM -
FileUpload problem: InputStream does not contain a serialized object
Hi All,
I'm using the FileUpload component in a JSPDynPage and the htmlb component seems to work fine but I cannot read the file (InputStream). I get the following error(IOException): "InputStream does not contain a serialized object".
Please let me know what is wrong with my code. This is a part of the code I used:
public FileInputStream sourceFileInput;
public ObjectInputStream input;
FileUpload fu;
fu = (FileUpload) this.getComponentByName("myFileUpload");
IFileParam fileParam = ((FileUpload) getComponentByName("myFileUpload")).getFile();
File f = fileParam.getFile();
file = fu.getFile().getFile();
absolutepath = fu.getFile().getFile().getAbsolutePath();
this.sourceFileInput = new FileInputStream(file);
input = new ObjectInputStream(sourceFileInput);
The last line of code seems to generate te error.Hi,
I have found the answers, thank you both.
(I included the examle code. Perhaps of some use to someone.)
FileUpload fu;
fu = null;
fu = (FileUpload) this.getComponentByName("myFileUpload");
// this is the temporary file
if (fu != null) {
IFileParam fileParam = ((FileUpload) getComponentByName("myFileUpload")).getFile();
if (fileParam != null) {
// get info about this file and create a FileInputStream
File f = fileParam.getFile();
if (f != null) {
try {
fis = new FileInputStream(f);
// process exceptions opening files
catch (FileNotFoundException ex) {
myBean.setMessage(
"1" + f + ex.getLocalizedMessage());
isr = new InputStreamReader(fis);
br = new BufferedReader(isr);
String textLine = "";
do {
try {
textLine = (String) br.readLine();
} catch (IOException e) {
myBean.setMessage(
"1" + e.getLocalizedMessage());
// Jco append table & put data into the record
// (I_FILE is the table with txt data that is sent to the RFC)
I_FILE.appendRow();
I_FILE.setValue(textLine, "REC");
} while (textLine != null); -
Hi,
Need help solving a Task that returns a Task<IEnumerable<Writing>> so I can fill ObservableCollection<ViewModels.IWritingItemViewModel> Writings for my
Design Time Data Page:
<d:Page.DataContext>
<designTimeData:MainPageViewModel />
</d:Page.DataContext>
My constructor does this:
public MainPageViewModel()
var writings = this.GetGroupsAsync();
this.Writings = new ObservableCollection<ViewModels.IWritingItemViewModel>();
var viewmodels = writings.Select((x, i) => new WritingItemViewModel
Writing = x,
VariableItemSize = (i == 0) ? Common.VariableItemSizes.Writings : Common.VariableItemSizes.Normal,
My var writings = this.GetGroupsAsync(); is:
public async Task<IEnumerable<Writing>> GetGroupsAsync()
await this.GetMenuDataAsync();
return this.Groups;
which in turn gets data from:
private async Task GetMenuDataAsync()
Uri dataUri = new Uri("ms-appx:///DesignTimeData/MenuData.json");
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
string jsonText = await FileIO.ReadTextAsync(file);
JsonObject jsonObject = JsonObject.Parse(jsonText);
JsonArray jsonArray = jsonObject["Groups"].GetArray();
foreach (JsonValue groupValue in jsonArray)
JsonObject groupObject = groupValue.GetObject();
Writing group = new Writing(
groupObject["UniqueId"].GetString(),
groupObject["IsHeaderInteractive"].GetBoolean(),
groupObject["ViewType"].GetString(),
groupObject["ModelType"].GetString(),
groupObject["Page"].GetString(),
groupObject["Title"].GetString(),
groupObject["Subtitle"].GetString(),
groupObject["ImagePath"].GetString(),
groupObject["Description"].GetString(),
groupObject["GroupId"].GetString()
foreach (JsonValue itemValue in groupObject["WritingMenus"].GetArray())
JsonObject itemObject = itemValue.GetObject();
group.WritingMenus.Add(new WritingMenu(
itemObject["UniqueId"].GetString(),
itemObject["Page"].GetString(),
itemObject["Title"].GetString(),
itemObject["Subtitle"].GetString(),
itemObject["ImagePath"].GetString(),
itemObject["Description"].GetString(),
itemObject["Content"].GetString(),
itemObject["WritingsId"].GetString(),
itemObject["GroupId"].GetString(),
Convert.ToInt32(itemObject["Item"].ValueType)
this.Groups.Add(group);
and I get this Error:
Error 5 'System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<App1.DesignTimeData.Writing>>'
does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type
'System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<App1.DesignTimeData.Writing>>'
could be found (are you missing a using directive or an assembly reference?)
I'm creating collections of:
public interface IWritingItemViewModel : Common.IVariableSizedItem
Models.Writing Writing { get; set; }
and my class for creating data is:
public class Writing
public Writing(
string uniqueId,
bool isHeaderInteractive,
string templateType,
string viewModelType,
string page,
string title,
string subtitle,
string imagePath,
string description,
string groupId
this.UniqueId = uniqueId;
this.IsHeaderInteractive = isHeaderInteractive;
this.TemplateType = templateType;
this.ViewModelType = viewModelType;
this.Page = page;
this.Title = title;
this.Subtitle = subtitle;
this.ImagePath = imagePath;
this.Description = description;
this.GroupId = groupId;
this.WritingMenus = new ObservableCollection<WritingMenu>();
public string UniqueId { get; private set; }
public bool IsHeaderInteractive { get; private set; }
public string TemplateType { get; private set; }
public string ViewModelType { get; private set; }
public string Page { get; private set; }
public string Title { get; private set; }
public string Subtitle { get; private set; }
public string ImagePath { get; private set; }
public string Description { get; private set; }
public string GroupId { get; private set; }
public virtual ObservableCollection<WritingMenu> WritingMenus { get; private set; }
How can I solve or successfully complete this code?
Thanks!...
Code is like a box of chocolates!...I looked into your error message again, I found something interesting:
Error 5
'System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<App1.DesignTimeData.Writing>>'
does not contain a definition
for 'Select'
and no extension method
'Select' accepting a first argument of type
'System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<App1.DesignTimeData.Writing>>'
could be found (are you missing a
using directive or an assembly reference?)
That means: Task does not contain the definition for Select. This was reasonable, Task does not inherit IEnumerable interface.
var viewmodels = writings.Select((x, i) => new WritingItemViewModel
Writing = x,
VariableItemSize = (i == 0) ? Common.VariableItemSizes.Writings : Common.VariableItemSizes.Normal,
public async Task<IEnumerable<Writing>> GetGroupsAsync()
You need get the IEnumerable<Writing> for Select use. See this for more information:
How to: Return a Value from a Task
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
StreamCorruptedException: does not contain a serialized object?
Can someone tell me why am I getting this exception:
C:\javapr>java FetchObject
Couldn't retrieve binary data: java.io.StreamCorruptedException: InputStream
does not contain a serialized object
java.io.StreamCorruptedException: InputStream does
not contain a serialized object
at java.io.ObjectInputStream.readStreamHeader
(ObjectInputStream.java:849)
at java.io.ObjectInputStream.<init>
(ObjectInputStream.java:168)
at FetchObject.main(FetchObject.java:23)
import java.sql.*;
import java.util.*;
import java.io.*;
class FetchObject implements Serializable {
public static void main (String[] args) {
try {
String driver = "oracle.jdbc.driver.OracleDriver";
Class.forName(driver);
String url = "jdbc:oracle:thin:@mymachine:1521:homedeva";
Connection conn = DriverManager.getConnection(url,"cnn","cnn");
FetchObject i = new FetchObject();
// Select related
try
byte[] recdBlob = i.selectBlob( 1 , conn );
ByteArrayInputStream bytes = new ByteArrayInputStream(recdBlob);
ObjectInputStream deserialize = new ObjectInputStream( bytes );
Employee x = (Employee)deserialize.readObject();
catch( Exception ex )
System.err.println("Couldn't retrieve binary data: " + ex);
ex.printStackTrace();
catch( Exception ex )
ex.printStackTrace();
public byte[] selectBlob( int id, Connection conn )
byte[] returndata = null;
try
Statement stmt = conn.createStatement();
String sql = "SELECT id, rowdata FROM blobs WHERE id = " + id;
ResultSet rs = stmt.executeQuery(sql);
if ( rs.next() )
try
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
BufferedInputStream bis = new BufferedInputStream( rs.getBinaryStream("rowdata") );
byte[] bindata = new byte[4096];
int bytesread = 0;
if ( !rs.wasNull() )
if ( (bytesread = bis.read(bindata,0,bindata.length)) != -1 )
baos.write(bindata,0,bytesread);
returndata = baos.toByteArray();
baos.flush();
bis.close();
catch ( Exception ex )
System.err.println("Problem retrieving binary data: " + ex);
rs.close();
stmt.close();
catch ( Exception ex )
System.err.println("Couldn't retrieve binary data: " + ex);
return returndata;
import java.io.*;
class Employee implements Serializable
private String lastName;
private String firstName;
public Employee(String lastName, String firstName)
this.lastName = lastName;
this.firstName = firstName;
}To clarify I have stored an Employee Object as a Blob in the Oracle database and am attempting to retreive the
Employee Object from this Blob.
Thanks -
Does not contain port: null
Hi there,
I had deployed 2 web services, one of it is working another one isn't. Both of the web services implementing the same/identical ways. The exception i got it:
service: {http://localhost:8080/}ORMEngineService does not contain port: null
at com.sun.xml.rpc.client.dii.ConfiguredService.portNotFoundException(ConfiguredService.java:139)
at com.sun.xml.rpc.client.dii.ConfiguredService.getPortInfo(ConfiguredService.java:132)
at com.sun.xml.rpc.client.dii.ConfiguredService.getPort(ConfiguredService.java:245)
at com.sun.xml.rpc.client.dii.ConfiguredService.getPort(ConfiguredService.java:152)
at gov.mohr.ems.core.entity.logic.ORMEngineWebServicesTest.test1(ORMEngineWebServicesTest.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
...Below are my references:
1. mapping file:
<?xml version="1.0" encoding="UTF-8"?>
<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
<package-mapping>
<package-type>gov.mohr.ems.core.entity.logic</package-type>
<namespaceURI>http://localhost:8080/types</namespaceURI>
</package-mapping>
<package-mapping>
<package-type>gov.mohr.ems.core.entity.logic</package-type>
<namespaceURI>http://localhost:8080/</namespaceURI>
</package-mapping>
<service-interface-mapping>
<service-interface>gov.mohr.ems.core.entity.logic.ORMEngineService</service-interface>
<wsdl-service-name xmlns:serviceNS="http://localhost:8080/">serviceNS:ORMEngineService</wsdl-service-name>
<port-mapping>
<port-name>ORMEngineServiceEndpointPort</port-name>
<java-port-name>ORMEngineServiceEndpointPort</java-port-name>
</port-mapping>
</service-interface-mapping>
<service-endpoint-interface-mapping>
<service-endpoint-interface>gov.mohr.ems.core.entity.logic.ORMEngineServiceEndpoint</service-endpoint-interface>
<wsdl-port-type xmlns:portTypeNS="http://localhost:8080/">portTypeNS:ORMEngineServiceEndpoint</wsdl-port-type>
<wsdl-binding xmlns:bindingNS="http://localhost:8080/">bindingNS:ORMEngineServiceEndpointBinding</wsdl-binding>
<service-endpoint-method-mapping>
<java-method-name>executeQuery</java-method-name>
<wsdl-operation>executeQuery</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>java.lang.String</param-type>
<wsdl-message-mapping>
<wsdl-message xmlns:wsdlMsgNS="http://localhost:8080/">wsdlMsgNS:ORMEngineServiceEndpoint_executeQuery</wsdl-message>
<wsdl-message-part-name>String_1</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>java.lang.String</method-return-value>
<wsdl-message xmlns:wsdlMsgNS="http://localhost:8080/">wsdlMsgNS:ORMEngineServiceEndpoint_executeQueryResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
</service-endpoint-interface-mapping>
</java-wsdl-mapping>2. WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="ORMEngineService" targetNamespace="http://localhost:8080/" xmlns:tns="http://localhost:8080/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types/>
<message name="ORMEngineServiceEndpoint_executeQuery">
<part name="String_1" type="xsd:string"/></message>
<message name="ORMEngineServiceEndpoint_executeQueryResponse">
<part name="result" type="xsd:string"/></message>
<portType name="ORMEngineServiceEndpoint">
<operation name="executeQuery" parameterOrder="String_1">
<input message="tns:ORMEngineServiceEndpoint_executeQuery"/>
<output message="tns:ORMEngineServiceEndpoint_executeQueryResponse"/></operation></portType>
<binding name="ORMEngineServiceEndpointBinding" type="tns:ORMEngineServiceEndpoint">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="executeQuery">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://localhost:8080/"/></input>
<output>
<soap:body use="literal" namespace="http://localhost:8080/"/></output></operation></binding>
<service name="ORMEngineService">
<port name="ORMEngineServiceEndpointPort" binding="tns:ORMEngineServiceEndpointBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>The following are the working copies of the same implmentation:
1. webservices.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : webservices.xml
Created on : May 11, 2006, 5:36 PM
Author : david
Description:
Web Services Configuration File for EJB Container
-->
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1\.xsd" version="1.1">
<webservice-description>
<webservice-description-name>PersistenceService</webservice-description-name>
<wsdl-file>META-INF/wsdl/PersistenceService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/mapping-persistence.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>PersistencePort</port-component-name>
<wsdl-port>PersistenceServiceEndpointPort</wsdl-port>
<service-endpoint-interface>gov.mohr.ems.core.entity.logic.PersistenceServiceEndpoint</service-endpoint-interface>
<service-impl-bean>
<ejb-link>PersistenceEJB</ejb-link>
</service-impl-bean>
</port-component>
</webservice-description>
<webservice-description>
<webservice-description-name>ORMEngineService</webservice-description-name>
<wsdl-file>META-INF/wsdl/ORMEngineService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/mapping-ormengine.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>ORMEnginePort</port-component-name>
<wsdl-port>ORMEngineServiceEndpointPort</wsdl-port>
<service-endpoint-interface>gov.mohr.ems.core.entity.logic.ORMEngineServiceEndpoint</service-endpoint-interface>
<service-impl-bean>
<ejb-link>ORMEngineEJB</ejb-link>
</service-impl-bean>
</port-component>
</webservice-description>
</webservices>2. ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>Enforcement Management System Backend</display-name>
<enterprise-beans>
<!--<session>
<display-name>WorkflowJAR</display-name>
<ejb-name>WorkflowEJB</ejb-name>
<home>gov.mohr.ems.core.workflow.logic.WorkflowRemoteHome</home>
<remote>gov.mohr.ems.core.workflow.logic.WorkflowRemote</remote>
<ejb-class>gov.mohr.ems.core.workflow.logic.WorkflowBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/META-INF/applicationcontext-ejb.xml</env-entry-value>
</env-entry>
</session>-->
<!--<session>
<display-name>NotificationJAR</display-name>
<ejb-name>NotificationEJB</ejb-name>
<home>gov.mohr.ems.core.notification.logic.NotificationRemoteHome</home>
<remote>gov.mohr.ems.core.notification.logic.NotificationRemote</remote>
<ejb-class>gov.mohr.ems.core.notification.logic.NotificationBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/META-INF/applicationcontext-ejb.xml</env-entry-value>
</env-entry>
</session>-->
<session>
<display-name>ORMEngineJAR</display-name>
<ejb-name>ORMEngineEJB</ejb-name>
<service-endpoint>gov.mohr.ems.core.entity.logic.ORMEngineServiceEndpoint</service-endpoint>
<!--<home>gov.mohr.ems.core.entity.logic.ORMEngineRemoteHome</home>
<remote>gov.mohr.ems.core.entity.logic.ORMEngineRemote</remote>-->
<ejb-class>gov.mohr.ems.core.entity.logic.ORMEngineBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/META-INF/applicationcontext-ejb.xml</env-entry-value>
</env-entry>
</session>
<session>
<display-name>PersistenceJAR</display-name>
<ejb-name>PersistenceEJB</ejb-name>
<service-endpoint>gov.mohr.ems.core.entity.logic.PersistenceServiceEndpoint</service-endpoint>
<!--<home>gov.mohr.ems.core.entity.logic.PersistenceRemoteHome</home>
<remote>gov.mohr.ems.core.entity.logic.PersistenceRemote</remote>-->
<ejb-class>gov.mohr.ems.core.entity.logic.PersistenceBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<env-entry-name>ejb/BeanFactoryPath</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>/META-INF/applicationcontext-ejb.xml</env-entry-value>
</env-entry>
</session>
</enterprise-beans>
<assembly-descriptor>
<!--<container-transaction>
<method>
<ejb-name>WorkflowEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>-->
<!--<container-transaction>
<method>
<ejb-name>NotificationEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>-->
<container-transaction>
<method>
<ejb-name>ORMEngineEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<container-transaction>
<method>
<ejb-name>PersistenceEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>3. applicationcontext-ejb.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD// BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<!--
Document : applicationcontext-ejb.xml
Created on : April 26, 2006, 9:07 PM
Author : david
Description:
Spring configuration.
-->
<beans default-autowire="byName">
<bean id="sessionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:hibernate/SessionFactory</value>
</property>
</bean>
<!--<bean id="gov.mohr.ems.core.workflow.logic.Workflow" class="gov.mohr.ems.core.workflow.logic.WorkflowImpl"/>-->
<!--<bean id="gov.mohr.ems.core.notification.logic.Notification" class="gov.mohr.ems.core.notification.logic.NotificationImpl"/>-->
<!-- Backend -->
<bean id="gov.mohr.ems.core.entity.logic.DefaultQueryMethod" class="gov.mohr.ems.core.entity.logic.DefaultQueryMethod"/>
<bean id="gov.mohr.ems.core.entity.logic.ORMEngine" class="gov.mohr.ems.core.entity.logic.ORMEngineImpl">
<property name="queryMethodMap">
<map>
<entry key="CustomerSampleKey">
<value>CustomerSampleClassName</value>
</entry>
</map>
</property>
</bean>
<bean id="gov.mohr.ems.core.entity.logic.Persistence" class="gov.mohr.ems.core.entity.logic.PersistenceImpl"/>
</beans>4. working copy of mapping file:
<?xml version="1.0" encoding="UTF-8"?>
<java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
<package-mapping>
<package-type>gov.mohr.ems.core.entity.logic</package-type>
<namespaceURI>http://localhost:8080/types</namespaceURI>
</package-mapping>
<package-mapping>
<package-type>gov.mohr.ems.core.entity.logic</package-type>
<namespaceURI>http://localhost:8080/</namespaceURI>
</package-mapping>
<service-interface-mapping>
<service-interface>gov.mohr.ems.core.entity.logic.PersistenceService</service-interface>
<wsdl-service-name xmlns:serviceNS="http://localhost:8080/">serviceNS:PersistenceService</wsdl-service-name>
<port-mapping>
<port-name>PersistenceServiceEndpointPort</port-name>
<java-port-name>PersistenceServiceEndpointPort</java-port-name>
</port-mapping>
</service-interface-mapping>
<service-endpoint-interface-mapping>
<service-endpoint-interface>gov.mohr.ems.core.entity.logic.PersistenceServiceEndpoint</service-endpoint-interface>
<wsdl-port-type xmlns:portTypeNS="http://localhost:8080/">portTypeNS:PersistenceServiceEndpoint</wsdl-port-type>
<wsdl-binding xmlns:bindingNS="http://localhost:8080/">bindingNS:PersistenceServiceEndpointBinding</wsdl-binding>
<service-endpoint-method-mapping>
<java-method-name>upload</java-method-name>
<wsdl-operation>upload</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>java.lang.String</param-type>
<wsdl-message-mapping>
<wsdl-message xmlns:wsdlMsgNS="http://localhost:8080/">wsdlMsgNS:PersistenceServiceEndpoint_upload</wsdl-message>
<wsdl-message-part-name>String_1</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>java.lang.String</method-return-value>
<wsdl-message xmlns:wsdlMsgNS="http://localhost:8080/">wsdlMsgNS:PersistenceServiceEndpoint_uploadResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
</service-endpoint-interface-mapping>
</java-wsdl-mapping>5. working copy of WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="PersistenceService" targetNamespace="http://localhost:8080/" xmlns:tns="http://localhost:8080/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types/>
<message name="PersistenceServiceEndpoint_upload">
<part name="String_1" type="xsd:string"/></message>
<message name="PersistenceServiceEndpoint_uploadResponse">
<part name="result" type="xsd:string"/></message>
<portType name="PersistenceServiceEndpoint">
<operation name="upload" parameterOrder="String_1">
<input message="tns:PersistenceServiceEndpoint_upload"/>
<output message="tns:PersistenceServiceEndpoint_uploadResponse"/></operation></portType>
<binding name="PersistenceServiceEndpointBinding" type="tns:PersistenceServiceEndpoint">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="upload">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://localhost:8080/"/></input>
<output>
<soap:body use="literal" namespace="http://localhost:8080/"/></output></operation></binding>
<service name="PersistenceService">
<port name="PersistenceServiceEndpointPort" binding="tns:PersistenceServiceEndpointBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/></port></service></definitions>Anyone has any ideas?
Many thanks!if we examine the webservices.xml, there are 2 part:
<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1\.xsd" version="1.1">
<webservice-description>
<webservice-description-name>PersistenceService</webservice-description-name>
<wsdl-file>META-INF/wsdl/PersistenceService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/mapping-persistence.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>PersistencePort</port-component-name>
<wsdl-port>
PersistenceServiceEndpointPort</wsdl-port>
<service-endpoint-interface>gov.mohr.ems.core.entity.logic.PersistenceServiceEndpoint</service-endpoint-interface>
<service-impl-bean>
<ejb-link>PersistenceEJB</ejb-link>
</service-impl-bean>
</port-component>
</webservice-description>
<webservice-description>
<webservice-description-name>ORMEngineService</webservice-description-name>
<wsdl-file>META-INF/wsdl/ORMEngineService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/mapping-ormengine.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>ORMEnginePort</port-component-name>
<wsdl-port>
ORMEngineServiceEndpointPort</wsdl-port>
<service-endpoint-interface>gov.mohr.ems.core.entity.logic.ORMEngineServiceEndpoint</service-endpoint-interface>
<service-impl-bean>
<ejb-link>ORMEngineEJB</ejb-link>
</service-impl-bean>
</port-component>
</webservice-description>
</webservices>one is for Persistence service, one is for ORMEngine service. it is just that i need to put them both inside the same webservices.xml -
Certificate does not contain the correct site name
Hello,
I have to make a midlet that connect to a tomcat 5.5.9 server with ssl.
I import the certificate whit tomcat alias in the wireless toolkit but when i run the midlet this error appear: Certificate does not contain the correct site name
import java.io.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;
import javax.microedition.lcdui.*;
public class HelloNet extends MIDlet implements CommandListener , Runnable{
// User interface command to exit the current
// application.
private Command exitCommand = new Command("Exit",
Command.EXIT, 2);
// User interface command to issue an HTTP GET
// request.
private Command getCommand = new Command("Get",
Command.SCREEN, 1);
/// The current display object.
private Display display;
// The url to GET from the 'net.
private String url;
* Initialize the MIDlet with a handle to the
* current display.
public HelloNet() {
url = "https://127.0.0.1:8443/Hello.txt";
display = Display.getDisplay(this);
* This lifecycle method should return immediately
* to keep the dispatcher
* from hanging.
public void startApp() {
showPrompt();
* Display the main screen.
void showPrompt() {
String s = "Press Get to fetch " + url;
TextBox t = new TextBox("Http Result", s,
s.length(), 0);
t.addCommand(exitCommand);
t.addCommand(getCommand);
t.setCommandListener(this);
display.setCurrent(t);
* pauseApp signals the thread to stop by clearing
* the thread field.
* If stopped incorrectly, it will be restarted from
* scratch later.
public void pauseApp() {
* destroyApp must cleanup everything. The thread
* is signaled
* to stop and no result is produced.
* @param unconditional is a flag to indicate that
* forced shutdown
* is requested
public void destroyApp(boolean unconditional) {
* commandAction responds to commands
* @param c command to perform
* @param s Screen displayable object
public void commandAction(Command c, Displayable s) {
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
} else if (c == getCommand) {
Thread th= new Thread (this);
th.start();
* Read the content of the page.
public void run() {
TextBox t = null;
StringBuffer b = new StringBuffer();
HttpsConnection c = null;
InputStream is = null;
try {
int len = 0;
int ch = 0;
System.out.println("Cerco di leggere");
c = (HttpsConnection)Connector.open(url);
c.setRequestMethod(HttpsConnection.GET);
is = c.openInputStream();
// length of content to be read.
len = (int) c.getLength();
if (len != -1) {
// Read exactly Content-Length bytes
for(int i=0; i<len; i++) {
if((ch = is.read()) != -1) {
b.append((char) ch);
} else {
// Read until connection is closed.
while((ch = is.read()) != -1) {
len = is.available();
b.append((char) ch);
t = new TextBox("Https Result", b.toString(),
b.length(), 0);
} catch (Exception e) {
e.printStackTrace();
String s = e.toString();
if(s != null) {
t = new TextBox("Https Error", s, s.length(),
0);
} finally {
if (is != null) {
try {
is.close();
} catch (Exception ce) { }
if (c != null) {
try {
c.close();
} catch (Exception ce) { }
display.setCurrent(t);
}re: code tags, please see http://forum.java.sun.com/help.jspa?sec=formatting.
As for the rest:
See, we now know that you used keytool to generate you certificate. You need a new certificate. This time, when keytool asks you for a first and last name, type 127.0.0.1. -
We're trying to import a dacpac to azure via the new SqlManagementClient DacOperations ImportAsync api I get an exception with the error: "Cannot create a BACPAC from a file that does not contain exported data."
This same dacpac imports fine using an alternate but less friendly API from sql server's tooling. We'd like to use the new management SDK instead for various reasons.Hi Kyle A Wilt,
I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
Thank you for your understanding and support.
Regards,
Sofiya Li
Sofiya Li
TechNet Community Support
Maybe you are looking for
-
Hello. I seem to be having a problem using the RegRead function within vbscript to return a simple value from the registry. When I run it on my workstation (windows 7 x64 sp1), it seems to miss certain registry values that are indeed there (specifica
-
hi everybody, i am new to J2EE. i need to develop an application tat has email facility. i want to be able to email html documents amd some text. so i guess it will be a multipart message. please tell me about some material or tutorial that explains
-
Emailing a jpg or pdf file as an attachment
I have been emailed both a jpg and pdf file that I want to send attached to an email. The email box pops up with the file in the attachment box, then it won't send.
-
Video Levels and Deinterlacing
I have been trying out Premiere Elements 10 and had a couple of questions. First, if I take AVCHD footage and check the video levels in Premiere Pro, it seems to indicate that the video is 0-255 on the RGB scale. Is there any way to test or see the v
-
A215-7422 Audio Issue: High-pitched noise
About 2 weeks ago, the audio would suddenly stop. After restarting the laptop, it would work fine again. This morning, however, the audio completely died. Restarting it only gave me a low frequency click upon start up. Updating the drivers and th